Tools — How an Agent Acts
An LLM alone can only produce text. Tools are the hands that let it touch the real world — search the web, run code, send an email, query a database. This is how thinking becomes doing.
🎯 By the end you'll understand
What a tool really is (a function the agent can request but doesn't run itself), how function calling turns a model's text into a real action, why a tool's description decides whether it gets used correctly, the four categories of tools, and why tools are exactly where the danger — and the power — of agents lives.
KEY INSIGHTThe one idea to take away
A language model can only write words. A tool is what turns one of those words into an action that actually happens.
In Lesson 2.1 you met the agent loop — think → act → observe → repeat. This lesson is about the act step. That's where tools live. Without tools, an agent is just a very articulate brain in a jar: it can plan a brilliant action and then do absolutely nothing about it. Tools are the wiring from the brain out to the world.
The model never actually runs a tool. It only requests one — by writing out a structured call like get_weather(city="Paris"). A separate piece of software, the runtime, sees that request, runs the real function, and feeds the result back. The model thinks; the runtime acts. Keep those two roles separate in your head and everything about tools makes sense.
DEFINITIONWhat a tool actually is
Strip away the jargon and a tool is just a function the agent is allowed to call. If you've ever written send_email(to, subject, body) in any programming language, you already know what a tool is. It has three things the model needs to know about:
- A name — what the model writes to invoke it, e.g.
search_web. - A description — a plain-English sentence telling the model what the tool does and when to reach for it.
- Inputs (parameters) — the arguments it needs, with their types, e.g. a
querystring, alimitnumber.
Here's the part that trips everyone up at first. The model does not execute the tool. It can't. A language model is a text-prediction engine — it has no internet connection, no file system, no email account. What it can do is write text that says: "I'd like to call search_web with the query "agentic AI 2026"." That request is just structured text. Something else — the surrounding program — reads it, runs the actual function, and hands the answer back.
A tool is a function the agent can request to perform an action it cannot do itself. The model emits a structured call; the runtime executes the real function and returns the result into the loop as a new observation.
The analogy from Lesson 1.1 holds perfectly: the LLM is the brain, tools are the hands. A brain can decide to pick up a cup, but it's the hand that closes around it. The brain never touches the cup directly — it sends a signal, and the hand does the moving.
CORE CONCEPTFunction calling, simply
The mechanism that connects the model's intention to a real action has a name: function calling (sometimes "tool calling" — same thing). Let's walk it slowly, because once you see it, the whole agent stops being magic.
Say the user asks: "What's the weather in Paris?" Here's the full round-trip:
The model decides
It reads the question, looks at the tools it has, and decides get_weather is the right one. Instead of guessing the weather (it doesn't know — that's not in its training), it chooses to call the tool.
The model emits a structured call
It outputs, in a fixed machine-readable format: get_weather(city="Paris"). This is not a chat message to the user — it's a request aimed at the runtime.
The runtime runs the real function
The surrounding program intercepts the call, runs actual code that hits a weather API, and gets back real data: { temp_c: 14, sky: "rain" }.
The result returns as an observation
That data is fed back into the model as a tool result — a new piece of context. Now the model knows the weather, where a second ago it didn't.
The model writes the answer
With the real data in hand, it produces the human reply: "It's 14°C and rainy in Paris right now — bring a jacket."
Notice that this is exactly the loop from Lesson 2.1: the model acts (step 2), the runtime produces an observation (step 4), and the model decides what to do next (step 5). A tool call is one turn of the loop's crank. An agent doing a big task is just this same dance, many times over, with the model deciding after each result whether it's done or needs another tool.
The call has to be in a rigid, predictable format (today, almost always JSON under the hood) so the runtime can parse it reliably and know which function to run with which arguments. "Maybe call the weather thing for Paris" is useless to a program. {"name":"get_weather","arguments":{"city":"Paris"}} is something it can actually execute.
PRACTICALAnatomy of a tool: the schema and the call
How does the model know a tool exists and what it takes? You hand it a tool schema — a small structured description of the tool, written once when you build the agent. Here's a realistic one for our weather tool:
{ "name": "get_weather", "description": "Get the current weather for a city. Use whenever the user asks about temperature, rain, or conditions in a place.", "input_schema": { "type": "object", "properties": { "city": { "type": "string", "description": "City name, e.g. 'Paris'" }, "units": { "type": "string", "enum": ["celsius", "fahrenheit"] } }, "required": ["city"] } }
That schema is the model's entire knowledge of the tool. It never sees the code inside get_weather — only this card describing it. When the model decides to use it, here's the call it emits and the result that comes back:
// the model emits this — it does NOT run it get_weather(city="Paris", units="celsius") // the runtime runs the real function and returns: { "temp": 14, "sky": "rain", "wind_kph": 12 } // now the model can write the human answer
This is illustrative — real frameworks wrap it in a bit more ceremony — but the shape is exactly right. Schema in, call out, result back. Hold that picture.
SEE ITTool-Call Visualizer
Pick a request below. Watch the agent choose a tool from its toolbox, emit the structured call, receive a simulated result, and write the final answer. The last request is a trap — there's no tool for it. See what the agent does then.
CORE CONCEPTWhy the description matters more than you'd think
Here's a thing that surprises new builders: the model picks which tool to use almost entirely from the tool's description. Not from the code, which it never sees. Not from the name alone. From that one plain-English sentence you wrote.
This makes the description the single most leveraged thing about a tool. A vague description leads to a confused agent that grabs the wrong tool, calls it at the wrong time, or fills in the wrong arguments. A sharp one makes the agent reach for the right hand every time.
| Description | What the model does |
|---|---|
"Handles data." | Shrugs. Could mean anything — uses it randomly or never. |
"Search internal docs." | Better, but when? For what kinds of question? |
"Search the company's internal HR docs for policy questions about leave, benefits, or conduct. Returns matching passages." | Crisp. The model knows exactly when to reach for it and what it'll get back. |
The same goes for parameter descriptions. Telling the model a parameter is a date isn't enough — does it want 2026-06-07 or June 7? Say so. Writing tool descriptions is genuinely a craft, and it's most of what separates a flaky agent from a reliable one. You'll feel this directly when you build your own in Lesson 4.5.
A good tool description answers two questions a confused intern would ask: "When should I use this?" and "What exactly do I put in each box?" If your sentence answers both, the model will use the tool well.
FRAMEWORKFour kinds of tools
Tools come in roughly four flavors. The differences matter because they carry very different levels of risk — which we'll get to in a moment.
Information tools
Tools that read the world without changing it: web search, reading a file, querying a database, fetching a web page. Low risk — they only look.
Computation tools
Tools that compute something the model is bad at on its own: a calculator, a code interpreter that runs Python, a unit converter. The model is famously shaky at exact arithmetic, so handing math to a calculator tool is a classic, smart move.
Action tools
Tools that change the world: send an email, book a flight, write a file, post a message, charge a card. This is where agents earn their keep — and where mistakes have real consequences.
Other agents as tools
An entire agent can be wrapped up and exposed as a single tool to another agent — "ask the research agent." That's the seed of multi-agent systems, which we open up in Lesson 2.7.
Read vs. write. Information and computation tools mostly just read or calculate — a wrong call wastes a few seconds. Action tools change something real — a wrong call sends the wrong email or spends actual money. Treat these two groups completely differently.
WEAKNESSTools are where the risk lives
Here's the uncomfortable truth that the demos never show you. An agent is only as safe as its most dangerous tool. The brain can be cautious and well-intentioned, but if you hand it a tool called delete_all_files or wire_money, then one confident mistake — one misread instruction, one hallucinated argument — and the damage is real and immediate.
This is the flip side of the whole "agents take actions" promise from Lesson 1.1. The moment your AI can act, a mistake stops being a wrong sentence you can ignore and becomes a wrong action you may not be able to undo. The capability and the risk are the exact same feature seen from two sides.
Any tool that deletes data, spends money, sends communications, or can't be undone needs a guardrail: a human approval step, a hard limit, a sandbox, or a confirmation. The safest action tools are ones that are reversible or cheap to get wrong. We dig into agent risks in Lesson 2.9 and into real guardrails in Stage 4.
The practical takeaway: when you give an agent a tool, ask "what's the worst this tool can do if the model calls it wrong?" For get_weather, nothing. For send_email, an embarrassing message. For transfer_funds, a catastrophe. Match the guardrail to the blast radius.
CONTEXTA standard way to share tools
So far we've talked as if you hand-build every tool for every agent. Early on, everyone did exactly that — and it meant the same tool (say, "search our docs") got rebuilt over and over for every new agent, in every framework, in slightly incompatible ways.
The fix is a shared standard. The leading one today is MCP — the Model Context Protocol — a common "plug shape" for exposing tools (and data) so that any agent can connect to any tool server without custom glue. Think of it like USB: instead of a different cable for every device, one standard port. A team publishes an MCP server for its database; any compliant agent can plug in and use it.
MCP turns tools from one-off code you write into reusable building blocks you connect. That's a big deal for building real agents — and it's the whole subject of Lesson 2.8. For now, just file away: there's a standard plug for tools, and it's called MCP.
WEAKNESSCommon mistakes to avoid
It doesn't. The model only requests a call as structured text; the runtime runs the real function and feeds the result back. Confusing these two roles is the single most common misunderstanding about agents — and it hides exactly where the safety controls belong (the runtime, not the model).
The model picks tools from their descriptions. Vague description, wrong tool. The smartest model in the world can't reliably use a tool labeled "handles stuff". Description quality is a top driver of agent reliability.
Past a point, a cluttered toolbox hurts — the model gets confused choosing between similar-looking tools, and every extra tool eats context (Lesson 2.3). A few sharp, well-described tools beat twenty overlapping ones.
KEY INSIGHTWhere this connects in your course
- The agent loop (2.1) — a tool call is the "act → observe" half of the loop you already learned.
- Context (2.3) — every tool schema and every tool result takes up the agent's limited working memory; tools and context are tightly linked.
- Multi-agent systems (2.7) — a whole agent can be exposed to another agent as just one more tool.
- MCP (2.8) — the standard "plug" for exposing tools so any agent can use them.
- Risks & safety (2.9) — tools are where mistakes become real-world damage, so they're where guardrails go.
- Building agents (4.5) — you'll write your own tool schemas and descriptions, and feel firsthand how much wording matters.
Hold the picture: schema in, call out, result back, looped. Tools are how an agent reaches out of its own head and into the world — for better and for worse.
GLOSSARYKey terms introduced
- Tool
- A function an agent can request to perform an action it can't do itself (search, compute, send, write).
- Function calling
- The mechanism by which the model emits a structured call, the runtime executes the real function, and the result returns into the loop. Also called tool calling.
- Tool schema
- The structured description of a tool — its name, description, and parameters — that the model uses to decide whether and how to call it.
- Tool description
- The plain-language sentence in the schema telling the model what a tool does and when to use it; the main thing driving correct tool selection.
- Tool result
- The data returned by running a tool, fed back to the model as a new observation in the loop.
- Runtime
- The surrounding program that intercepts the model's tool calls, runs the actual functions, and returns the results. The model thinks; the runtime acts.
- MCP
- Model Context Protocol — a standard way to expose tools and data so any compliant agent can connect to them (Lesson 2.8).
ACTIVE RECALLCheck your understanding
Answer in your own words first, then reveal.
1Does the language model run its own tools? Explain what actually happens.›
No. The model only requests a tool by emitting a structured call (like get_weather(city="Paris")). The runtime — the surrounding program — intercepts that request, runs the real function, and feeds the tool result back into the loop as an observation. The model thinks; the runtime acts.
2Why does a tool's description matter so much?›
Because the model chooses which tool to use almost entirely from the description (it never sees the code). A vague description leads to the wrong tool, wrong timing, or wrong arguments; a sharp one that says when to use it and what to put in each parameter makes the agent reliable. Description quality is one of the biggest drivers of agent reliability.
3What are the four categories of tools, and which one carries the most risk?›
Information (read/search), computation (calculator, run code), action (send email, book, write, pay), and other agents as tools. Action tools carry the most risk because they change the real world — a wrong call can spend money or send the wrong message, sometimes irreversibly. The key split is read vs. write.
4What should you do before handing an agent a powerful action tool?›
Ask "what's the worst this tool can do if the model calls it wrong?" and match the guardrail to the blast radius — a human approval step, a hard limit, a sandbox, or a confirmation for anything that deletes data, spends money, sends communications, or can't be undone. Prefer tools that are reversible or cheap to get wrong (more in Lesson 2.9 and Stage 4).