Skip to content
Claude Certified Architect – Foundations (CCAR-F) Exam Prep

Lesson 10 of 30 · 7 min

x
10/30

Tool Distribution and tool_choice

Video lesson: CCAR-F 10/30: Tool Distribution and tool_choice

tool_choice

ValueEffect
autoClaude decides whether to call a tool. Default when tools are provided
anyClaude must call one of the provided tools
tool (with name)Claude must call that specific tool
noneNo tool calls. Default when no tools are provided

Behaviour to know:

  • With any or tool, the API prefills the assistant turn, so Claude emits no natural-language text before the tool_use block, even if asked to. To get an explanation plus a tool call, use auto and instruct it in a user message.
  • Forcing a tool skips thinking (no thinking block).
  • Manual extended thinking (thinking: {type: "enabled"}) does not allow any or tool; use auto or none.
  • The newest model family (Opus 5.5, Sonnet 5.5, Fable 5.1, Mythos 5.1) returns a 400 for any and tool. Use auto with strict tool use (schema-valid inputs) or structured outputs for a fixed JSON shape.
  • Changing tool_choice invalidates cached message blocks (tool definitions and system prompt stay cached).
  • strict: true on a tool enforces schema-valid inputs; with any on 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 tools field 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: any to "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_choice every turn and losing the prompt cache.

References

  1. Define tools — checked Oct 16, 2026
  2. Subagents in the SDK — checked Oct 16, 2026
  3. 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 answer

    Answer

    auto plus strict tool use, or structured outputs.
  • Why no explanation text with tool_choice: tool?Show answer

    Answer

    The assistant turn is prefilled to force the tool call.
  • Effect of changing tool_choice on caching?Show answer

    Answer

    Cached message blocks are invalidated; tools and system stay cached.
Previous

Progress is saved in this browser.

Next Lesson