ByHeartAI
Intermediate7 min read

Tool Selection

Tool selection is the agent's decision of which tool to use for the current step — it reads each tool's name and description and matches them to the task, so clear tool design directly drives agent reliability.

Explain like I'm new to AI

An agent usually has several tools available — search, calculator, calendar, code runner, database. For each step it must pick the right one. How? It reads each tool's name and description (which you write) and matches them against what the task needs.

Pick a question:

get_weatherGet current weather for a city
calculatorDo exact arithmetic
web_searchLook up current facts on the web
calendarRead the user's schedule

Chosen: It needs exact arithmetic → calculator.

The agent matches the query to a tool using each tool's name and description — so clear descriptions matter.

Because the model decides purely from those descriptions, how you describe a tool is as important as the tool itself. Vague descriptions → wrong choices.

Mental model

Think of a toolbox with labels. If the labels are clear ("cuts wood," "tightens screws"), you grab the right tool instantly. If they're vague or overlapping ("tool A," "tool B"), you fumble. The agent only sees the labels.

How it works

  1. Each tool is registered with a name, a description, and a parameter schema (via function calling).
  2. The model compares the current need against all tool descriptions and selects one (or none).
  3. It fills in the arguments from the context.
  4. The tool runs; the result comes back as an observation.

Good practice: clear, distinct descriptions, few well-chosen tools rather than dozens, and examples of when to use each in the description.

Real-world example

Ask an agent "What's 15% of last month's revenue?" It shouldn't guess arithmetic — it should pick the calculator (and maybe a database tool for the revenue figure). If two tools both sound like "get data," the model may pick wrong; renaming them get_sales_data and get_support_tickets fixes it instantly.

Technical explanation

Tool selection quality degrades as the number of tools grows and as descriptions overlap — the model has to disambiguate from text alone. Techniques to keep it reliable:

  • Minimal, orthogonal tool set — fewer tools with non-overlapping purposes.
  • Descriptive names + rich descriptions, including when not to use a tool.
  • Tool retrieval / RAG over tools when there are many (retrieve the top-k relevant tools into context rather than listing all).
  • Strict parameter schemas so arguments are valid, plus error messages that guide correction.
  • Namespacing / grouping (e.g., MCP servers) to organize large tool sets.

Poor tool design is one of the most common causes of flaky agents — it shows up as wrong actions, not model "stupidity."

Common mistakes

Common mistake

Blaming the model when the agent calls the wrong tool. Usually the fix is a clearer tool name and description — the model can only choose from what you wrote.

  • Overloading an agent with dozens of similar tools, causing confusion and wrong picks.
  • Vague or overlapping descriptions ("gets info") that don't disambiguate.

When to use it

  • Any agent with more than one tool — thoughtful tool design is non-optional.

When NOT to use it

  • Single-tool or no-tool tasks, where selection is trivial or unnecessary.

Alternatives

  • For very large tool sets, retrieve the relevant tools per query instead of exposing all at once.

Quick quiz

Question 1 of 3

How does an agent decide which tool to use?

Question 2 of 3

An agent keeps calling the wrong tool. What's the most likely fix?

Question 3 of 3

True or false: with very many tools, retrieving the top-k relevant ones per query helps selection.

Related concepts

  • What is ReAct?ReAct is an agent pattern that interleaves reasoning (Thought) with tool use (Action) and results (Observation), looping until it can answer.
  • What is Function Calling (Tool Use)?Function calling lets an LLM request that your code run a real tool by emitting a structured call, then use the result to answer.
  • Tool Abuse and Excessive AgencyIf the model can call a powerful tool, injection can try to. Shrink the kit, validate args, and require humans for irreversible actions.
NextAgent Memory & State

Last reviewed: 2026-09-04 · Written by ByHeart AI · Reviewed by ByHeart AI