Your Agent Isn't Bad at Tools. Your Tool Descriptions Are.

Every vendor demo shows an agent gliding through tool calls like it was born to it. Then you ship one, and it calls the wrong endpoint, invents an argument your schema never asked for, and retries the same broken call until your budget screams. The model isn't the problem. The contract you handed it is.

Reliable tool selection isn't a smarter model. It's a better description, a tighter schema, and a validation gate that refuses to execute anything it hasn't checked. That's the whole game — and most teams skip all three, then blame the LLM.

The description is the documentation — and yours is probably vague

The model never sees your implementation. It sees a name, a paragraph of prose, and a JSON schema. That paragraph is the only documentation it gets, and a vague one produces flaky routing between similar tools. Anthropic puts it bluntly: "Provide extremely detailed descriptions. This is by far the most important factor in tool performance." If two tools overlap and you haven't said which one wins and why, you're asking the model to guess — and it will, badly, in production.

A loose schema is an invitation to hallucinate arguments

Tight schemas rule out whole classes of bad calls before anything runs: required fields marked required, enums for closed sets, additionalProperties: false so the model can't invent parameters. OpenAI's Structured Outputs will even guarantee the arguments match your schema — but shape is not correctness. A perfectly-shaped call to the wrong tool is still wrong. Validate again in your own code, every time.

Never execute a call you haven't checked

Validation is the gate between the model's output and your systems. Unknown tool name, missing required argument, wrong type — reject it safely, with no side effects, and hand the model a specific error: what failed, which field, what a valid call looks like. A vague "failed" teaches it nothing and invites it to repeat the same call. Every call gets a result, including failed ones — and a failure must be marked as a failure, not returned as an empty success. Swallowing errors is how agents confidently report a refund they never issued.

512 tools is a ceiling, not a target

Gemini lets you declare up to 512 functions in one request. That is an upper bound, not a design goal. A dozen well-described tools with distinct purposes will be selected far more reliably than a hundred overlapping ones. When the catalogue grows, narrow the set offered on each turn to what that step can plausibly need — or put a router in front of it.

The verdict

An agent that "usually works" is an agent you can't put in front of users. The difference between a demo and a deployable tool loop is unglamorous plumbing: descriptions that actually describe, schemas that actually constrain, validation before execution, honest errors fed back to the model, and a stop condition so nothing loops forever. Do that work and the model looks brilliant. Skip it and no amount of prompt engineering saves you.

Go deeper

Read the full article on Agentic Affairs: How Autonomous Agents Perform Tool Selection and API Calling Reliably

Originally published on Agentic Affairs (https://agentic-affairs.com)