The capability
What tool use is
As you already know, a model can only output text, so it can't do things like look up an order or issue a refund by itself. Tool use is basically how it gets those things done. The model writes a request in a fixed format, where it names a tool and the arguments it wants to call it with. Then your code checks that request and runs the real function, and it sends the result back so the model can keep going.
Each request also carries an id, and your code uses that id to match each result to the request it answers when the model asks for several tools at the same time. Once the result comes back, the model can answer from it or ask for another tool, and if the result isn't enough to go on, it can ask the person a question.
M3 showed you the round trip in its simplest form, where a model asks for the weather in Paris and your code goes and fetches it. If you get the weather wrong, or fetch it twice, it doesn't cost anything. A refund is different, because a wrong amount or a second refund is real money, so a lot more has to happen between the model's request and the result. The refund in the figure goes through seven stages, and five of them run in your code.

None of this makes the model understand your business. It picks a tool based on the name and description you wrote, and it fills in the arguments from whatever text happens to be in front of it. So if two tools have overlapping names, or an argument means something the description never mentions, even a strong model is going to call it wrong. Tool use doesn't make a call safe either. If a model gets refunds right 95% of the time, that's still one wrong refund in twenty, and whether that one costs money depends on the checks your code runs in stages 2 to 5, which the model never sees.
Why this is a capability of its own
M10 already decided who's allowed to call a tool and how much power each tool gets, and M9 already retries failed calls and caps how long a run can go. What neither of them covers is whether the model calls the right tool with the right arguments in the first place, and what it gets back when it doesn't. Getting those two things right is hard even for strong models. τ-bench is a benchmark where a model serves simulated customers of an airline and a retailer, and it does that with tools and a written policy. With function calling, gpt-4o succeeded on 61.2% of the retail tasks and 35.2% of the airline tasks, and the paper's abstract says agents "succeed on <50% of the tasks, and are quite inconsistent (pass^8 < 25% in retail)" (Yao et al., 2024). The airline tasks include cancelling reservations and giving refunds under the policy, which is pretty close to the example in this module. Those were mid-2024 models and newer ones may do better, but you should still take the inconsistency seriously, because it comes from the whole setup, tools and policy included, and a newer model doesn't change your tools.
Where it shows up
- A coding agent that reads and edits files and runs the tests, like the one in M16 and M17.
- An internal operations assistant that looks up accounts and changes them for a team, which is the example here.
- A retrieval tool that searches a document store and returns passages, which M19 builds on.
- An MCP server, which is a separate program that publishes tools any compatible agent can call, and that's how a lot of companies expose their product to agents now. Section 13 builds one for the billing tools.
The tools are different in each of these, but every one of them goes through the same seven stages.
Keep reading
The rest of this lesson is free with an account
Create a free account to read the remaining 18 sections. It takes about twenty seconds and there's nothing to pay. The same account opens the slide decks and CV reviews.
- 02The refund that came out $75 too high
- 03Call a tool when the answer needs data or an action the model doesn't have
- 04The model picks a tool from its definition and nothing else
- 05Draw each tool around one job the business already has a name for
- 06Schemas stop malformed calls, and your code checks what they can't express
- and 13 more
That's the last one written so far
Pick your next module from the board.
