Course contentsShow
← AI Engineering
Lesson 580 of 1,88614. Function Calling and Tool UseFree lesson

Tool Selection Strategies

Guide models to choose appropriate tools using descriptions, examples, and explicit selection criteria.

Tool Selection Strategies

What you'll learn: How to guide LLMs to reliably choose the right tool from multiple options using clear descriptions, examples, and explicit selection criteria.

The Core Challenge

When you provide an LLM with multiple function definitions, it must decide which tool (if any) best matches the user's request. Poor tool selection leads to calling the wrong function, passing invalid arguments, or failing to use tools when needed. Your job as an AI engineer is to make this choice obvious and unambiguous.

Making Tools Easy to Choose

Think of tool selection like a restaurant menu. If every dish is described as "food," you can't choose well. But if descriptions say "spicy Thai curry with peanuts" or "mild Italian pasta with marinara," you know exactly what fits your needs.

Three Key Strategies

1. Distinctive Function Names and Descriptions Use specific, action-oriented names (get_weather_forecast not get_data) and descriptions that clearly state the tool's purpose and when to use it.

2. Explicit Selection Criteria In descriptions, include phrases like "Use this when the user asks about..." or "Only call this if you need to..."

3. Mutually Exclusive Tool Definitions Avoid overlap between tools. If two tools seem similar, either merge them or clearly document their distinct use cases in the descriptions.

Practical Example Pattern

Instead of: "Gets information" (vague)

Write: "Retrieves current weather conditions for a specific city. Use when user asks about temperature, precipitation, or current weather status. Requires a city name."

This tells the model exactly what the tool does, when to use it, and what it needs.

Key Takeaway: Effective tool selection relies on writing clear, specific function descriptions with explicit selection criteria that eliminate ambiguity about when each tool should be used.