Stage 3 · Teens · Agents
Tools & Tool-Calling Patterns
Designing tools so an agent can use them without guessing.
You already saw the mechanics: the model emits a structured call, the harness runs it, a result comes back. This lesson is about designing those tools — names, descriptions, and scope — because the model has no other information about what a tool does, what it expects, or what it returns. The description is part of the prompt.
Good tools are how an agent reads or changes the world without improvising: searching the web, reading/writing files, calling APIs, running code, querying databases. Bad tools leak that improvisation into irreversible actions.
Worked example. Consider two ways of exposing flight functionality to an agent.
A well-designed tool, get_flight_price(origin, destination, date), does exactly one narrow thing and says so plainly: it returns a price for one specific route and date, and doesn't book anything. Given "find me a cheap flight to somewhere warm this weekend," the model calls it several times — once per candidate destination and date — and can directly compare the real numbers it gets back.
A poorly-designed tool, travel_tool(query), tries to handle searching, pricing, booking, and cancelling all through one free-text query string with a vague description ("handles anything travel-related"). Faced with the same request, the model can't tell whether one call will just search or actually purchase a ticket — the ambiguity in the tool's own scope leaks into ambiguity in the model's behavior. In the worst case, it ends up booking something the user only wanted priced, simply because the tool gave it no way to express "just look, don't act."
- Narrow, well-named tools are easier for a model to use correctly than one giant do-everything tool.
- Tool descriptions are part of the prompt — vague descriptions lead to misuse, including irreversible actions the user didn't intend.
- Returning structured, concise tool results helps the model reason about them accurately.