A model only writes text. A program does the rest.
The program lists tools in the context. The model writes an answer, or a call to a tool. The program runs the call, puts the result in the context, and calls the model again. That loop is how an AI acts.
new words
- Tool use, function calling
- The model writes a request to run a tool, in a fixed shape, in place of an answer.
- Tool result
- What the tool returns. It goes into the context like a message.
- Agent loop
- Model, tool, result, model again, until the model writes an answer in text.
- MCP
- Model Context Protocol, an open standard. A server describes its tools once, and every AI app that speaks MCP can call them.
the lesson
A model can only write tokens. It cannot open a file, search, or send a mail. A program around it can.
The program puts a list of tools in the context: each tool's name, what it does, and what it needs. When a tool helps, the model writes a call in place of an answer, for example search("refund rule"). The program runs it and puts the result in the context. Then it calls the model again, with everything so far. The model writes another call, or the answer.
That loop is what the field calls an AI agent. Claude Code runs it on your computer: it reads files, runs commands, checks, and goes round again (Claude basics, lesson 1). Each round sends the whole context again, every tool result included, so a long task costs more with each round (AI hygiene, lesson 7). This site says your AI for a person's own AI, and agent for an AI that is a member of a team.
MCP is how one set of tools reaches many AI apps. A server describes its tools in one standard way, and each app reads the list when it connects. One instibrain brain is such a server: Claude Code, Codex and Claude on the web call the same tools on it.
The model never runs anything itself. The risk is in what the program lets a call do, and in text that makes the model write a call nobody asked for: lesson 5.
try it
In a Claude Code window, type this and press Enter:
Count the .md files in this folder. Then list each tool you called, what you asked it, and what it returned.
you should see
- One or more tool calls, such as a file search or a command, each with its result.
- Then the count, in text. The loop ended when the model wrote text, not a call.