Tool Selection Strategy
What you'll learn: How an AI agent decides which tool to call when it has multiple options available, based on the task context and requirements.
The Decision Problem
Imagine you're a chef with dozens of kitchen tools hanging on the wall. For each cooking task, you need to pick the right one—a whisk for whipping cream, a knife for chopping, tongs for flipping. An AI agent faces the same challenge: given multiple tools in its registry, it must intelligently select which one(s) to use.
How Agents Choose Tools
Tool selection happens during the action selection phase of the agent loop. The LLM examines:
- Tool descriptions and schemas – Each tool comes with metadata explaining what it does and what inputs it expects
- Current task requirements – What the user asked for and what information is still missing
- Available context – Previous observations, conversation history, and agent state
- Tool constraints – Some tools may have prerequisites or be applicable only in certain situations
The agent's reasoning prompt typically presents all available tools, and the LLM decides which one best matches the current goal. This is why clear, descriptive tool schemas are critical—they guide the selection process.
Selection Patterns
- Direct matching: User asks for weather → agent selects
get_weathertool - Multi-step reasoning: User asks "Should I bring an umbrella?" → agent first selects
get_weather, observes the result, then selectsgenerate_recommendation - Contextual routing: Same query might route to
search_vector_dbvs.query_sql_databasedepending on whether the question is about unstructured documents or structured data
Key Takeaway: Tool selection is the agent's decision-making process where it maps task requirements to available tools using the LLM's reasoning over tool schemas, context, and current goals—essentially teaching the agent to "think" about which action is most appropriate.