Designing Simple Tool Interfaces › Multiple Tools: Decision Making

Michael BrenndoerferJune 25, 20252 min read
AI Agent HandbookAll chapters
Part 5 of 15Tool Use - Extending the Agent's Abilities
Chapter 13Designing Simple Tool Interfaces › Multiple Tools: Decision Making
Reading section 7 of 12 · Multiple Tools: Decision Making · 2 minSection 7 of 12 · 2 min

Book contents

Section 7 of 12 · 2 min read

Designing Simple Tool Interfaces › Multiple Tools: Decision MakingOne section · Sections in this chapter7 / 12 ↓

When your agent has access to multiple tools, it needs to choose the right one for each situation. Let's see how this works with a more complex example:

In[9]:
Code
tools = [
    {
        "name": "get_weather",
        "description": "Get current weather conditions for a city",
        "input_schema": {
            "type": "object",
            "properties": {
                "city": {"type": "string", "description": "City name"}
            },
            "required": ["city"]
        }
    },
    {
        "name": "calculate",
        "description": "Perform mathematical calculations",
        "input_schema": {
            "type": "object",
            "properties": {
                "expression": {
                    "type": "string",
                    "description": "Math expression to evaluate (e.g., '1234 * 5678')"
                }
            },
            "required": ["expression"]
        }
    },
    {
        "name": "search_web",
        "description": "Search the internet for current information",
        "input_schema": {
            "type": "object",
            "properties": {
                "query": {
                    "type": "string",
                    "description": "Search query"
                }
            },
            "required": ["query"]
        }
    }
]

Now when a user asks a question, the agent analyzes it and chooses the appropriate tool:

  • "What's the weather in Paris?" → get_weather(city="Paris")
  • "What's 1234 times 5678?" → calculate(expression="1234 * 5678")
  • "What are the latest developments in quantum computing?" → search_web(query="latest quantum computing developments")

The agent's language understanding allows it to map user intent to the right tool. This is where the quality of your tool descriptions matters. Clear, specific descriptions help the agent make the right choice.