Skip to content
mentoor

Topic 2 of 5 · 4 min read

Tool descriptions steer model choices

Goal: Predict which tool a model will call from the tool descriptions it sees and fix a description that leads to the wrong choice.

A model chooses a tool by reading text: the tool's name, its description and the arguments it lists. If that text is vague, overlapping or misleading, the model will choose badly, however clever it is.

Check yourself · 1 of 3

How does a model learn what tools it can use in a given chat?

Choose one answer

Why it matters

The tool list is not code the model understands. It is placed in the model's context, like a menu, before it writes its answer. The model compares your request to that menu and writes the call that seems closest. So the quality of your tool descriptions decides how well an agent behaves. This holds for the tools in ChatGPT, Claude, Gemini, Copilot and Cursor, and for any tools your team adds, including those shared through the Model Context Protocol (MCP).

How to write a description that steers well

  1. Say what it does and when to use it. "Search the company wiki for HR policies. Use for questions about leave, pay or benefits."
  2. Say when not to use it. "Do not use for customer data."
  3. Give each argument a plain meaning and an example. A field called q is a guess. A field called search_text, described as "words to look for, e.g. parental leave", is clear.
  4. Keep tools distinct. Two tools with near-identical descriptions make the model pick between them almost at random.
  5. Keep the list short. Every tool costs context, and more choices mean more mistakes.

Before and after

Weak: two tools. search: "Searches things." lookup: "Looks things up."

The model has no basis to choose, so it picks either one.

Better: search_wiki: "Full-text search of internal policy pages. Use for HR, IT and travel rules." lookup_customer: "Fetch one customer record by exact customer id. Do not use for policy questions."

Now a question about leave goes to the wiki, and a question about customer 812 goes to the lookup.

What goes wrong

  • Overlap. Two tools that could both answer lead to inconsistent choices from run to run.
  • Hidden limits. If a tool only works for dates after 2024 and the description does not say so, the model will call it for older dates and get empty results.
  • Name that lies. A tool called get_user that also deletes inactive users will be called more freely than anyone intends.

For engineers

A tool is declared with a name, a description and a JSON schema. Make the schema strict where you can:

{
  "name": "search_wiki",
  "description": "Full-text search of internal policy pages. Use for HR, IT and travel rules. Not for customer data.",
  "input_schema": {
    "type": "object",
    "properties": {
      "search_text": { "type": "string", "description": "Words to look for, e.g. parental leave" },
      "max_results": { "type": "integer", "minimum": 1, "maximum": 10 }
    },
    "required": ["search_text"]
  }
}

Test descriptions the way you test code: write ten real requests and check which tool each one reaches.

Examples

Two tools, one confusion

An agent has search: "Search for information" and search_docs: "Search documentation". Asked "What is our refund policy?" it calls search and returns web results about other companies. Fix: rename to search_web ("public internet only") and search_docs ("our own policy and product pages; use first for company questions").

The argument nobody understood

A tool has an argument d. The model sends d: "last week" and the app expects 2026-11-24. Renaming it start_date and describing it as "ISO date, e.g. 2026-11-24" removes the problem without changing any code.

Key points

  • The model reads tool names, descriptions and argument schemas as text in its context, and chooses from that text alone.
  • A good description says what the tool does, when to use it and when not to.
  • Tools with overlapping descriptions cause inconsistent, near-random choices.
  • Clear argument names and examples reduce wrong or missing arguments.
  • Test tool descriptions with realistic requests and fix the text when the wrong tool is chosen.

Common mistakes

  • Writing one-word descriptions such as 'Searches things'.
  • Giving two tools overlapping jobs without saying which to prefer.
  • Leaving out limits, such as date ranges or sizes, that the model cannot guess.
  • Adding dozens of tools 'just in case', which makes every choice harder.

Check yourself · 2 of 3

An agent has tools search ('Searches things') and lookup ('Looks things up') and keeps picking the wrong one. What is the best fix?

Choose one answer

Check yourself · 3 of 3

Which argument description is most likely to produce a correct value?

Choose one answer

Practice items, not counted towards your mastery.

Start here

More for this topic