Tool Distribution and tool_choice
tool_choice
| Value | Effect |
|---|---|
auto | Claude decides whether to call a tool. Default when tools are provided |
any | Claude must call one of the provided tools |
tool (with name) | Claude must call that specific tool |
none | No tool calls. Default when no tools are provided |
Behaviour to know:
- With
anyortool, the API prefills the assistant turn, so Claude emits no natural-language text before thetool_useblock, even if asked to. To get an explanation plus a tool call, useautoand instruct it in a user message. - Forcing a tool skips thinking (no
thinkingblock). - Manual extended thinking (
thinking: {type: "enabled"}) does not allowanyortool; useautoornone. - The newest model family (Opus 5.5, Sonnet 5.5, Fable 5.1, Mythos 5.1) returns a 400 for
anyandtool. Useautowith strict tool use (schema-valid inputs) or structured outputs for a fixed JSON shape. - Changing
tool_choiceinvalidates cached message blocks (tool definitions and system prompt stay cached). strict: trueon a tool enforces schema-valid inputs; withanyon models that support it, this guarantees both a call and valid input.
Model support changes by release; check the model's page before relying on forced tool use.
Distributing tools across agents (design guidance, plus verified mechanics)
- Giving one agent many tools degrades selection and wastes context. Give each agent a small, relevant set and put specialist tool sets on specialist subagents (verified: a subagent's
toolsfield limits it to exactly those tools; omitted tools do not exist for it). - For very large tool libraries, use deferred loading and tool search (
defer_loading; in Claude Code, MCP tool search is on by default) so only needed tool definitions enter context. - A specific figure such as "keep it to 4 or 5 tools" is a common rule of thumb, not a documented limit.
Parallel tool calls
Claude may return several tool_use blocks in one turn; return every tool_result together in one user message (see 1.1). Independent calls can run concurrently in your harness.
Exam traps
- Using
tool_choice: anyto "make it more reliable" on a model family that rejects it. - Expecting an explanation before a forced tool call.
- Combining forced tool use with manual extended thinking.
- Handing every tool to every agent.
- Changing
tool_choiceevery turn and losing the prompt cache.
References
- Define tools — checked Oct 16, 2026
- Subagents in the SDK — checked Oct 16, 2026
- MCP in Claude Code — checked Oct 16, 2026
Check your understanding
You need a guaranteed JSON-shaped output on a model that rejects forced tool use. Options?Show answerHide answer
Answer
autoplus strict tool use, or structured outputs.Why no explanation text with
tool_choice: tool?Show answerHide answerAnswer
The assistant turn is prefilled to force the tool call.Effect of changing
tool_choiceon caching?Show answerHide answerAnswer
Cached message blocks are invalidated; tools and system stay cached.