Skip to content
Data AI Starter

TUTORIALS

CCA-F Part 5: Tool Design and MCP Integration (18%)

Tool description hygiene, structured error responses with categories, MCP roles and primitives, transports (stdio vs Streamable HTTP), and tool scoping per agent.

By Mohamed AL-Kaisi 3 min read 2 views

CCA-F Part 5: Tool Design and MCP Integration (18%)

Part 5 of 7 of Claude Certified Architect — Foundations: a complete self-study tutorial. See all parts.

Domain 4: Tool Design & MCP Integration (18%)

This domain tests whether you can design tools and MCP servers that Claude will use correctly.

The Model Context Protocol (MCP)

MCP is the standard protocol that lets AI applications (the host — e.g., Claude Code, Claude Desktop, VS Code) connect to external servers that expose context and actions.

Roles:

  • Host: the AI application. Manages clients.
  • Client: a connection object inside the host, dedicated to one server.
  • Server: a process (local or remote) that exposes context to the host.

Server primitives — what a server can offer:

  • Tools: executable functions the model can call (a write or compute action).
  • Resources: data the model can read (a file, a database row, an API response).
  • Prompts: reusable templates / few-shot starters.

Client primitives — what the host can offer back to servers:

  • Sampling: server asks the host to run a model completion (lets servers stay model-agnostic).
  • Elicitation: server asks the user for more information.
  • Logging: server sends log messages to the client.

Transports:

  • stdio — local processes. One server per process, low overhead, no auth.
  • Streamable HTTP — remote servers. Supports many clients, bearer-token auth (OAuth recommended).

Tool description hygiene

The single biggest cause of misused tools is a bad description. Rules:

  • Name them so misuse is impossible. grep_file_contents and glob_file_paths is much better than search and find. Disambiguation in the name beats disambiguation in the description.
  • Describe what the tool returns, not just what it does. "Returns up to 100 matching lines with file path and line number."
  • State the failure mode. "Returns an empty list if no matches; never errors on no-match."
  • Type every argument with constraints. Use JSON Schema enum, minimum, maximum, format to push validation upstream.

Structured errors

When a tool fails, return a structured error response rather than free text. The pattern the exam tests:

{
  "isError": true,
  "errorCategory": "TRANSIENT",
  "isRetryable": true,
  "retryAfterSeconds": 30,
  "message": "Upstream API returned 429 (rate limited). Retry after 30 seconds."
}

Categories typically include TRANSIENT (retry), PERMANENT (stop, escalate), INVALID_INPUT (rewrite the call), AUTH (escalate to user). The isRetryable flag lets the calling agent decide automatically; the retryAfterSeconds lets it wait sensibly.

Tool distribution across agents

Do not give every agent every tool. In a multi-agent system:

  • Give read-only tools to many agents; give write tools to as few as possible.
  • A "researcher" agent gets search, fetch, summarise. A "writer" gets draft, save. A "publisher" gets publish. The blast radius of a confused agent is bounded by its tool set.
  • Use MCP server scoping to enforce this at the protocol level, not just by convention.

<a id="domain-5"></a>


← Part 4 of 7: Prompt Engineering and Structured Output (20%) · All parts · Part 6 of 7: Context Management and Reliability (15%) →

Tags LLMs Prompt Engineering
M

Written by

Mohamed AL-Kaisi

Editor-in-chief of the Data & AI Hub.