MCP in one paragraph
Confirmed in official docsPlain languageMCP (Model Context Protocol) is a standard way to plug outside systems into an AI agent. One MCP server can offer three different kinds of things: tools the model can actively call to take an action (like 'process this refund'), resources you manually attach with an @-mention (data, not actions), and prompts — saved templates you invoke yourself, the same way you'd invoke a slash command. Knowing which of the three a question is really about is often the whole answer.
TechnicalAn MCP server can expose tools (model-callable actions), resources (@-mentionable data attachments), and prompts (user-invoked templates surfaced in Claude Code as slash commands, e.g. /mcp__servername__promptname, with arguments passed after the command name).
Why it matters
The three primitives serve genuinely different purposes (agent-initiated action vs. user-attached data vs. user-invoked template) — conflating them leads to picking a mechanism that technically can't do what's needed (e.g. expecting a 'resource' to be auto-invoked like a tool).
Tools are chosen by their descriptions
Confirmed in official docsPlain languageThe model decides which tool to use mostly by reading each tool's description, the same way you'd pick a document off a shelf by reading its label. If the model keeps grabbing the wrong tool, the usual fix isn't scolding it — it's that the label (description) is vague or under-sells what the tool actually does. If two tools do overlapping things, the cleanest fix is often to merge them into one tool with a parameter, so there's no longer a choice to get wrong.
TechnicalTool selection is driven substantially by the tool's description field. Vague descriptions cause the model to default to a more thoroughly-described competing tool. The structural fix for two semantically overlapping tools is consolidation into a single tool with a discriminating parameter, removing the ambiguous choice rather than just wording around it.
Why it matters
Fixing wording is cheap and immediate; fixing the underlying overlap (consolidation) is what prevents the same misselection from recurring as more tools get added.
Give the agent structured, instructive errors
Confirmed in official docsPlain languageA generic 'Operation failed' message leaves the agent guessing, so it tends to either give up too fast, retry pointlessly, or ask the user something unhelpful. A much better error tells the agent what kind of problem this is (temporary glitch? bad input? not allowed?), whether trying again is even worth it, and ideally what to try instead — e.g. 'Order not found — try searching by phone number.'
TechnicalReturn structured error metadata: a category (transient / validation / permission), a retryable boolean, and a short cause. Anthropic's documented recommendation goes further: write instructive, type-specific messages describing what went wrong and what to try next, not just a category flag.
Why it matters
Structured, instructive errors let the agent choose the right recovery deterministically instead of guessing — this is explicitly called out as Anthropic's documented best practice for tool design.
Preventing fabricated tool arguments
Per study guidePlain languageIf the agent invents a fake ID instead of looking one up first, the real problem is usually that nothing ever told it where that value is supposed to come from. Spelling it out directly in the tool's description — 'this ID must come from a prior lookup call, never assumed' — fixes the behavior at the source instead of patching it after the fact.
TechnicalFabricated parameters typically trace back to a tool description that doesn't state the parameter's required provenance. The fix is to explicitly document the dependency (e.g., 'order_id must be obtained from a prior lookup_order call and must never be assumed') so the model is directed to call the prerequisite tool first.
Why it matters
This is another instance of the 'fix the root cause, not the symptom' pattern — validating or rejecting the fabricated value after the fact treats the symptom, while documenting provenance in the description prevents the fabrication from happening at all.