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.

Step Through an Agent's Reasoning
ObserveUser asks: "What's the weather in the city where our next meeting is?"

Step through a realistic multi-tool agent trace.

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."

Well-Designed vs. Poorly-Designed Tool
get_flight_price(origin, destination, date)
Returns the price of a direct flight for one specific origin/destination/date combination. Does not book anything.
User: "Find me a cheap flight to somewhere warm this weekend"
Model does: Calls get_flight_price() multiple times, once per candidate destination and date, to compare actual prices.
✓ Outcome: Model gathers real prices for Lisbon, Malaga, and Palma, then reports the cheapest with numbers to back it up.
Same underlying capability, same request — the tool's scope and description alone change what the model does.

Toggle between the two tool designs to see how the same request plays out differently.

  • 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.
Check your understanding
1. Why does tool description quality matter so much?
2. In the flight-tool example, what specifically goes wrong with the single "travel_tool(query)" design?
All lessons in Stage 3: Agents and safety