Task 2.3
Tool Distribution
Optimal tool counts and distribution across agents
📘What You Need to Know
The 4–5 Tool Rule
Tool selection quality degrades as the number of available tools grows. The optimal range is 4–5 tools per agent — enough capability for focused domain work without overwhelming Claude's selection process. Each additional tool competes for attention in the context window and increases the probability of wrong selection.
When a single agent has 18 or more tools, selection accuracy drops significantly. The model wastes tokens evaluating irrelevant options and makes more errors choosing between similar tools. The architectural fix is never "write a better system prompt" — it is distribute tools across specialized subagents.
Keep 4–5 tools per agent. At 18+ tools, selection quality degrades significantly. Split into specialized subagents with a coordinator.
Distributing Tools Across Subagents
A hub-and-spoke coordinator delegates to domain-specific subagents, each with a focused tool set. The coordinator keeps orchestration tools (Task, summarize_results, format_response) while subagents own domain operations.
- •Customer agent: lookup_customer, update_account, verify_identity, check_status
- •Order agent: find_order, process_refund, update_shipping, track_package
- •Comms agent: send_email, send_sms, create_ticket, escalate_human
- •Coordinator: Task, summarize_results, format_response (3–4 orchestration tools)
Group tools by domain boundary, not by alphabetical order or API source. Natural groupings reveal subagent responsibilities.
tool_choice Options
The tool_choice parameter controls how Claude selects tools at the API level. Three modes matter for the exam:
auto (default): Claude decides whether to use a tool and which one. Use this for normal agentic loops where the model should signal completion via end_turn.
any: Claude must use a tool but can choose which one. Use when you need guaranteed tool invocation without specifying which tool.
forced: {"type": "tool", "name": "specific_tool"} — forces a specific tool call. Use when business logic requires a particular tool at a particular step.
Forcing tool_choice to "any" to prevent the agent from returning text creates infinite loops. The agent cannot signal end_turn and keeps calling tools indefinitely. Use forced only when you need a specific tool, not to block completion.
When Distribution Beats Prompt Engineering
If a coordinator with 22 tools frequently selects the wrong one, the exam answer is always architectural redistribution — not prompt tweaks, not removing descriptions, and not forcing tool_choice on every call.
Removing tool descriptions to save context is an anti-pattern that makes selection worse. Forcing tool_choice on every iteration prevents natural loop termination. The correct fix: audit tools by function, group into 4–5 tool subagents, and let the coordinator delegate via the Task tool.
// Coordinator — orchestration only (3 tools)
tools: ["Task", "summarize_results", "format_response"]
// Customer subagent — 4 domain tools
tools: ["lookup_customer", "update_account", "verify_identity", "check_status"]
// Order subagent — 4 domain tools
tools: ["find_order", "process_refund", "update_shipping", "track_package"]
// tool_choice usage
tool_choice: "auto" // default — model decides
tool_choice: "any" // must call a tool, any tool
tool_choice: { "type": "tool", "name": "find_order" } // forced specific toolSubagent Tool Distribution Checklist
Before deploying a multi-agent system, verify each subagent has a clear domain name, 4–5 related tools, no overlap with other subagents, and structured error propagation back to the coordinator.
The coordinator should have the fewest tools — primarily Task for delegation plus synthesis utilities. Domain mutations and lookups belong in subagents where context stays focused and tool selection stays accurate.
⚠️Exam Traps
Trap: Giving one agent 18+ tools instead of distributing across subagents
Why it's wrong: Tool selection accuracy degrades significantly beyond ~5 tools per agent.
Trap: Improving the system prompt when an agent with 20+ tools selects incorrectly
Why it's wrong: Prompt engineering cannot overcome tool count degradation — this is an architectural problem.
Trap: Setting tool_choice to "any" to prevent the agent from finishing with text
Why it's wrong: Forcing tool use blocks end_turn, creating an infinite loop where the agent never signals completion.
Trap: Removing tool descriptions to reduce context usage in large tool sets
Why it's wrong: Descriptions guide selection — removing them makes wrong-tool errors worse, not better.
✓Concept Check
A coordinator agent has 22 tools and frequently selects the wrong one. What is the best fix?
🔨Build Exercise
Intermediate40 minutesRedesign Tool Distribution
What you'll learn
- •Audit a monolithic agent and identify natural subagent boundaries
- •Create specialized subagents with 4–5 focused tools each
- •Configure tool_choice appropriately for coordinator and subagents