A model with no tools can only think and talk. Tools are how it reaches out and touches the real world: your database, your browser, your repository, your accounts. With them, the agent stops guessing and starts checking.
9.7.1What MCP is
MCP (the Model Context Protocol) is the standard plug for connecting an agent to an outside system. You register a server in a config file, and the agent gains a set of real actions. One plug shape covers every integration, so you never hand-wire them one by one:
Claude Code reads this from an .mcp.json file; most tools read something like it. The servers are swappable; the plug is the same. See modelcontextprotocol.io.
9.7.2Databases, browsers, GitHub, APIs
Once it is wired, "the agent cannot know that" becomes "the agent just looked." Instead of assuming a number, it runs the query:
Instead of describing a bug it drives a real browser and reads the console. Instead of narrating a change it puts that change up for review on GitHub. Each connection turns a guess into a fact.
9.7.3Custom tools
When no ready-made server exists, you write one, in whatever language your tool's SDK uses. A custom tool is a small named function with a typed input, so the model calls it the same way every time:
You are not teaching the agent everything. You are handing it a few exact levers that do the specific things your system needs.
9.7.4When a tool beats a prompt
The rule of thumb: if you explain the same procedure in prose more than twice, it wants to be a tool. Prompts are for judgment; tools are for actions that must be exact and repeatable.
"Carefully format the currency like this, round like that" is a tool waiting to be written. Move the mechanical into tools, and leave the prompt for thinking.
9.7.5Wire up your first tool
This prompt connects your agent to something real:
Do this now: paste the prompt and wire up one connection, then ask your agent a question it can only answer by actually looking.