← cecilia lee

Tools, MCP, and What Makes a Coding Agent Different

How an agent actually calls a tool, why MCP exists when APIs already do, and what really separates a coding agent from a general-purpose one.

march 2026 · notes

I covered the basic ReAct loop — thought, action, observation — in an earlier note. This one goes one level deeper into two things people tend to gloss over: what "calling a tool" actually means mechanically, and why an entire protocol (MCP) exists for something APIs already seemed to do. Then I'll get to the question I get asked most: what actually makes a coding agent different from, say, a customer-support agent or a research agent.

The model never calls anything

This is the single most useful mental model I have for this whole space: the model doesn't execute tools. It writes text that describes an intent, and something else executes it.

Concretely, when a model "uses a tool," it's producing structured output — typically JSON — naming a tool and its arguments:

{
  "tool": "run_tests",
  "arguments": { "path": "src/payments/" }
}

That's it. That's the entire contribution of the model to "using a tool." A wrapper program — usually called the agent harness or host — reads that JSON, actually runs the test suite, captures stdout/stderr and the exit code, and stuffs the result back into the conversation as the next message. The model then reads that result like any other text and decides what to do next.

This is worth sitting with because it reframes almost every "the AI did X" claim you'll encounter: the model proposed X, and some separate, ordinary piece of software actually did X. All the real-world capability — filesystem access, network calls, shell execution — lives in the harness, not the model. This is also exactly why agent security is a harness problem: the model can ask for anything; what it's actually allowed to do is a permissions question for the code around it, same as any other program with user-supplied input.

Why isn't "just call the API" enough?

Here's the question that confused me longest: every tool an agent uses — GitHub, Slack, a database, a search engine — already has an API. Why do we need a whole separate protocol (MCP — Model Context Protocol) instead of just... calling those APIs?

The honest answer is that nothing stops you from just calling APIs directly, and plenty of simple agents do exactly that. MCP exists to solve a problem that only shows up once you have many agents wanting to use many tools: without a shared standard, every agent application has to write bespoke integration code for every tool it wants — and that code has to describe the tool to the model, handle auth, parse the response, and get updated whenever the API changes. Do that for N different agent apps against M different tools, and you've written roughly N × M bespoke integrations.

MCP standardizes the two halves of that problem separately. A server wraps a tool or system once and exposes its capabilities — tools, and optionally data ("resources") and reusable prompt templates — through one common interface, self-described so any client can discover what's available without hand-written glue. A client (the agent host) speaks that same interface to any MCP server, known or brand new, without writing per-tool integration code. Build a server once; every MCP-speaking agent can use it. Build a client once; it can use every MCP server that exists. N × M collapses toward N + M.

The analogy I keep coming back to: before USB, every peripheral needed its own port and its own driver logic baked into the machine. USB didn't make peripherals more powerful — it made the interface uniform, so anything speaking USB could plug into anything else speaking USB. MCP is doing the same job for "AI agent talks to external system," not "external system exists."

A few concrete things MCP standardizes that raw API access leaves you to reinvent every time: tool discovery (a client can ask a server "what can you do?" and get back structured, model-readable descriptions, instead of a human reading API docs and hand-writing a tool schema); a consistent way to pass structured arguments and get structured results back; and a transport-agnostic connection (a server can run locally over stdio for a tool on your machine, or remotely over HTTP for a hosted service, with the client code mostly unbothered by which). None of this makes any single integration impossible without MCP — it makes the tenth integration as cheap as the first.

How a coding agent actually works

Strip away the branding and a coding agent is the same ReAct loop as any other agent, wired to a particular set of tools: read a file, edit a file (usually as a precise find-and-replace rather than a full rewrite, so a small fix doesn't risk rewriting the whole file), search the codebase (grep-like text search, or a directory listing), and — the one that matters most — run a shell command.

That last tool is doing more work than it looks like. It's how the agent runs the compiler, the test suite, the linter, or a one-off script to check a hypothesis. And that turns out to be the single biggest thing separating coding agents from most other kinds of agents.

What actually makes a coding agent different

Not the fact that it "writes code" — plenty of general-purpose agents can output a code snippet. The real difference is structural:

General-purpose agentCoding agent
Where state lives Mostly in the conversation In the filesystem — a persistent workspace that outlives any one conversation turn
How it checks its own work Usually can't — has to trust its own reasoning, or wait for a human Can run the compiler / test suite and get an objective pass/fail
Typical action Call a scoped API (book a flight, send a message) Execute arbitrary shell commands — far more powerful, far less contained
Failure mode Wrong answer, contained to the conversation Wrong answer that edits real files, runs real commands, or ships

The middle row is the one I'd underline. A travel-booking agent that books the wrong flight has no built-in mechanism to notice it was wrong — the only signal is a human complaining afterward. A coding agent that writes a broken function can run the test suite itself and get an objective, automated verdict before anyone else even sees the change. That closed feedback loop — write code, run tests, read the failure, fix, re-run — is what lets coding agents iterate autonomously across many steps in a way that's much harder to pull off safely in domains without a compiler standing in as ground truth.

It cuts the other way too. That same shell-access tool is exactly why coding agents need more scaffolding around them, not less: sandboxing, permission prompts before destructive commands, git as an undo button, and (per my earlier notes) a memory layer, because a workspace that persists across sessions is worth remembering things about. A support agent restricted to three well-scoped API calls barely needs any of that. A coding agent holding a shell absolutely does.

Put plainly: a coding agent isn't a smarter agent, it's an agent given a more dangerous, more powerful tool (the shell) plus, fortunately, a built-in way to grade its own homework (the test suite) that most other agents don't get. Both halves of that trade explain almost everything about how coding agents are built differently from the rest of the field.

Personal notes, simplified on purpose. If something here is wrong or has moved on since I wrote it, let me know.