← Build ExercisesDomain 2
Tool Design & MCP Integration
5 build exercises to practice the concepts in this domain.
2.1Beginner30 minutes
2.1 — Design Tool Descriptions That Eliminate Misrouting
What you will learn
- Tool descriptions are what the model uses to pick a tool.
- A production description states purpose, inputs, examples, edge cases, and boundaries.
- How overlapping descriptions send the call to the wrong tool.
- How a system prompt can override a clear description.
2.2Intermediate45 minutes
2.2 — Build Structured Error Responses for All Four Categories
What you will learn
- An error payload carries errorCategory, isRetryable, and a description.
- An access failure is isError true. A valid empty result is isError false.
- The four categories: transient, validation, business, and permission.
- Recovery follows the metadata: retry, fix the input, change path, or escalate.
2.3Intermediate45 minutes
2.3 — Configure Tool Distribution Across a Multi-Agent System
What you will learn
- Keep about four or five tools on each role.
- Give a role the one cross-role tool it needs so it does not bounce through the coordinator.
- tool_choice auto, any, and a forced tool name cover different guarantees.
- Replace a wide generic tool with a narrower one.
- Check that one role cannot call another role's tools.
2.4Beginner30 minutes
2.4 — Configure MCP Servers with Scoping and Environment Variables
What you will learn
- Project servers live in .mcp.json and travel with the repo.
- Credentials expand from environment variables so they stay out of git.
- User-level config is personal and is not shared by a clone.
- Expose MCP resources so the model does not have to explore for standing data.
- Write MCP tool descriptions that can compete with built-in tool descriptions.
2.5Intermediate30 minutes
2.5 — Trace and Refactor a Deprecated Function Using Built-in Tools
What you will learn
- Grep finds content. Glob finds paths. Use them in that order.
- Discover the codebase in steps instead of reading every file first.
- Edit is the modification tool. Widen the anchor, or use replace_all, when the match is not unique.
- Follow a function through wrappers and barrel files.
- After Grep finds the callers, Glob finds their tests.