Skip to main content
Effective tool selection is critical for tool-using agents. It ensures that agents choose the right tool for each task, leading to accurate, efficient, and purposeful interactions. This guide explores strategies and techniques for implementing your own tool selection in Prisme.ai.
These guides provide example YAML files for educational purposes, showcasing the range of possibilities. It is up to the technical teams to implement them according to your internal tools and APIs.

Understanding Tool Selection

Tool selection is the process by which an AI agent:
  1. Recognizes when a tool is needed to fulfill a user request
  2. Evaluates which available tool is most appropriate
  3. Prepares the necessary parameters for tool execution
  4. Decides whether to use the tool results or try alternative approaches
Effective tool selection balances accuracy (choosing the right tool) with efficiency (minimizing unnecessary tool usage).

The Tool Selection Challenge

Tool selection presents several key challenges:

Ambiguous Requests

User requests may not clearly indicate which tool is needed

Multiple Valid Options

Several tools might satisfy the request in different ways

Parameter Extraction

Identifying and formatting the required parameters from natural language

Decision Complexity

Balancing multiple factors including capabilities, costs, and permissions

Tool Selection Strategies

Prisme.ai supports several approaches to tool selection, each with different strengths:
Leverage the language model’s reasoning to select appropriate tools.How it works:
  • Tools are described to the LLM with clear purposes and capabilities
  • The LLM analyzes user requests and determines tool requirements
  • Function calling capabilities enable structured tool invocation
  • The LLM formats parameters based on tool schemas
Best for:
  • General-purpose agents with diverse tools
  • Complex decision-making with nuanced criteria
  • Adapting to varied user request formulations
  • Scenarios where selection logic is difficult to formalize

Implementing LLM-Based Selection

For many applications, LLM-based selection provides the best balance of flexibility and effectiveness:
1

Craft Clear Tool Descriptions

Provide the LLM with detailed information about each tool.Effective description elements:
Key components include:
  • Clear purpose statement
  • When to use the tool
  • When NOT to use the tool
  • Required parameters
  • Expected outcomes
2

Provide Selection Guidelines

Include explicit guidance for tool selection in your agent instructions.Example guidelines:
These guidelines help the LLM make consistent decisions aligned with business preferences.
3

Implement Parameter Extraction

Guide the LLM in extracting and formatting parameters from user requests.Example guidance:
Effective parameter extraction ensures tools receive correctly formatted inputs.
4

Design Error Recovery

Prepare for tool selection errors with recovery strategies.Example recovery instructions:
These strategies ensure resilience when initial tool selections don’t succeed.

Example: LLM-Based Tool Selection

Here’s a complete example of custom implementation of LLM-based tool selection:

Implementing Rule-Based Selection

For more controlled environments, rule-based selection provides predictability and reliability:
Implement explicit patterns that map user requests to specific tools.Example implementation:
This approach:
  • Uses pattern matching on user input text
  • Extracts and validates required entities
  • Maps patterns to specific tool selections
  • Provides a clear fallback for unrecognized patterns
Use intent classification to determine appropriate tools.Example implementation:
This approach:
  • Uses a dedicated intent classification model
  • Routes requests based on classified intent
  • Considers confidence scores in decision-making
  • Includes clarification flows for low-confidence cases

Example: Hybrid Selection Approach

Most enterprise applications benefit from hybrid approaches that combine LLM flexibility with rule-based governance:

Example: Tool Definition

Here’s an example of how to define a weather tool in AI Builder:

Best Practices for Tool Selection

Optimize selection logic to balance false positives and false negatives.Recommendations:
  • Evaluate both incorrect tool selections (false positives)
  • And missed opportunities to use tools (false negatives)
  • Track and analyze selection accuracy metrics
  • Iterate on selection logic based on real usage patterns
Implementation example:
Make tool selection reasoning visible to users when appropriate.Recommendations:
  • Explain which tool was selected and why
  • Indicate when the agent is using external systems
  • Show progress during tool execution
  • Provide context for tool results
Example agent response:
Start with limited tool access and expand based on need and performance.Recommendations:
  • Begin with core, high-reliability tools
  • Add tools incrementally as selection logic matures
  • Implement usage limits for new or sensitive tools
  • Monitor performance before expanding capabilities
Implementation approach:
Use actual usage data to refine selection logic over time.Recommendations:
  • Implement usage logging for selection decisions
  • Analyze patterns in successful and unsuccessful selections
  • Identify common error cases and add specific handling
  • Periodically review and update selection criteria
Monitoring focus areas:
  • Tool selection accuracy
  • Tool usage distribution
  • User satisfaction with tool results
  • Error rates and types
  • Response time impacts

Tool Selection in AI Knowledge

For AI Knowledge agents, implement effective tool selection through these configurations:
1

Configure Tool Descriptions

Create detailed, LLM-friendly descriptions for each tool.Effective descriptions include:
  • Clear purpose and capabilities
  • When to use and when not to use
  • Example scenarios
  • Required parameter information
  • Expected result formats
2

Set Tool Selection Instructions

Add specific guidance for tool selection in agent instructions.Example instructions:
3

Add Usage Examples

Provide concrete examples of correct tool selection.Example:
4

Test and Refine

Evaluate tool selection performance with real-world scenarios.Testing approaches:
  • Create a test set of diverse queries
  • Evaluate tool selection accuracy
  • Identify patterns in incorrect selections
  • Refine descriptions and instructions
  • A/B test different instruction formats

Tool Selection in AI Builder

For advanced tool selection logic in AI Builder, implement these patterns:
Use a dedicated intent classification system for routing.Example implementation:
Implement a pipeline approach for complex selection logic.Example implementation:
Consider conversation history and context in the selection process.Example implementation:

Next Steps

Ready to implement effective tool selection for your agents? Continue your journey with these resources:

Memory Management

Learn how to maintain state across tool interactions

Execution & Activity

Explore monitoring and debugging tool execution

Error Handling

Implement robust error management for tools

Multi-Agent Systems

Learn about systems with specialized agent collaboration