When an AI agent (a model that takes actions through tools) keeps calling the wrong tool, the bug is usually a few sentences you wrote, not the model.
Tool use, or function calling, is how a model asks your code to do something, like look up an order. The model can't run anything itself. It's a loop:
1) You send the model a list of tools. Each one is a name, a plain-English description, and an input_schema (a JSON Schema, a standard way to say "this field is text, that one is required").
2) If a tool fits, the model replies with its name and a value for each field instead of a normal answer. In Anthropic's API that reply comes back marked stop_reason: "tool_use", and nothing has run yet.
3) Your app runs the real function and sends the output back as a tool_result. If it broke, mark it is_error: true and say what to try next.
The model never sees your code. Those three fields are all it knows, so the description mostly steers which tool it picks and what it puts in each field. Anthropic's docs call detailed descriptions the most important factor in tool performance.
Forcing a tool with tool_choice (the setting that can require a call) looks like a fix. But a forced call skips the model's thinking, and on Claude Opus 5.5, Sonnet 5.5 and Fable 5.1 it's rejected outright with a 400 error. There the documented route is "auto", where the model chooses, plus strict: true, which guarantees the values match your schema. Picking the right tool is still mostly down to your descriptions.
So rewrite the tool description before you touch the prompt or switch models.
Quick check before you scroll: Your agent has two tools, get_user and get_account, and keeps calling the wrong one. What is the first thing to check?
The answer
Check the descriptions. The model only knows what each tool does from its name, description and schema, so vague or overlapping text makes it guess. Say what each tool returns, when to use it, and when not to.
New here? I post a bite-size AI / ML concept like this every day. Follow me for the daily drop, and it compounds fast. Why I do it: https://lnkd.in/gK8knHDH