The AgentTools system in the Multi-Agent Orchestrator provides a flexible framework for defining, building, and managing tools that agents can use.
It consists of three main classes: AgentTool and AgentTools, which work together to enable tool-based interactions in the orchestrator.
Key Features
Support for multiple AI provider formats: Claude, Bedrock, OpenAI (coming soon)
Automatic function signature parsing
Type hint conversion to JSON schema
Flexible tool definition methods
Async/sync function handling
Built-in tool result formatting
AgentTool Class
The AgentTool class is the core component that represents a single tool definition. It can be created in multiple ways and supports various formats for different AI providers.
The AgentTools class manages multiple tool definitions and handles tool execution during agent interactions. It provides a unified interface for tool processing across different AI providers.
When you need more control over tool execution, you can implement a custom handler using the useToolHandler option in your tool_config. This handler lets you:
Intercept and process the tool invocation before execution
Parse the tool block directly from your Agent’s output
This approach provides flexibility when you need to extend the default tool behavior with custom logic, validation, or response formatting. The handler receives the raw tool block text and is responsible for all aspects of tool execution and response generation.
Best Practices
Function Documentation: Always provide clear docstrings for functions used in tools. The system uses these for generating descriptions and parameter documentation.
Type Hints: Use Python type hints in your tool functions. These are automatically converted to appropriate JSON schema types.
Error Handling: Implement proper error handling in your tool functions. AgentTool execution errors are automatically captured and formatted appropriately.
Provider Compatibility: When creating tools, consider the formatting requirements of different AI providers if you plan to use the tools across multiple provider types.
AgentTool Naming: Use clear, descriptive names for your tools and maintain consistency in naming conventions across your application.
By following these guidelines and leveraging the AgentTools system effectively, you can create powerful and flexible tool-based interactions in your Multi-Agent Orchestrator implementation.
Next Steps
To continue learning about AgentTools in the Multi-Agent Orchestrator System, head over to our examples in Github