Lesson 4 of 6
Tool use in a coding agent
7 min read
A model can only produce text. So how does a coding agent open a file, run your tests, or search your project?
Tools turn words into actions
On its own, a model just writes text. What makes a coding agent act is its tools: a fixed set of things it's allowed to do — read a file, edit a file, run a shell command, search the project. Each turn, the agent picks a tool, the harness runs it for real, and the result comes back as the next observation. Plug a tool in and the agent gains a power it proves right away.
A tool is a capability the agent can call: read, edit, run, search. The model chooses; the harness executes; the output feeds the next turn.
MCP: tools beyond the built-ins
The built-in tools cover the basics, but agents can reach further through MCP — the Model Context Protocol, a shared standard for connecting an agent to outside tools and data. With an MCP server, the same agent can query your database, open a ticket, or read your docs — without anyone hard-coding that integration into the agent itself. One standard, many tools.
Built-in tools handle the code; MCP is the open port for everything else — one standard so any tool can plug into any agent.
More tools isn't automatically better. Each tool the agent could call is another choice it has to get right — well-scoped tools with clear names lead to better decisions than a huge, vague toolbox.
The tools that make an agent
- —Read — open a file so the model can see the actual code.
- —Edit — apply a change to the files on disk.
- —Run — execute a shell command (tests, build, lint) and capture the output.
- —MCP — plug in outside tools and data through one shared standard.
A model can only output text. What actually lets a coding agent run your tests?
Continue in the app
Take the whole How AI Coding Agents Work course — tracked
Get your personalized path, progress and streaks in the app — this lesson and every next one, in order.