Tool Interface Design
The description is the selection mechanism
Anthropic's guidance: detailed descriptions are "by far the most important factor in tool performance". A description should say:
- what the tool does
- when to use it and when not to
- what each parameter means and how it changes behaviour
- caveats and limits, including what the tool does not return
Aim for at least 3 to 4 sentences per tool, more for complex tools.
Definition fields
| Field | Notes |
|---|---|
name | Must match ^[a-zA-Z0-9_-]{1,128}$ |
description | Plain text, as above |
input_schema | JSON Schema for the parameters |
input_examples | Optional; each example must validate against the schema or the request fails with a 400; costs roughly 20 to 50 tokens (simple) up to 100 to 200 (nested) |
Also available per tool: cache_control, strict, defer_loading, allowed_callers.
Design rules
- Prioritise descriptions; add
input_examplesfor complex or format-sensitive inputs. - Consolidate related operations into fewer tools with an
actionparameter, not one tool per verb (create_pr,review_pr,merge_pr). - Namespace names when tools span services (
github_list_prs,slack_send_message). - Return high-signal output only: stable identifiers (slugs, UUIDs), just the fields Claude needs next. Bloated responses waste context.
- Ask for an explanation, not reasoning: a parameter that asks for the model's step-by-step thinking can trigger a
reasoning_extractionrefusal.
Why overlapping tools fail (design guidance)
If two tools have near-identical descriptions (for example search_orders and lookup_orders), the model must guess. Fix the interface, not the prompt: merge them, or rewrite each description so the boundary is explicit ("use X for ids, Y for free-text search; X does not return history").
Poor vs good: "Gets the stock price for a ticker." (no when, no returns, no params) vs a description that states the exchange scope, returned currency, when to use it, and that it returns nothing else.
Exam traps
- Fixing wrong tool choice with a longer system prompt when the descriptions are the problem.
- Vague parameter docs (
"type": "string"and nothing else). - One tool per tiny action, which multiplies near-duplicates.
- Returning entire records when two fields were needed.
- Names with spaces or dots (fail the name regex).
References
- Define tools — checked Oct 16, 2026
Check your understanding
Two tools are confused with each other. First fix?Show answerHide answer
Answer
Rewrite or merge descriptions so the boundary is explicit.What happens if an
input_examplesentry violates the schema?Show answerHide answerAnswer
400 error.Better design:
create_pr,review_pr,merge_pr, or oneprtool withaction?Show answerHide answerAnswer
One tool withaction(fewer, more capable tools).