By Abhijith N M · Reviewed 24 October 2026 · Editorial standards
Your support agent has four tools. In the demo it called lookup_order every time. In production it calls get_customer three times, then asks the customer to repeat the order number.
The tools did not change. The traffic did. Real requests arrive as a refund, an address change or a delivery question, and each one leaves the model to pick a tool under ambiguity.
A tool description is not documentation for humans. It is the text the model reads at the moment it chooses. When the text does not say when to call the tool, and when not to, the model fills the gap with a guess.
You cannot predict it, and neither can the model. Both descriptions fit a refund request, so the choice depends on wording you did not control. One boundary sentence — use this only when you have an order id — turns the guess into a decision.
At every turn the model receives the tool list inside the request. Each entry has three fields. The name is a stable identifier. The description is free text. The input_schema is a JSON object that declares the allowed arguments, their types and which ones are required.
The model sees nothing else. It cannot read your service code, your database or your tests. Everything it knows about a tool arrives in those three fields, and those fields are the part you can change without changing the model.
That is why tool choice is a design problem, not a prompt problem. A system prompt line that says 'prefer lookup_order' is a rule the model must remember on every turn. A description that routes the call is a rule the model reads at the moment it matters.
The industry name for this exchange is function calling. The model does not run your function. It emits a structured request, your code executes it, and the result returns as a new message keyed to that request. The description is the only part of the exchange you write for the model rather than for yourself.
Read the diagram from left to right. A request that matches the use sentence becomes a call. A request that the boundary rules out becomes a different call or a question. Nothing else in your system gets a vote.
Write four sentences in a fixed order. The order matters more than the wording, because the model reads for a decision, not for completeness.
| Sentence | Question it answers | Example |
|---|---|---|
| 1. Use it when | Which request does this fit? | Use this to read one existing order by its id. |
| 2. Use it before | What must be true first? | Use it before any refund or address change, because both need the order's current state. |
| 3. Do not use it for | Which valid-looking request is wrong? | Do not search by customer name or email; call get_customer first. |
| 4. It returns | What comes back, and what fails? | Status, items and delivery date, or not_found. |
The third sentence is the one most descriptions miss. A missing boundary is how an agent makes a valid call at the wrong time. If two tools could serve one request, say which one wins, and name the other tool so the model has somewhere to go.
Be concrete about the result too. 'Gets order data' adds nothing to a name that already says lookup. 'Returns status, items and delivery date, or not_found' tells the model what it can do with the answer.
If no boundary sentence separates two tools, you have one tool too many. Merge the pair, or delete the narrower one. A deleted tool cannot be chosen by mistake.
Here is one complete tool definition. The description routes and bounds the call, and the schema keeps the required surface to a single string.
LOOKUP_ORDER = {
"name": "lookup_order",
"description": (
"Use this to read one existing order when you have its order id: "
"status, line items and delivery date. Use it before any refund or "
"address change, because both need the order's current state. Do not "
"use it to search by customer name, email or phone; call get_customer "
"first and pass the order id it returns. Do not use it to start a "
"refund. Returns the order record, or not_found when the id is "
"unknown. Example: lookup_order(order_id='A17')."
),
"input_schema": {
"type": "object",
"properties": {
"order_id": {
"type": "string",
"description": "Order id such as A17. Not a customer id.",
},
"include_lines": {
"type": "boolean",
"description": (
"Include line items. Defaults to false; set true only when "
"the answer depends on which items were bought."
),
},
},
"required": ["order_id"],
},
}Two details carry weight. include_lines defaults to false, so the common call stays short, and its description says when to turn it on. required holds one field, because every extra required argument is another chance to be wrong.
A description change is a behaviour change. Treat it like one: write down the requests you expect each tool to win, then replay them whenever the tool list changes. A stale description is the most common reason a routing test starts failing after a harmless-looking refactor.
TOOL = {
"name": "lookup_order",
"description": (
"Use this to read one order when you have its id. Do not use it to "
"search by customer name. Returns the order, or not_found."
),
"input_schema": {
"type": "object",
"properties": {"order_id": {"type": "string"}},
"required": ["order_id"],
},
}
REQUIRED_KEYS = {"name", "description", "input_schema"}
def audit(tool: dict) -> list[str]:
problems = []
if not REQUIRED_KEYS.issubset(tool):
problems.append("missing a required key")
if "do not use" not in tool["description"].lower():
problems.append("no boundary sentence")
if not tool["input_schema"].get("required"):
problems.append("no required argument")
return problems
print(audit(TOOL) or "passes the three checks")The check catches three common failures: a missing field, no boundary sentence and no required argument. It cannot tell you the description is clear. For that, replay labelled requests and compare the tool the model chose with the tool you expected.
Key takeaways
The model chooses from the name, the description and the input schema, not from your code.
Write the description as four sentences: use it when, use it before, do not use it for, and what it returns.
The negative sentence is the boundary that stops a valid call at the wrong time.
Keep the schema small and typed, and never make the model invent an id.
Test a description like behaviour: replay labelled requests and compare the chosen tool.
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.