How Tool Descriptions Affect Agent Behavior
Tool descriptions are the primary way the LLM understands when and how to use a tool. Poor descriptions lead to:- Tools not being called when they should
- Tools being called inappropriately
- Incorrect parameter values being passed
- Frustrated users and failed interactions
- Reliable tool activation
- Correct parameter extraction from user input
- Appropriate tool selection when multiple tools could apply
- Better user experiences
The Three Key Elements
Every tool has three elements that guide LLM behavior:
All three must work together for reliable tool usage.
Writing Effective Tool Descriptions
Be Specific About Purpose
Thedescription field helps the LLM choose between tools.
Weak:
Include Key Triggers
Mention the types of questions or requests that should trigger the tool: Weak:Distinguish From Similar Tools
If you have multiple similar tools, make distinctions clear: Tool 1:Writing Effective Tool Prompts
Theprompt field provides detailed instructions for tool usage. This is where you add nuance and context.
Structure Your Prompt
Example: Ticketing Tool Prompt
Example: HTTP API Tool Prompt
Input Schema Best Practices
Use Descriptive Parameter Names
Weak:Write Detailed Parameter Descriptions
Descriptions should explain:- What the parameter represents
- Expected format
- Where to get the value
- Any constraints
Use Enums for Constrained Values
When parameters have limited valid values, use enums:Provide Helpful Defaults
Handle Complex Data Types
For arrays and objects, be explicit about structure:Patterns for Common Tool Types
Search Tools
Action Tools (Create/Update/Delete)
External API Tools
Multi-Step Tools
Testing Your Tool Descriptions
Test Scenarios
Example Test Prompts
For a ticketing tool:Iterative Improvement
Common Mistakes to Avoid
Too Generic
Problem:Conflicting Instructions
Problem:No Negative Cases
Problem: Only describing when TO use the tool. Solution: Also describe when NOT to use it:Missing Parameter Context
Problem:Assuming Perfect Input
Problem: Not handling variations in user input. Solution: Include format guidance:Examples Gallery
Product Lookup Tool
Appointment Booking Tool
Quick Reference Checklist
Before deploying a tool, verify:- Description clearly explains what the tool does
- Description mentions key trigger scenarios
- Prompt specifies when TO use the tool
- Prompt specifies when NOT to use the tool
- Prompt explains how to handle results
- Prompt covers error scenarios
- Parameters have descriptive names
- Parameters have detailed descriptions
- Parameters specify formats when relevant
- Enums used for constrained values
- Defaults provided where appropriate
- Tool tested with simulation scenarios
Related
- Tools — Tools overview
- Agent Best Practices — Design patterns
