🗺 Tool Use & MCP
Tools let Claude fetch live data and take actions. You define each tool with a name, a clear description, and an input JSON schema; Claude decides when to call it, you execute it, and you return the result — a loop that repeats until Claude is done. Write descriptions like documentation: the description is the single biggest driver of correct tool use. Independent tools can be called in parallel. MCP (Model Context Protocol) standardises how external systems expose tools, resources, and prompts to Claude, so integrations are reusable across any MCP‑aware client. Always gate destructive or irreversible actions behind human approval or scoped permissions.
An MCP server is a product for models: expose narrowly‑scoped tools (actions), resources (data worth reading into context), and prompts (reusable templates). Keep each tool's scope tight and its description precise; authenticate at the server; treat every input as untrusted. The payoff of doing it once and well: the same server plugs into any MCP‑aware client — Claude Code, desktop, your apps — with no per‑app integration work.
input_schema (JSON Schema). Description quality = tool‑use quality.tool_result → repeat.is_error results so Claude can recover — not raw stack traces.is_error: true + an actionable message (what failed, what valid input looks like).Every tool is defined by “NDS” — Name, Description, Schema. The MCP triad is “TRP” — Tools (do), Resources (read), Prompts (reuse). Destructive action? Gate it — human in the loop.
When a tool fails, “TELL” the model — Tag it (is_error: true), Explain what failed, List what valid input looks like, Let Claude retry. A good error message turns a dead end into a self‑correction.
Practise this domain with original, exam-style questions.
Start practising free