Tool Distribution & Least Privilege
CoreDistribute tools appropriately across agents and configure tool choice · Difficulty 3/5
In multi-agent systems, each agent should have access to only the tools it needs for its specific role (principle of least privilege).
Problem: Over-Permissioned Agents
Giving an agent too many tools (e.g., 18 instead of 4-5) degrades selection reliability by increasing decision complexity. A document analysis agent with a general-purpose fetch_url tool might:
Solution: Scoped Tools
Replace general tools with purpose-specific ones:
fetch_url -> load_document (validates URL points to document format)analyze_content -> extract_web_results (clearly web-specific)Tool Scoping Strategies
verify_fact tool for simple lookups while complex queries go through the coordinatortool_choice Configuration
| Setting | Behavior | Use Case |
|---|
|---------|----------|----------|
| `"auto"` (default) | Claude decides whether and which tool to call | Most situations |
|---|---|---|
"any" | Claude must call a tool (any tool) | Guarantee tool usage, no conversational text |
{"type": "tool", "name": "..."} | Force a specific tool | Ensure a prerequisite step runs first |
Forced selection is useful for multi-step pipelines: force extract_metadata on the first turn, then let Claude choose tools freely on subsequent turns.
Key Takeaways
- ✓Each agent should have only the tools needed for its specific role (4-5 tools, not 18)
- ✓Replace general-purpose tools with purpose-specific constrained tools
- ✓Use tool_choice forced selection to guarantee prerequisite tools run first
- ✓tool_choice 'any' guarantees a tool call; 'auto' lets Claude decide
Related Concepts
Test Yourself1 of 2
Production logs reveal that your document analysis agent sometimes conducts ad-hoc web searches using its general-purpose fetch_url tool, duplicating the web search agent's work and producing inconsistent results. What's the most effective architectural fix?