troubleshooting-tool-use changedagents-and-tools/tool-use/troubleshooting-tool-use
Nearest release: v2.1.330, published under an hour before this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.
Recorded here
Lines+27added
Lines−27removed
From line
8
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits10to this page, all time
The whole hunk
from line 8, old and new numbered
/
from line 8
88
99## Claude calls the wrong tool
1010
11| Symptom | Likely cause | Fix |
12| ------------------------------------------ | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
13| Claude calls tool A when you wanted tool B | Description ambiguity | Sharpen descriptions. Differentiate tools by WHEN to use them, not only WHAT they do. See [Define tools](https://platform.claude.com/docs/en/agents-and-tools/tool-use/define-tools). |
14| Claude never calls your tool | Tool name collision or overly generic schema | Check for duplicate names across your tool list. Add `input_examples` to make the intended use concrete. |
15| Claude calls with wrong parameter types | Ambiguous schema | Add `strict: true` (if your schema is in the supported subset) or add `input_examples`. |
11| Symptom | Likely cause | Fix |
12| ----- | ----- | ----- |
13| Claude calls tool A when you wanted tool B | Description ambiguity | Sharpen descriptions. Differentiate tools by WHEN to use them, not only WHAT they do. See [Define tools](https://platform.claude.com/docs/en/agents-and-tools/tool-use/define-tools). |
14| Claude never calls your tool | Tool name collision or overly generic schema | Check for duplicate names across your tool list. Add `input_examples` to make the intended use concrete. |
15| Claude calls with wrong parameter types | Ambiguous schema | Add `strict: true` (if your schema is in the supported subset) or add `input_examples`. |
1616
1717## Claude invents tool parameters
1818
19| Symptom | Likely cause | Fix |
20| ------------------------------------------- | ----------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
19| Symptom | Likely cause | Fix |
20| ----- | ----- | ----- |
2121| Parameter that doesn’t exist in your schema | Model over-generation without strict mode | Add `strict: true` if your schema is in the [supported subset](https://platform.claude.com/docs/en/agents-and-tools/tool-use/strict-tool-use). |
22| Parameter values outside your enum | Missing strict mode or too-large enum | Shrink the enum or add `input_examples` showing valid choices. |
22| Parameter values outside your enum | Missing strict mode or too-large enum | Shrink the enum or add `input_examples` showing valid choices. |
2323
2424## Parallel tool calls don’t work
2525
26| Symptom | Likely cause | Fix |
27| ------------------------------------------------------------- | -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
28| Claude calls tools sequentially when parallel would be better | Message history formatting | Send multiple `tool_result` blocks in ONE user message, not one per turn. See [Parallel tool use](https://platform.claude.com/docs/en/agents-and-tools/tool-use/parallel-tool-use). |
29| `disable_parallel_tool_use` seems ignored | Set too late in the conversation | Set it on the request that returns `tool_use`. Setting it on a later request has no effect on earlier tool calls. |
26| Symptom | Likely cause | Fix |
27| ----- | ----- | ----- |
28| Claude calls tools sequentially when parallel would be better | Message history formatting | Send multiple `tool_result` blocks in ONE user message, not one per turn. See [Parallel tool use](https://platform.claude.com/docs/en/agents-and-tools/tool-use/parallel-tool-use). |
29| `disable_parallel_tool_use` seems ignored | Set too late in the conversation | Set it on the request that returns `tool_use`. Setting it on a later request has no effect on earlier tool calls. |
3030
3131## Cache keeps invalidating
3232
33| Symptom | Likely cause | Fix |
34| ------------------------------------------- | --------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
35| Every request is a cache miss | `tool_choice`, the thinking configuration, or `output_config.effort` varying between requests | Keep `tool_choice` stable or place the `cache_control` breakpoint before the variation point; hold the thinking configuration and effort level constant for the life of a cached conversation. See [Tool use with prompt caching](https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-use-with-prompt-caching) and [Thinking and prompt caching](https://platform.claude.com/docs/en/build-with-claude/thinking#thinking-and-prompt-caching). |
36| Adding a tool mid-conversation breaks cache | Tool prepended to the tools array | Declare the tool with `defer_loading: true` from the first request and let tool search load it inline, instead of adding it to the array later. |
33| Symptom | Likely cause | Fix |
34| ----- | ----- | ----- |
35| Every request is a cache miss | `tool_choice`, the thinking configuration, or `output_config.effort` varying between requests | Keep `tool_choice` stable or place the `cache_control` breakpoint before the variation point; hold the thinking configuration and effort level constant for the life of a cached conversation. See [Tool use with prompt caching](https://platform.claude.com/docs/en/agents-and-tools/tool-use/tool-use-with-prompt-caching) and [Thinking and prompt caching](https://platform.claude.com/docs/en/build-with-claude/thinking#thinking-and-prompt-caching). |
36| Adding a tool mid-conversation breaks cache | Tool prepended to the tools array | Declare the tool with `defer_loading: true` from the first request and let tool search load it inline, instead of adding it to the array later. |
3737
3838## Errors at request time
3939
4040The Error column shows part of each message, and `...` stands for text that varies.
4141
42| Error | Cause | Fix |
43| ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
44| `tool_use ids were found without tool_result blocks immediately after` | Missing `tool_result` for some `tool_use` IDs, or `tool_result` is not the first content block in the user message | Return one `tool_result` for every `tool_use` block in the assistant response. Put `tool_result` blocks before any text. See [Handle tool calls](https://platform.claude.com/docs/en/agents-and-tools/tool-use/handle-tool-calls) and [Parallel tool use](https://platform.claude.com/docs/en/agents-and-tools/tool-use/parallel-tool-use). |
45| `was found without a corresponding ... block` | The follow-up request keeps a waiting server tool from running | See [A server tool call has no result block](https://platform.claude.com/docs/en/agents-and-tools/tool-use/troubleshooting-tool-use#a-server-tool-call-has-no-result-block). |
46| `Unsupported regex feature in pattern field: ...` | A strict tool’s `pattern` uses a regex feature that strict mode can’t compile, such as a backreference, a word boundary, or a large `{n,m}` range | Simplify the pattern. See [JSON Schema limitations](https://platform.claude.com/docs/en/build-with-claude/structured-outputs#json-schema-limitations). |
47| `Invalid regex in pattern field: ...` | A strict tool’s `pattern` has a lookahead, a lookbehind, or a syntax error | Remove any lookahead or lookbehind and fix any syntax errors. See [JSON Schema limitations](https://platform.claude.com/docs/en/build-with-claude/structured-outputs#json-schema-limitations). |
48| `All tools have defer_loading: true` | No tools visible to the model | At least one tool must be immediately loaded. The tool search tool itself must never have `defer_loading: true`. |
42| Error | Cause | Fix |
43| ----- | ----- | ----- |
44| `tool_use ids were found without tool_result blocks immediately after` | Missing `tool_result` for some `tool_use` IDs, or `tool_result` is not the first content block in the user message | Return one `tool_result` for every `tool_use` block in the assistant response. Put `tool_result` blocks before any text. See [Handle tool calls](https://platform.claude.com/docs/en/agents-and-tools/tool-use/handle-tool-calls) and [Parallel tool use](https://platform.claude.com/docs/en/agents-and-tools/tool-use/parallel-tool-use). |
45| `was found without a corresponding ... block` | The follow-up request keeps a waiting server tool from running | See [A server tool call has no result block](https://platform.claude.com/docs/en/agents-and-tools/tool-use/troubleshooting-tool-use#a-server-tool-call-has-no-result-block). |
46| `Unsupported regex feature in pattern field: ...` | A strict tool’s `pattern` uses a regex feature that strict mode can’t compile, such as a backreference, a word boundary, or a large `{n,m}` range | Simplify the pattern. See [JSON Schema limitations](https://platform.claude.com/docs/en/build-with-claude/structured-outputs#json-schema-limitations). |
47| `Invalid regex in pattern field: ...` | A strict tool’s `pattern` has a lookahead, a lookbehind, or a syntax error | Remove any lookahead or lookbehind and fix any syntax errors. See [JSON Schema limitations](https://platform.claude.com/docs/en/build-with-claude/structured-outputs#json-schema-limitations). |
48| `All tools have defer_loading: true` | No tools visible to the model | At least one tool must be immediately loaded. The tool search tool itself must never have `defer_loading: true`. |
4949
5050### A server tool call has no result block
5151
from line 65
6565
6666## Claude flags tool results as prompt injection
6767
68| Symptom | Likely cause | Fix |
69| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
68| Symptom | Likely cause | Fix |
69| ----- | ----- | ----- |
7070| Claude refuses to act on a tool result, or asks the user to confirm instructions that came from it | Your own instructions are being delivered inside the `tool_result` content | Claude 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 supported models, in a [mid-conversation system message](https://platform.claude.com/docs/en/build-with-claude/mid-conversation-system-messages). Keep the tool result to just the data. See [Mitigate jailbreaks and prompt injections](https://platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/mitigate-jailbreaks#indirect-prompt-injection). |
7171
7272## JSON escaping differences between model versions
7373
74| Symptom | Cause | Fix |
75| -------------------------------------------------------- | ----------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
74| Symptom | Cause | Fix |
75| ----- | ----- | ----- |
7676| String comparison on tool inputs fails with newer models | Unicode and forward-slash escaping differs between model versions | Parse with `json.loads()` or `JSON.parse()`. Never do raw string matching on serialized input. |
7777
7878## Next steps
No line in this hunk matches that.