Skip to main content

Connecting It to the World

Share

Share this page

Pass it to someone who needs it.

Star on GitHub

Key takeaway: Check, don't guess

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:

{ "mcpServers": { "postgres": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://localhost/app"] } } }

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.

MCP is one standard plug the agent reaches real systems through.

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:

SELECT count(*) FROM users WHERE created_at > now() - interval '7 days';

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:

@tool def send_alert(message: str, level: Literal["info", "critical"]) -> str: """Notify the operator. Use 'critical' only for outages.""" post_to_channel(message, level) return "sent"

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.

Mechanical, repeated procedures become tools; judgment stays in the prompt.

9.7.5Wire up your first tool

This prompt connects your agent to something real:

Ready prompt
Act as a senior engineer connecting my agent to my stack. Pick the one connection that would help most right now (my database, my repo, or my browser), set up its MCP server in my tool's config, and show me one real check it can now run instead of guessing. Give it read-only access unless a write is the whole point. Then record the choice as one line in my decision log, and add a line to my rules file telling my agents to check through this tool rather than assume. If you need the full reasoning behind this step, read https://zalt.me/guides/vibe-coding/ai-os/agent-tools My stack and what I want it to see:

Do this now: paste the prompt and wire up one connection, then ask your agent a question it can only answer by actually looking.

Mahmoud Zalt

Mahmoud Zalt

Software engineer, 16+ yrs · built Sistava.com in 3 months, idea to production, using these methods

Resources
Star on GitHubContribute
Donate

Support my work

A small tip keeps the free work coming.

© 2026 Mahmoud Zalt. Free to read, not to republish.
Copyright & license