Prompt for tool use
Links on this page to features marked Preview describe designs that are not available yet.
The model decides when to call a tool from three things: your system prompt, the tool’s name and description, and the parameter descriptions. Most tool-use problems are prompt problems.
Say when to use each tool
Use `lookup_order` whenever the customer mentions an order, even if they
don't give the number: ask for it first. Never state an order's status
without calling `lookup_order` in this conversation.Without such a rule, models answer from earlier context or guess.
Write descriptions for the model, not for developers
| Weak | Strong |
|---|---|
Gets order. | Returns status, items, carrier and tracking URL for one order. Use for any question about where an order is or what it contained. |
q: query string | q: Product name or SKU as the customer wrote it. Do not add words. |
Tell it what to do with results
State whether tool output may be shown verbatim, summarised, or must be checked first: “Tracking URLs from lookup_order can be given to the customer as they are; internal notes in the notes field must never be repeated.”
Handle failure explicitly
If a tool returns an error, try once more with corrected arguments. If it fails
again, apologise and offer to connect the customer with a person. Do not invent
the information the tool would have given.Keep the toolset small
Each tool’s description costs tokens on every call and adds a choice the model can get wrong. Five well-described tools beat twenty overlapping ones. For large catalogues, use tool search.
See also Design good tools.
Was this page helpful?