Tools
Tools are a mechanism that allows LLMs to dynamically call actions during their execution. Instead of having fixed, pre-defined actions, tools give LLMs the ability to decide which actions to call based on the context and their reasoning.What is a Tool?
A tool defines:- An action that an LLM can choose to call
- When and how the LLM can use that action
- Input parameters the LLM should provide
- The expected output format and usage
Bot Invocation
Allow LLMs to call other bots dynamically
Memory Operations
Enable LLMs to search and store memories as needed
Web Research
Let LLMs search the web and parse content
Code Execution
Allow LLMs to run code when needed
Tool Definition
Basic Tool Structure
Using Tools in LLM Actions
Tools are provided to LLM actions to expand their capabilities:Common Tool Patterns
Bot Invocation Tools
Allow LLMs to call specialist bots:Memory Tools
Enable LLMs to interact with memory:Research Tools
Web search and content parsing:Code Execution Tools
Allow LLMs to run code dynamically:Tool Selection by LLMs
How LLMs Choose Tools
LLMs select tools based on:- Tool descriptions - Clear, specific descriptions help LLMs choose correctly
- Context relevance - LLMs match tools to the current task
- Parameter requirements - LLMs consider what information they have available
- Expected outcomes - LLMs choose tools that will help achieve their goals
Example Tool Selection
Tool Composition
Chaining Tool Calls
LLMs can use multiple tools in sequence:Best Practices
Tool Descriptions
Tool Descriptions
Be Specific: Clearly describe what the tool does and when to use itInclude Context: Explain the expected input and outputUse Examples: Show parameter formats and usage patternsAvoid Ambiguity: Make tool purposes distinct and non-overlapping
Parameter Design
Parameter Design
Clear Parameters: Use descriptive parameter namesFlexible Inputs: Allow LLMs to provide parameters in natural waysValidation: Validate parameters to prevent errorsDocumentation: Document expected parameter formats
Tool Selection
Tool Selection
Logical Grouping: Provide related tools togetherAppropriate Scope: Don’t overwhelm LLMs with too many optionsClear Boundaries: Make tool purposes distinctFallback Options: Provide alternative tools for similar tasks
Performance
Performance
Efficient Actions: Ensure underlying actions perform wellError Handling: Handle tool failures gracefullyTimeout Management: Set appropriate timeoutsResource Limits: Manage computational resources
Tool Categories
Bot Interactions
Invoke specialist bots, ask questions, chain bot workflows
Memory Operations
Search knowledge, store insights, manage organizational memory
Research & Analysis
Web search, content parsing, data analysis, trend identification
Code & Computation
Execute code, perform calculations, process data, generate reports