blob: ba483b9306b3d34ec6434ebaf3afd3ac72f1b4ab [file] [log] [blame]
httprr trace v1
14168 2249
POST https://api.anthropic.com/v1/messages HTTP/1.1
Host: api.anthropic.com
User-Agent: Go-http-client/1.1
Content-Length: 13970
Anthropic-Version: 2023-06-01
Content-Type: application/json
{
"model": "claude-3-7-sonnet-20250219",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "What tools are available to you? Please just list them briefly.",
"cache_control": {
"type": "ephemeral"
}
}
]
}
],
"max_tokens": 8192,
"tools": [
{
"name": "bash",
"description": "Executes a shell command using bash -c with an optional timeout, returning combined stdout and stderr.\nWhen run with background flag, the process may keep running after the tool call returns, and\nthe agent can inspect the output by reading the output files. Use the background task when, for example,\nstarting a server to test something. Be sure to kill the process group when done.\n\nExecutables pre-installed in this environment include:\n- standard unix tools\n- go\n- git\n- rg\n- jq\n- gopls\n- sqlite\n- fzf\n- gh\n- python3",
"input_schema": {
"type": "object",
"required": [
"command"
],
"properties": {
"command": {
"type": "string",
"description": "Shell script to execute"
},
"timeout": {
"type": "string",
"description": "Timeout as a Go duration string, defaults to 1m if background is false; 10m if background is true"
},
"background": {
"type": "boolean",
"description": "If true, executes the command in the background without waiting for completion"
}
}
}
},
{
"name": "keyword_search",
"description": "\nkeyword_search locates files with a search-and-filter approach.\nUse when navigating unfamiliar codebases with only conceptual understanding or vague user questions.\n\nEffective use:\n- Provide a detailed query for accurate relevance ranking\n- Prefer MANY SPECIFIC terms over FEW GENERAL ones (high precision beats high recall)\n- Order search terms by importance (most important first)\n- Supports regex search terms for flexible matching\n\nIMPORTANT: Do NOT use this tool if you have precise information like log lines, error messages, filenames, symbols, or package names. Use direct approaches (grep, cat, go doc, etc.) instead.\n",
"input_schema": {
"type": "object",
"required": [
"query",
"search_terms"
],
"properties": {
"query": {
"type": "string",
"description": "A detailed statement of what you're trying to find or learn."
},
"search_terms": {
"type": "array",
"items": {
"type": "string"
},
"description": "List of search terms in descending order of importance."
}
}
}
},
{
"name": "think",
"description": "Think out loud, take notes, form plans. Has no external effects.",
"input_schema": {
"type": "object",
"required": [
"thoughts"
],
"properties": {
"thoughts": {
"type": "string",
"description": "The thoughts, notes, or plans to record"
}
}
}
},
{
"name": "title",
"description": "Sets the conversation title and creates a git branch for tracking work. MANDATORY: You must use this tool before making any git commits.",
"input_schema": {
"type": "object",
"properties": {
"title": {
"type": "string",
"description": "A concise title summarizing what this conversation is about, imperative tense preferred"
},
"branch_name": {
"type": "string",
"description": "A 2-3 word alphanumeric hyphenated slug for the git branch name"
}
},
"required": [
"title",
"branch_name"
]
}
},
{
"name": "done",
"description": "Use this tool when you have achieved the user's goal. The parameters form a checklist which you should evaluate.",
"input_schema": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Checklist",
"description": "A schema for tracking checklist items with status and comments",
"type": "object",
"required": [
"checklist_items"
],
"properties": {
"checklist_items": {
"type": "object",
"description": "Collection of checklist items",
"properties": {
"wrote_tests": {
"$ref": "#/definitions/checklistItem",
"description": "If code was changed, tests were written or updated."
},
"passes_tests": {
"$ref": "#/definitions/checklistItem",
"description": "If any commits were made, tests pass."
},
"code_reviewed": {
"$ref": "#/definitions/checklistItem",
"description": "If any commits were made, the codereview tool was run and its output was addressed."
},
"git_commit": {
"$ref": "#/definitions/checklistItem",
"description": "Create git commits for any code changes you made. Match the style of recent commit messages. Include 'Co-Authored-By: sketch \u003chello@sketch.dev\u003e' and the original user prompt. Use GIT_AUTHOR_NAME=\"Test Agent\" GIT_AUTHOR_EMAIL=\"totallyhuman@sketch.dev\" (not git config)."
}
},
"additionalProperties": {
"$ref": "#/definitions/checklistItem"
}
}
},
"definitions": {
"checklistItem": {
"type": "object",
"required": [
"status"
],
"properties": {
"status": {
"type": "string",
"description": "Current status of the checklist item",
"enum": [
"yes",
"no",
"not applicable",
"other"
]
},
"description": {
"type": "string",
"description": "Description of what this checklist item verifies"
},
"comments": {
"type": "string",
"description": "Additional comments or context for this checklist item"
}
}
}
}
}
},
{
"name": "codereview",
"description": "Run an automated code review.",
"input_schema": {
"type": "object",
"properties": {}
}
},
{
"name": "multiplechoice",
"description": "Present the user with an quick way to answer to your question using one of a short list of possible answers you would expect from the user.",
"input_schema": {
"type": "object",
"description": "The question and a list of answers you would expect the user to choose from.",
"properties": {
"question": {
"type": "string",
"description": "The text of the multiple-choice question you would like the user, e.g. 'What kinds of test cases would you like me to add?'"
},
"responseOptions": {
"type": "array",
"description": "The set of possible answers to let the user quickly choose from, e.g. ['Basic unit test coverage', 'Error return values', 'Malformed input'].",
"items": {
"type": "object",
"properties": {
"caption": {
"type": "string",
"description": "The caption, e.g. 'Basic coverage', 'Error return values', or 'Malformed input' for the response button. Do NOT include options for responses that would end the conversation like 'Ok', 'No thank you', 'This looks good'"
},
"responseText": {
"type": "string",
"description": "The full text of the response, e.g. 'Add unit tests for basic test coverage', 'Add unit tests for error return values', or 'Add unit tests for malformed input'"
}
},
"required": [
"caption",
"responseText"
]
}
}
},
"required": [
"question",
"responseOptions"
]
}
},
{
"name": "browser_navigate",
"description": "Navigate the browser to a specific URL and wait for page to load",
"input_schema": {
"type": "object",
"properties": {
"url": {
"type": "string",
"description": "The URL to navigate to"
}
},
"required": [
"url"
]
}
},
{
"name": "browser_click",
"description": "Click the first element matching a CSS selector",
"input_schema": {
"type": "object",
"properties": {
"selector": {
"type": "string",
"description": "CSS selector for the element to click"
},
"wait_visible": {
"type": "boolean",
"description": "Wait for the element to be visible before clicking"
}
},
"required": [
"selector"
]
}
},
{
"name": "browser_type",
"description": "Type text into an input or textarea element",
"input_schema": {
"type": "object",
"properties": {
"selector": {
"type": "string",
"description": "CSS selector for the input element"
},
"text": {
"type": "string",
"description": "Text to type into the element"
},
"clear": {
"type": "boolean",
"description": "Clear the input field before typing"
}
},
"required": [
"selector",
"text"
]
}
},
{
"name": "browser_wait_for",
"description": "Wait for an element to be present in the DOM",
"input_schema": {
"type": "object",
"properties": {
"selector": {
"type": "string",
"description": "CSS selector for the element to wait for"
},
"timeout_ms": {
"type": "integer",
"description": "Maximum time to wait in milliseconds (default: 30000)"
}
},
"required": [
"selector"
]
}
},
{
"name": "browser_get_text",
"description": "Get the innerText of an element",
"input_schema": {
"type": "object",
"properties": {
"selector": {
"type": "string",
"description": "CSS selector for the element to get text from"
}
},
"required": [
"selector"
]
}
},
{
"name": "browser_eval",
"description": "Evaluate JavaScript in the browser context",
"input_schema": {
"type": "object",
"properties": {
"expression": {
"type": "string",
"description": "JavaScript expression to evaluate"
}
},
"required": [
"expression"
]
}
},
{
"name": "browser_screenshot",
"description": "Take a screenshot of the page or a specific element",
"input_schema": {
"type": "object",
"properties": {
"selector": {
"type": "string",
"description": "CSS selector for the element to screenshot (optional)"
},
"format": {
"type": "string",
"description": "Output format ('base64' or 'png'), defaults to 'base64'",
"enum": [
"base64",
"png"
]
}
}
}
},
{
"name": "browser_scroll_into_view",
"description": "Scroll an element into view if it's not visible",
"input_schema": {
"type": "object",
"properties": {
"selector": {
"type": "string",
"description": "CSS selector for the element to scroll into view"
}
},
"required": [
"selector"
]
}
},
{
"name": "patch",
"description": "File modification tool for precise text edits.\n\nOperations:\n- replace: Substitute text with new content\n- append_eof: Append new text at the end of the file\n- prepend_bof: Insert new text at the beginning of the file\n- overwrite: Replace the entire file with new content (automatically creates the file)\n\nUsage notes:\n- All inputs are interpreted literally (no automatic newline or whitespace handling)\n- For replace operations, oldText must appear EXACTLY ONCE in the file",
"input_schema": {
"type": "object",
"required": [
"path",
"patches"
],
"properties": {
"path": {
"type": "string",
"description": "Absolute path to the file to patch"
},
"patches": {
"type": "array",
"description": "List of patch requests to apply",
"items": {
"type": "object",
"required": [
"operation",
"newText"
],
"properties": {
"operation": {
"type": "string",
"enum": [
"replace",
"append_eof",
"prepend_bof",
"overwrite"
],
"description": "Type of operation to perform"
},
"oldText": {
"type": "string",
"description": "Text to locate for the operation (must be unique in file, required for replace)"
},
"newText": {
"type": "string",
"description": "The new text to use (empty for deletions)"
}
}
}
}
}
}
}
],
"system": [
{
"text": "You are an expert coding assistant and architect, with a specialty in Go.\nYou are assisting the user to achieve their goals.\n\nStart by asking concise clarifying questions as needed.\nOnce the intent is clear, work autonomously.\n\nCall the title tool early in the conversation to provide a brief summary of\nwhat the chat is about.\n\nBreak down the overall goal into a series of smaller steps.\n(The first step is often: \"Make a plan.\")\nThen execute each step using tools.\nUpdate the plan if you have encountered problems or learned new information.\n\nWhen in doubt about a step, follow this broad workflow:\n\n- Think about how the current step fits into the overall plan.\n- Do research. Good tool choices: bash, think, keyword_search\n- Make edits.\n- Repeat.\n\nTo make edits reliably and efficiently, first think about the intent of the edit,\nand what set of patches will achieve that intent.\nThen use the patch tool to make those edits. Combine all edits to any given file into a single patch tool call.\n\nFor renames or refactors, consider invoking gopls (via bash).\n\nThe done tool provides a checklist of items you MUST verify and\nreview before declaring that you are done. Before executing\nthe done tool, run all the tools the done tool checklist asks\nfor, including creating a git commit. Do not forget to run tests.\n\n\u003cplatform\u003e\nlinux/amd64\n\u003c/platform\u003e\n\u003cpwd\u003e\n/\n\u003c/pwd\u003e\n\u003cgit_root\u003e\n\n\u003c/git_root\u003e\n\u003cHEAD\u003e\n\n\u003c/HEAD\u003e\n",
"type": "text",
"cache_control": {
"type": "ephemeral"
}
}
]
}HTTP/2.0 200 OK
Anthropic-Organization-Id: 3c473a21-7208-450a-a9f8-80aebda45c1b
Anthropic-Ratelimit-Input-Tokens-Limit: 200000
Anthropic-Ratelimit-Input-Tokens-Remaining: 199000
Anthropic-Ratelimit-Input-Tokens-Reset: 2025-05-06T02:52:06Z
Anthropic-Ratelimit-Output-Tokens-Limit: 80000
Anthropic-Ratelimit-Output-Tokens-Remaining: 80000
Anthropic-Ratelimit-Output-Tokens-Reset: 2025-05-06T02:52:10Z
Anthropic-Ratelimit-Requests-Limit: 4000
Anthropic-Ratelimit-Requests-Remaining: 3999
Anthropic-Ratelimit-Requests-Reset: 2025-05-06T02:52:05Z
Anthropic-Ratelimit-Tokens-Limit: 280000
Anthropic-Ratelimit-Tokens-Remaining: 279000
Anthropic-Ratelimit-Tokens-Reset: 2025-05-06T02:52:06Z
Cf-Cache-Status: DYNAMIC
Cf-Ray: 93b52df649282523-SJC
Content-Type: application/json
Date: Tue, 06 May 2025 02:52:10 GMT
Request-Id: req_011CNqX3XPUGXJBNMCWBpMaN
Server: cloudflare
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
Via: 1.1 google
X-Robots-Tag: none
{"id":"msg_01De9PhPGpXjkZks75fsrXew","type":"message","role":"assistant","model":"claude-3-7-sonnet-20250219","content":[{"type":"text","text":"I have the following tools available to me:\n\n1. `bash` - Execute shell commands\n2. `keyword_search` - Search for files in a codebase\n3. `think` - Record thoughts and plans\n4. `title` - Set conversation title and create git branch\n5. `done` - Mark task as complete with checklist\n6. `codereview` - Run automated code review\n7. `multiplechoice` - Present multiple choice options to user\n8. `browser_navigate` - Navigate to URL\n9. `browser_click` - Click element using CSS selector\n10. `browser_type` - Type text into input fields\n11. `browser_wait_for` - Wait for element to appear\n12. `browser_get_text` - Get text from element\n13. `browser_eval` - Run JavaScript in browser\n14. `browser_screenshot` - Take screenshot\n15. `browser_scroll_into_view` - Scroll to element\n16. `patch` - Make precise text edits to files\n\nThese tools allow me to help with coding tasks, navigate webpages, make file edits, and manage conversation state."}],"stop_reason":"end_turn","stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":3303,"cache_read_input_tokens":0,"output_tokens":259}}