Skip to main content
Clear tool descriptions help your AI agents pick the right tool and call it correctly. This page covers techniques for writing descriptions, prompts, and input schemas.

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
Well-crafted descriptions ensure:
  • 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

The description field helps the LLM choose between tools. Weak:
Strong:

Include Key Triggers

Mention the types of questions or requests that should trigger the tool: Weak:
Strong:

Distinguish From Similar Tools

If you have multiple similar tools, make distinctions clear: Tool 1:
Tool 2:

Writing Effective Tool Prompts

The prompt 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:
Strong:

Write Detailed Parameter Descriptions

Descriptions should explain:
  • What the parameter represents
  • Expected format
  • Where to get the value
  • Any constraints
Weak:
Strong:

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:
Solution: Be specific about what, when, and how.

Conflicting Instructions

Problem:
Solution: Ensure description and prompt are aligned.

No Negative Cases

Problem: Only describing when TO use the tool. Solution: Also describe when NOT to use it:

Missing Parameter Context

Problem:
Solution: Explain where to get it:

Assuming Perfect Input

Problem: Not handling variations in user input. Solution: Include format guidance:

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