By Abhijith N M · Reviewed 24 October 2026 · Editorial standards
When the model decides which tool to call, the only information it has is your description and schema. Treat them as prompt engineering, because that is what they are.
SEARCH_TOOL = {
"name": "search_sources",
"description": (
"Search the approved source index for documents matching a query. "
"Use this when you need facts you do not already have. "
"Do NOT use it to fetch a document you already have an id for - "
"use read_source instead."
),
"parameters": {
"type": "object",
"properties": {
"query": {"type": "string", "description": "Keywords, not a sentence"},
"max_results": {"type": "integer", "minimum": 1, "maximum": 10,
"description": "How many results to return. Default 5."},
},
"required": ["query"],
},
}| Anti-pattern | What happens | Fix |
|---|---|---|
do_everything(action, params) | The model picks the wrong action constantly | Split into named tools |
| Twenty similar tools | Selection accuracy drops | One tool with an enum argument |
| Optional everything | Calls that are technically valid but useless | Make the important args required |
Vague names (process, handle) | The model guesses | Name the action: refund_order, search_sources |
Key takeaways
The tool description is a prompt: state when to use it and when not to.
Schema constraints (required, min/max, type) prevent whole classes of bad calls.
Prefer a few well-named tools over one generic dispatcher.
Above ~7 tools, split the agent rather than growing the list.
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.