Skip to content
Domain 2Task 2.1

Tool Interface Design

Learn this interactively

What You Need to Know

A tool is a function that an agent can call. It has a name and a plain-language description. Tool descriptions are the primary mechanism LLMs use for tool selection. Given a set of tools, the model reads the tool descriptions to decide which tool to call. Tool descriptions are not supplementary metadata. Minimal descriptions, such as "Retrieves customer information", give the model no way to distinguish overlapping tools.

This lesson uses one made-up example throughout: a tailor whose booking agent has two tools. Their descriptions are "Retrieves client information" and "Retrieves alteration details". When the agent is asked whether a hem is ready, it calls the client tool, because both descriptions fit.

What Makes a Good Tool Description

A production-grade tool description includes five elements.

  1. What the tool does: its primary purpose, stated unambiguously
  2. What inputs it expects: data types, formats, constraints, and required versus optional fields
  3. Example queries it handles well: concrete use cases that show the model what the tool is for
  4. Edge cases and limitations: what the tool does not do, and what happens when inputs are outside expected ranges
  5. Explicit boundaries: when to use this tool versus similar tools in the same toolkit

The tailor's alteration tool would name the ticket number it accepts. It would list "is my hem ready?" as a query.

Minimal (causes misrouting):

text
get_customer: "Retrieves customer information"
lookup_order: "Retrieves order details"

Production-grade (reliable selection):

text
get_customer: "Looks up a customer account by email address,
phone number, or customer ID. Returns customer profile
(name, contact details, account status, loyalty tier).
Use this when you need to verify who the customer is.
Do NOT use for order-specific queries — use lookup_order
for those."

lookup_order: "Retrieves order details by order number
(format: #NNNNN) or tracking ID. Returns order status,
items, shipping details, and refund eligibility.
Use this when a customer asks about a specific order.
Do NOT use for customer identity verification —
use get_customer for that."

The second version states explicitly how the tools differ: which identifiers each tool accepts, what each tool returns, and when not to use each tool.

The Misrouting Problem

Two tools with overlapping or near-identical descriptions confuse the model when it selects a tool. Both descriptions fit a request like the hem question, so nothing in the descriptions shows the model which tool is right. Expand both descriptions with the five elements.

Tool Splitting

Generic tools with broad responsibilities create ambiguity, because a broad description fits many requests. Split them into purpose-specific tools with defined input and output contracts, as a tailor might split one garment tool into fittings and alterations.

Before splitting:

text
analyze_document: "Analyses a document and returns results"

After splitting:

text
extract_data_points: "Extracts structured data fields
(dates, amounts, names) from a document"

summarize_content: "Produces a concise summary of a
document's key arguments and conclusions"

verify_claim_against_source: "Checks whether a specific
claim is supported by the source document, returning
supporting/contradicting evidence"

Each resulting tool does one narrow, clearly described job the model can match to the user's need.

Tool Renaming for Clarity

When two tools have confusingly similar names, renaming fixes the overlap at the interface level. Rename analyze_content to extract_web_results with a web-specific description, and its purpose becomes unambiguous without touching its implementation. The tailor's tools could become find_client and find_alteration.

System Prompt Interactions

Keyword-sensitive instructions in system prompts can create unintended tool associations that override well-written descriptions. When the system prompt says "always check customer details before proceeding", the model may route any customer-related query to get_customer, whatever the descriptions say. The tailor's "always check client details first" could send hem questions to the client tool. After you update descriptions, reread your system prompt for conflicts. These conflicts are a subtle failure mode.

In the exam

In the exam guide's sample Question 2, get_customer and lookup_order have minimal descriptions, and the agent routes "check my order #12345" to the wrong tool. Pick the correct fix from four plausible options.

  • Expand descriptions: correct. It needs low effort, has a large effect, and addresses the root cause directly.
  • Few-shot examples: wrong. They add token overhead without fixing why the model is confused. They address the effects and leave the cause in place.
  • Routing classifier: wrong. A routing classifier is code that parses the user input before each turn and selects the tool from detected keywords. It is over-engineered as a first step. It bypasses the LLM's natural language understanding and adds infrastructure complexity.
  • Tool consolidation: wrong as a first step. It is a valid architectural choice long-term, but it costs far more effort than expanding descriptions.

The exam consistently favours low-effort fixes with a large effect: better descriptions before routing classifiers, scoped access before full access, community servers (servers built by other people) before servers you build yourself. The exam also tests system prompt conflicts.

Key Concept

When weak descriptions cause misrouting, improving them is the first fix.

The exam tests when that rule applies and when it does not. Descriptions are the fix when the agent has a workable number of tools and cannot distinguish two of them. They are not the fix when the toolkit itself is the problem. With a large tool set, selection degrades because of decision complexity alone. The guide's example is 18 tools against 4-5. Rewriting 22 descriptions does not change that complexity. First, diagnose which case you face. Task Statement 2.3 covers how the number of tools affects selection, and what to do instead.

Current state (checked 6 October 2026): Anthropic's tool search docs say selection degrades once an agent has more than 30 to 50 tools. On the exam, use the guide's 18-versus-4-5 example.

Exam Traps

Exam Trap

Choosing few-shot examples (input-output pairs included in the prompt) to fix tool misrouting caused by minimal descriptions

Few-shot examples add token overhead without addressing the root cause. The model is confused because descriptions do not differentiate the tools, so fix the descriptions first.

Exam Trap

Implementing a routing classifier as the first step to fix tool selection

A routing classifier is over-engineered as a first response. It bypasses the LLM's natural language understanding and adds infrastructure. Expanding the tool descriptions addresses the root cause directly.

Exam Trap

Consolidating similar tools into one as the first step

Tool consolidation is a valid long-term architectural choice, but it requires more effort than expanding descriptions. The exam favours low-effort first steps with a large effect.

Exam Trap

Ignoring system prompt wording after updating tool descriptions

Keyword-sensitive instructions in system prompts can silently override well-written tool descriptions, creating unintended tool associations. After any description change, review the system prompt and rephrase wording that matches a tool.

Practice Scenario

Production logs show an agent frequently calls get_customer when users ask about orders (e.g. 'check my order #12345'), instead of calling lookup_order. Both tools have minimal descriptions ('Retrieves customer information' / 'Retrieves order details') and accept similar identifier formats. What is the most effective first step to improve tool selection reliability?

Build Exercise

Build Exercise

Design Tool Descriptions That Eliminate Misrouting

Difficulty
30 minutes

What you'll learn

  • Understand that tool descriptions are the primary mechanism LLMs use for tool selection
  • Write production-grade descriptions with purpose, inputs, examples, edge cases, and boundaries
  • Diagnose misrouting caused by ambiguous or overlapping descriptions
  • Identify system prompt conflicts that override well-written tool descriptions
  1. Create two MCP tools with intentionally ambiguous descriptions (e.g. get_customer: Retrieves customer information and lookup_order: Retrieves order details)

    Why: Reproducing a misrouting scenario yourself helps you understand why minimal descriptions fail. The exam tests your ability to identify ambiguous descriptions as the root cause of tool selection errors.

    You should see: Two tool definitions registered with your MCP server, each having a single-sentence description that does not mention input formats, example queries, or boundaries.

  2. Test with 10 queries covering different user intents and log which tool the model selects for each

    Why: Quantifying selection accuracy before and after description changes gives you concrete evidence of the impact. The exam expects you to know that description quality directly affects selection reliability.

    You should see: A log showing at least 2-3 misrouted queries where the model selected get_customer for order-related queries or vice versa, demonstrating the ambiguity problem.

  3. Rewrite both descriptions to include: purpose, expected inputs with formats, example queries, edge cases, and explicit boundaries against the other tool

    Why: This is the core exam skill — the lowest-effort fix for misrouting, with the largest effect. Production-grade descriptions include all five elements: purpose, inputs, examples, edge cases, and boundaries.

    You should see: Each tool description is 3-5 sentences long, explicitly states accepted identifier formats, gives example queries, and includes a boundary statement like "Do NOT use for order-specific queries — use lookup_order for those."

  4. Re-run the same 10 queries and compare selection accuracy before and after

    Why: Measuring improvement validates that description quality is the root cause. The exam expects you to understand that better descriptions produce measurably better selection without any architectural changes.

    You should see: Selection accuracy improves to 9/10 or 10/10 correct, with previously misrouted queries now going to the correct tool. A clear before/after comparison showing the improvement.

  5. Review your system prompt for keyword-sensitive instructions that could override the improved descriptions

    Why: System prompt conflicts are a subtle failure mode the exam tests. Keywords like "always check customer details" can create unintended tool associations that override even well-written descriptions.

    You should see: A list of any keyword-sensitive phrases in your system prompt that could trigger incorrect tool associations, along with rewritten versions that avoid the conflict.

Sources