Loading...
    • Developer Guide
    • API Reference
    • MCP
    • Resources
    • Release Notes
    Search...
    ⌘K
    First steps
    Intro to ClaudeQuickstart
    Models & pricing
    Models overviewChoosing a modelWhat's new in Claude 4.6Migration guideModel deprecationsPricing
    Build with Claude
    Features overviewUsing the Messages APIHandling stop reasonsPrompting best practices
    Model capabilities
    Extended thinkingAdaptive thinkingEffortFast mode (beta: research preview)Structured outputsCitationsStreaming MessagesBatch processingPDF supportSearch resultsMultilingual supportEmbeddingsVision
    Tools
    OverviewHow tool use worksTutorial: Build a tool-using agentDefine toolsHandle tool callsParallel tool useTool Runner (SDK)Strict tool useTool use with prompt cachingServer toolsTroubleshootingTool referenceWeb search toolWeb fetch toolCode execution toolMemory toolBash toolComputer use toolText editor tool
    Tool infrastructure
    Manage tool contextTool combinationsTool searchProgrammatic tool callingFine-grained tool streaming
    Context management
    Context windowsCompactionContext editingPrompt cachingToken counting
    Files & assets
    Files API
    Agent Skills
    OverviewQuickstartBest practicesSkills for enterpriseClaude API skillUsing Skills with the API
    Agent SDK
    OverviewQuickstartHow the agent loop works
    MCP in the API
    MCP connectorRemote MCP servers
    Claude on 3rd-party platforms
    Amazon BedrockMicrosoft FoundryVertex AI
    Prompt engineering
    OverviewConsole prompting tools
    Test & evaluate
    Define success and build evaluationsUsing the Evaluation ToolReducing latency
    Strengthen guardrails
    Reduce hallucinationsIncrease output consistencyMitigate jailbreaksStreaming refusalsReduce prompt leak
    Administration and monitoring
    Admin API overviewData residencyWorkspacesUsage and Cost APIClaude Code Analytics APIAPI and data retention
    Console
    Log in
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...
    Loading...

    Solutions

    • AI agents
    • Code modernization
    • Coding
    • Customer support
    • Education
    • Financial services
    • Government
    • Life sciences

    Partners

    • Amazon Bedrock
    • Google Cloud's Vertex AI

    Learn

    • Blog
    • Catalog
    • Courses
    • Use cases
    • Connectors
    • Customer stories
    • Engineering at Anthropic
    • Events
    • Powered by Claude
    • Service partners
    • Startups program

    Company

    • Anthropic
    • Careers
    • Economic Futures
    • Research
    • News
    • Responsible Scaling Policy
    • Security and compliance
    • Transparency

    Learn

    • Blog
    • Catalog
    • Courses
    • Use cases
    • Connectors
    • Customer stories
    • Engineering at Anthropic
    • Events
    • Powered by Claude
    • Service partners
    • Startups program

    Help and security

    • Availability
    • Status
    • Support
    • Discord

    Terms and policies

    • Privacy policy
    • Responsible disclosure policy
    • Terms of service: Commercial
    • Terms of service: Consumer
    • Usage policy
    Tools

    Troubleshooting tool use

    Fix the most common tool-use errors with symptom-to-fix diagnostic tables.

    Symptom-to-fix tables for the most common tool-use errors. Each fix cross-references the page that owns the feature.

    Claude calls the wrong tool

    SymptomLikely causeFix
    Claude calls tool A when you wanted tool BDescription ambiguitySharpen descriptions. Differentiate tools by WHEN to use them, not only WHAT they do. See Define tools.
    Claude never calls your toolTool name collision or overly-generic schemaCheck for duplicate names across your tool list. Add input_examples to make the intended use concrete.
    Claude calls with wrong parameter typesModel guessing at ambiguous schemaAdd strict: true (if your schema is in the supported subset) or add input_examples.

    Claude invents tool parameters

    SymptomLikely causeFix
    Parameter that doesn't exist in your schemaModel over-generation without strict modeAdd strict: true if your schema is in the supported subset.
    Parameter values outside your enumMissing strict mode or too-large enumShrink the enum or add input_examples showing valid choices.

    Parallel tool calls don't work

    SymptomLikely causeFix
    Claude calls tools sequentially when parallel would be betterMessage history formattingSend multiple tool_result blocks in ONE user message, not one per turn. See Parallel tool use.
    disable_parallel_tool_use seems ignoredSet too late in the conversationMust be set on the request that returns tool_use. Setting it on a later request has no effect on earlier tool calls.

    Cache keeps invalidating

    SymptomLikely causeFix
    Every request is a cache misstool_choice varying between requestsKeep tool_choice stable or place the cache_control breakpoint before the variation point. See Tool use with prompt caching.
    Adding a tool mid-conversation breaks cacheTool prepended to the tools arrayUse defer_loading: true with tool search to append the tool inline instead of modifying the array head.

    Errors at request time

    ErrorCauseFix
    tool_use ids were found without tool_result blocks immediately afterMissing tool_result for some tool_use ids, or tool_result is not the first content block in the user messageReturn one tool_result for every tool_use block in the assistant response. Put tool_result blocks before any text. See Handle tool calls and Parallel tool use.
    Input schema is not compatible with strict mode: string patterns are not supportedUsing pattern with strict: trueRemove the pattern or drop strict: true. The pattern keyword is not in the supported JSON Schema subset yet.
    All tools have defer_loading: trueNo tools visible to the modelAt least one tool must be immediately loaded. The tool search tool itself must never have defer_loading: true.

    JSON escaping differences (Opus 4.6+)

    SymptomCauseFix
    String comparison on tool inputs fails with newer modelsUnicode and forward-slash escaping differs between model versionsParse with json.loads() or JSON.parse(). Never do raw string matching on serialized input.

    Next steps

    Define tools

    Write schemas and descriptions that steer Claude toward the right tool.

    Handle tool calls

    Execute tools and return results in the required message format.

    Tool reference

    Full directory of Anthropic-schema tools and their version strings.

    Was this page helpful?

    • Claude calls the wrong tool
    • Claude invents tool parameters
    • Parallel tool calls don't work
    • Cache keeps invalidating
    • Errors at request time
    • JSON escaping differences (Opus 4.6+)
    • Next steps