Skip to content

Quick Reference: Tool Schema ​

Updated: 2026-05-26

Anthropic-Schema Tools ​

ToolNameExecutionDescription
BashbashClientRun shell commands
Text Editortext_editorClientRead, write, edit files
Computer UsecomputerClientControl browser/desktop
MemorymemoryClientManage scratchpad memory
Web Searchweb_searchServerSearch the web
Web Fetchweb_fetchServerFetch URL content
Code Executioncode_executionServerRun Python code
Tool Searchtool_searchServerSearch available tools

User-Defined Tool Schema ​

json
{
  "name": "my_tool",
  "description": "What this tool does",
  "input_schema": {
    "type": "object",
    "properties": {
      "param1": {
        "type": "string",
        "description": "First parameter"
      },
      "param2": {
        "type": "integer",
        "description": "Second parameter"
      }
    },
    "required": ["param1"]
  }
}

Response Format ​

Tool Use Block (from Claude) ​

json
{
  "type": "tool_use",
  "id": "toolu_01ABC123",
  "name": "my_tool",
  "input": {
    "param1": "value",
    "param2": 42
  }
}

Tool Result Block (from your app) ​

json
{
  "type": "tool_result",
  "tool_use_id": "toolu_01ABC123",
  "content": "Result text or array"
}

Gotchas ​

IssueFix
Missing tool_use IDAlways extract id from the tool_use block
Wrong ID in resulttool_use_id must match exactly
Multiple toolsClaude can call several tools in one response
Error in toolReturn the error message as tool_result content
Long resultsLarge outputs count against context window