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