• Messages
  • Managed Agents
  • Admin

Search...
⌘K
First steps
Intro to ClaudeQuickstart
Building with Claude
Features overviewUsing the Messages APIStop reasons and fallbackRefusals and fallbackFallback credit
Model capabilities
Extended thinkingAdaptive thinkingEffortTask budgets (beta)Fast mode (research preview)Structured outputsCitationsStreaming MessagesBatch processingSearch resultsStreaming refusalsMultilingual supportEmbeddings
Tools
OverviewHow tool use worksTutorial: Build a tool-using agentDefine toolsHandle tool callsParallel tool useTool Runner (SDK)Strict tool useTool use with prompt cachingServer toolsTroubleshootingWeb search toolWeb fetch toolCode execution toolAdvisor toolMemory toolBash toolComputer use toolText editor tool
Tool infrastructure
Tool referenceManage tool contextTool combinationsTool searchProgrammatic tool callingFine-grained tool streaming
Context management
Context windowsCompactionContext editingPrompt cachingMid-conversation system messagesBuild an orchestration modeCache diagnostics (beta)Token counting
Working with files
Files APIPDF supportImages and vision
Skills
OverviewQuickstartBest practicesSkills for enterpriseSkills in the API
MCP
Remote MCP serversMCP connector
Claude on cloud platforms
Amazon BedrockAmazon Bedrock (legacy)Claude Platform on AWSMicrosoft FoundryVertex AI

Log in
Troubleshooting
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
  • 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
  • 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
Messages/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.

Error: thinking blocks cannot be modified

If a request fails with a 400 invalid_request_error whose message contains `thinking` or `redacted_thinking` blocks in the latest assistant message cannot be modified when continuing a conversation after a tool call, your application is altering the assistant's thinking blocks before sending them back. Send the entire assistant message back unchanged, then append your tool_result.

See Thinking blocks cannot be modified for the full error and fix steps.

Claude flags tool results as prompt injection

SymptomLikely causeFix
Claude refuses to act on a tool result, or asks the user to confirm instructions that came from itYour own instructions are being delivered inside the tool_result contentClaude is trained to treat instructions inside tool results as potentially untrusted third-party content. Move your instructions out of the tool result: send them in a user turn after the tool_result block, or (on Claude Opus 4.8 and later) in a mid-conversation system message. Keep the tool result to just the data. See Mitigate jailbreaks and prompt injections.

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
  • Error: thinking blocks cannot be modified
  • Claude flags tool results as prompt injection
  • JSON escaping differences (Opus 4.6+)
  • Next steps