By Abhijith N M · Reviewed 24 October 2026 · Editorial standards
Your support agent has two order tools. One is get_order and the other is fetch_order_details. Both call the same order service. In production the agent picks the wrong one, retries, then asks the customer to repeat the order number.
Nothing about the model changed between the demo and production. The tool list changed. Two names described one action, so the model had to guess.
A tool the model cannot choose correctly is a design bug. Fix the spec, not the prompt. A prompt line that says 'prefer lookup_order' is a rule the model must remember on every turn.
The honest answer is that you cannot predict it, and neither can the model. handle is broad enough to cover a refund, and orders looks narrow enough to be wrong. Two overlapping descriptions make the choice a coin flip.
At every turn the model holds a list of tools. It reads each name, description and input schema, then decides three things. An input schema is the JSON document that lists the allowed arguments.
When an agent calls the wrong tool, read the names first. When it sends invalid arguments, read the schema. When it makes a call it should never make, look for the missing boundary sentence.
Write names as a verb plus a noun: lookup_order, process_refund, escalate_to_human. The verb says what happens and the noun says what it happens to.
send_invoice beats post_billing_v2_transaction.handle, manage and do say nothing about the effect.Both servers can publish lookup_order, and step 28 covers the naming convention that keeps them apart.
The description is the only text the model reads when it chooses. Write it for a reader who must decide in one pass whether to call this tool or something else.
| Part | The question it answers | Example |
|---|---|---|
| First sentence | When should I use this? | Use this to read one order by its id. |
| Second sentence | When should I not? | Do not search by customer name; call get_customer first. |
| Third sentence | What comes back? | Status, line items and delivery date, or a not_found error. |
| Last line | What does a good call look like? | Example: lookup_order(order_id=A17). |
The second sentence does most of the work. Most confusion comes from missing boundaries, not missing capability. If two tools could serve a request, say which one wins.
Be concrete about the result. 'Gets order data' adds nothing to the name. Say which fields come back, which case fails, and how large the result can get.
Every parameter is a chance to be wrong. Two required strings are easier to call than six optional objects.
With an enum, status is one of open, shipped or cancelled instead of free text. Describe the parameter too: 'order id such as A17, not a customer id' removes the most common invalid call.
An example removes ambiguity about format faster than any sentence. Use real argument names and a realistic value, because the model copies shapes.
LOOKUP_ORDER = {
"name": "lookup_order",
"description": (
"Use this to read the status, items or delivery date of one existing "
"order. Do not search by customer name: call get_customer first and "
"pass the order ids it returns. Returns the order, or not_found. "
"Example: lookup_order(order_id='A17') returns status='shipped'."
),
"input_schema": {
"type": "object",
"properties": {
"order_id": {
"type": "string",
"description": "Order id such as A17. Not a customer id.",
},
},
"required": ["order_id"],
},
}Show order_id='A17' and you get string ids. Show a nested object and you get that object. Choose the example you are willing to receive.
Key takeaways
A tool the model cannot choose correctly is a design bug, so fix the spec rather than the prompt.
Name tools as verb plus noun, one action per name, and keep the name stable.
The description routes: when to use it, when not to, what comes back, and one example call.
Keep the parameter surface small and typed, with enums and descriptions, and never make the model invent ids.
Wrong tool points at the name, invalid arguments at the schema, a wrong call at the boundary.
Written and edited by the nexGenCoders team. Spotted a mistake? Tell us and we will fix it.
Don't lose this lesson
Create a free account to save your progress, keep your streak, and work toward a shareable certificate.