Lesson 9 · Domain 2 — Tool Design & MCP Integration (18% of exam)

Scoping Tools Across Agents & Servers

Last Domain 2 lesson. Three task statements, one theme: an agent — or a whole team — with unrestricted access to everything makes worse decisions than one with a small, well-scoped set of options.

Fewer tools per agent, not more

Giving an agent 18 tools instead of 4–5 doesn't make it more capable — it degrades tool selection reliability by increasing decision complexity at every turn. Worse: agents given tools outside their actual specialization tend to misuse them. A synthesis subagent with web-search access will occasionally go searching instead of synthesizing, even though a dedicated search subagent already exists for exactly that. The fix is scoping: restrict each subagent's tools to what its role actually needs, with narrow, deliberate exceptions for genuinely high-frequency cross-role needs (a scoped verify_fact tool for a synthesis agent, say) rather than open access.

tool_choice: three levels of control

// "auto" (the default) — the model may call a tool, or just respond in text
const auto = await client.messages.create({
  model: "claude-sonnet-5", messages, tools, tool_choice: { type: "auto" },
});

// "any" — the model MUST call some tool, but picks which one
const forcedAny = await client.messages.create({
  model: "claude-sonnet-5", messages, tools, tool_choice: { type: "any" },
});

// forced — a specific named tool runs first, guaranteed
const forcedNamed = await client.messages.create({
  model: "claude-sonnet-5", messages, tools,
  tool_choice: { type: "tool", name: "extract_metadata" },
});

Forced selection is how you guarantee ordering — e.g. an extraction tool must run before any enrichment tool touches its output, in every case, with no dependence on the model choosing to call it first.

MCP server scoping: shared vs. personal, same pattern again

Every tool from every connected server becomes available to the agent simultaneously at connection time — which is exactly why the "fewer tools, scoped by role" principle above matters at the server level too, not just within a single agent's own tool list. And prefer an existing community MCP server for standard integrations (Jira, GitHub) over building one from scratch — reserve custom servers for genuinely team-specific workflows. MCP resources — exposing a catalog (issue summaries, a documentation hierarchy, a database schema) directly — cut down on exploratory tool calls the agent would otherwise need just to figure out what's available.

Built-in tools: match the tool to the search shape

Why this matters beyond the exam

Primary source: the Model Context Protocol docs cover server scoping and resources; Anthropic's Claude API docs cover tool_choice — this lesson closes Domain 2, compressing Task Statements 2.3, 2.4, and 2.5.

Check your understanding

Q1. A synthesis subagent occasionally runs its own web searches, even though a separate search subagent exists for that purpose. What's the most direct fix?
Q2. You need to guarantee a specific tool runs before any others, in a fixed order. Which tool_choice value does this?
Q3. Where should a shared MCP server used by the whole team be configured?

That's Domain 2 wrapped up alongside Domain 3. Ready to move into Domain 4, prompt engineering and structured output? Just say the word.