Tools¶
The Bedrock Swarm framework provides a set of built-in tools that agents can use to perform various tasks. Each tool is designed to be modular, reusable, and easy to integrate into agent workflows.
Available Tools¶
Core Tools¶
- Base Tool: The foundation class for all tools
- Calculator: Performs mathematical calculations
- Time: Handles time-related operations
- Send Message: Facilitates message sending between agents
- Validation: Provides input validation utilities
Tool Development¶
For information on developing custom tools, see the Tool Development Guide.
Tool Registry¶
The framework maintains a central registry of available tools:
TOOL_REGISTRY = {
"calculator": CalculatorTool,
"time": TimeTool,
"send_message": SendMessageTool,
"validation": ValidationTool
}
Common Features¶
All tools in the framework share these common features:
- Standardized Interface: Consistent method signatures
- Error Handling: Comprehensive error handling and validation
- Documentation: Detailed documentation and examples
- Testing: Comprehensive test coverage
- Type Safety: Full TypeScript support
Usage Example¶
from bedrock_swarm.tools import CalculatorTool
calculator = CalculatorTool()
result = calculator.evaluate("2 + 2")
print(result) # Output: 4
Tool Configuration¶
Tools can be configured through:
- Environment variables
- Configuration files
- Runtime parameters
Error Handling¶
Tools implement standardized error handling:
- Input validation
- Type checking
- Resource availability checks
- Error reporting