blob: 922c12babd0c7813be7eb7a54b1bfd77849481b3 [file] [log] [blame]
httprr trace v1
14141 2113
POST https://api.anthropic.com/v1/messages HTTP/1.1
Host: api.anthropic.com
User-Agent: Go-http-client/1.1
Content-Length: 13943
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. (Do not call the title tool.)",
"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.",
"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.",
"input_schema": {
"type": "object",
"properties": {
"title": {
"type": "string",
"description": "Brief title (3-6 words) in imperative tense. Focus on core action/component."
}
},
"required": [
"title"
]
}
},
{
"name": "precommit",
"description": "Creates a git branch for tracking work and provides git commit message style guidance. MANDATORY: You must use this tool before making any git commits.",
"input_schema": {
"type": "object",
"properties": {
"branch_name": {
"type": "string",
"description": "A 2-3 word alphanumeric hyphenated slug for the git branch name"
}
},
"required": [
"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, adding --trailer 'Co-Authored-By: sketch \u003chello@sketch.dev\u003e' and --trailer 'Change-ID: s$(openssl rand -hex 8)k'. The git user is already configured correctly."
}
},
"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.\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.\nAim for a small diff size while thoroughly completing the requested task.\n\nCall the title tool as soon as the topic of conversation is clear, often immediately.\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\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: 200000
Anthropic-Ratelimit-Input-Tokens-Reset: 2025-05-09T22:31:39Z
Anthropic-Ratelimit-Output-Tokens-Limit: 80000
Anthropic-Ratelimit-Output-Tokens-Remaining: 80000
Anthropic-Ratelimit-Output-Tokens-Reset: 2025-05-09T22:31:43Z
Anthropic-Ratelimit-Requests-Limit: 4000
Anthropic-Ratelimit-Requests-Remaining: 3999
Anthropic-Ratelimit-Requests-Reset: 2025-05-09T22:31:38Z
Anthropic-Ratelimit-Tokens-Limit: 280000
Anthropic-Ratelimit-Tokens-Remaining: 280000
Anthropic-Ratelimit-Tokens-Reset: 2025-05-09T22:31:39Z
Cf-Cache-Status: DYNAMIC
Cf-Ray: 93d4a5f30d59eb25-SJC
Content-Type: application/json
Date: Fri, 09 May 2025 22:31:43 GMT
Request-Id: req_011CNxkRGmJA1oV5QHGCsb33
Server: cloudflare
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
Via: 1.1 google
X-Robots-Tag: none
{"id":"msg_01Ducpx7QCP6dYEALWPCWx6b","type":"message","role":"assistant","model":"claude-3-7-sonnet-20250219","content":[{"type":"text","text":"Here's a brief list of the tools available to me:\n\n1. bash - Execute shell commands\n2. keyword_search - Search files for specific terms\n3. think - Record thoughts and plans\n4. title - Set conversation title\n5. precommit - Create a git branch for tracking work\n6. done - Mark task as complete with checklist\n7. codereview - Run automated code review\n8. multiplechoice - Present quick answer options to user\n9. Browser tools:\n - browser_navigate - Navigate to URL\n - browser_click - Click element\n - browser_type - Type text\n - browser_wait_for - Wait for element\n - browser_get_text - Get element text\n - browser_eval - Evaluate JavaScript\n - browser_screenshot - Take screenshot\n - browser_scroll_into_view - Scroll element into view\n10. patch - Make precise text edits to files"}],"stop_reason":"end_turn","stop_sequence":null,"usage":{"input_tokens":4,"cache_creation_input_tokens":3264,"cache_read_input_tokens":0,"output_tokens":208}}