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
Designing Simple Tool Interfaces › Multiple Tools: Decision MakingOne section · Sections in this chapter7 / 12 ↓
Sections in this chapter12
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]:
Codetools = [
{
"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.