What you need to know
The tool definition is the model's only instruction manual for the tool. Most tool misuse is a design problem.
The definition
{
"name": "get_order_status",
"description": "Look up the status of one customer order by its order number. Use when the customer asks where an order is or when it will arrive. order_id is the order number printed on the receipt, such as JO-482913, never a name or email. If the customer has not given it, ask for it before calling.",
"input_schema": {
"type": "object",
"properties": {
"order_id": {"type": "string", "description": "Order number, format JO- followed by 6 digits"}
},
"required": ["order_id"]
}
}
- Say what it does, when to use it, what each parameter means (with format and example) and important limits. Guidance attached to the tool beats a general line in the system prompt.
- Use enums, formats and required fields; strict mode makes inputs match the schema.
tool_choicecan force a tool, but forcing does not fix wrong arguments.
Results the model can act on
| Instead of | Return |
|---|---|
60 fields, internal codes ({"s": 3}) | The few fields needed, readable ("status": "shipped") |
| 2,000 matching records | A capped page, a total count and how to narrow or get more |
"Error" or an empty result | is_error: true with what failed and what to do ("order_id must look like JO-123456") |
| A fake success after an exception | The real failure |
Execution side and approvals
- Client tools run in your application; you choose where. Sensitive tools (payments, records) run server-side, where credentials are protected and calls are logged.
- Server tools (web search, code execution) run on Anthropic's side.
- Risky actions get an approval pattern in the harness: pause, request approval, return a pending result the model can explain. Reads run freely.
Assembling the tool set
- Fewer, distinct tools: merge overlapping ones (list_users, list_users_by_team, get_user_list becomes one tool with filters).
- Clear names and descriptions so tools do not compete.
- Tool search for rarely used tools, so large sets do not crowd every request.
- Validate inputs in the tool and enforce idempotency for side effects.
In the exam
Items show a tool definition, a result payload or a trace of misuse and ask for the revision that most reliably fixes it. Improve the description and schema, shape results, return actionable errors, run sensitive tools server-side with approvals, and consolidate. Distractors add general prompt lines, force tool_choice, return everything, hide errors or add more overlapping tools.
Check your understanding
The model calls get_customer with an email when it needs a numeric ID; the description is "Gets a customer." Fix?
Show answer
Answer: C. The model reads the tool's description when choosing arguments.
An external API is down during a tool call. What should the tool return?
Show answer
Answer: A. The model can then retry, try another path or tell the user.
Broad searches return 2,000 records and overflow context. Best design?
Show answer
Answer: D. Shaped results are actionable and fit the context.
Apply it: Redesign Juniper's get_order tool
Juniper's get_order tool is described as "Gets an order" with one parameter, id (string). Traces show the agent passing the customer's email, receiving {"error": 1}, and telling the customer the order does not exist. When it works, the tool returns 54 fields, including warehouse codes.
- Rewrite the definition (description and schema).
- Design the success and error results.
- Decide where it runs and whether it needs approval.
Done when: a missing or wrong order number leads to a question, not a false "not found."
Show model answer
1. Name get_order_status; description: looks up one order by its order number (format JO- plus six digits, on the receipt and confirmation email), use for status, delivery and contents questions, ask the customer for the number if missing, never pass a name or email. Schema: order_id string with a pattern and example; required.
2. Success: order_id, status in words, items (name, quantity), shipped date, carrier, tracking link, estimated delivery. Error: is_error true, "order_id 'ana@example.com' is not an order number. Order numbers look like JO-482913. Ask the customer for it." Not found: "No order JO-482913. Check the number with the customer."
3. Server-side in Juniper's backend with the read-only orders role; no approval needed for reads (approvals stay on refunds).