Catalog / Single agent
Tool use
The model never touches a system directly. It reads tool descriptions, emits a structured call, and the application runs it and returns the result.
Reference task used across all patterns: "My order arrived damaged. Can I get a refund?"
Topology
Run
08 steps
Ready to run
Play runs the whole scenario. Step advances one event at a time so you can read what happens.
Metrics
| Wall-clock time | 0.0 s |
|---|---|
| Tokens processed | 0 |
| Estimated cost | $0.000 |
| Tool calls | 0 |
All steps
Normal run
- Request arrives. Alongside the message, the model receives a list of tools. Each has a name, a description and typed parameters.
- Choose a tool. Those descriptions are all the model knows about the systems behind them. It picks the order lookup because the description says what it returns.
- Structured call. The model does not run anything. It emits a call as data, and the application executes it and checks the arguments against the schema.
- Result. The result comes back as text in the model's context. It names the unit, so there is nothing to guess.
- Decide. Delivered 12 Sep, inside the 30-day window, damage confirmed by the carrier. A full refund is due.
- Call with exact arguments. The parameter is named amount_cents, so the model converts $240 to 24000. A clear name did that work, not intelligence.
- Confirmation. The tool echoes what it did in human terms, which lets the model notice a mismatch.
- Respond. Refund approved. Two calls, both well-formed on the first try.
Outcome: correct answer. The tools were written for a reader that knows nothing but their descriptions. Names carried units, results were readable, and the schema caught what it could.
Failure mode
- Request arrives. Same agent and same systems. Only the tool definitions differ.
- Look up the order. The lookup works as before.
- Result. Order 4417, total 240. This build's result drops the currency and the unit.
- An ambiguous contract. The refund tool's schema says only “amount: number”. Dollars or cents? The description does not say, so the model has to guess.
- A valid, wrong call. It guesses dollars. The payments API takes cents. The call passes schema validation, because 240 is a perfectly good number.
- Success, technically. The tool returns a bare “ok”. Nothing in the result lets the model see what actually happened.
- Incorrect response. The agent reports success. The customer receives $2.40 for a $240 order.
Failure: an ambiguous tool contract. The model did what the description allowed. Mitigation: put units in parameter names, document each tool as if for a new colleague, validate ranges inside the tool, and return results the model can sanity-check.
Execution trace
Reference
- Problem
- A model can only produce text, but the task needs facts from live systems and actions with real effects.
- Analogy
- A new employee with a phone list. They can only do what the list lets them ask for, and only as well as each entry is described.
- Use when
- The answer depends on data the model does not have, or the task ends in an action. This is the base of almost every other agent pattern.
- Avoid when
- The model can answer from its context alone. Every tool adds latency, tokens for its description, and a new way to be wrong.
- Typical failure
- An ambiguous tool description or schema leads to a call that is well-formed and wrong.
- Also known as
- Tool use (Anthropic)Function calling (OpenAI)Function tools (OpenAI Agents SDK)
- Related patterns
- ReAct loop (composes with)
- Propose and dispose (composes with)
Space play or pause → next step ← previous step R reset F failure mode