Overview
Agentor provides a flexible tool system that allows agents to interact with external APIs, databases, and services. Tools can be registered globally, created as reusable classes, or defined inline.Tool Types
Agentor supports multiple tool formats:- Function Tools - Decorated Python functions
- BaseTool Classes - Reusable tool classes with multiple capabilities
- String References - Tools registered in the global registry
- MCP Servers - External Model Context Protocol servers
Function Tools
Create simple tools using the@function_tool decorator:
Type Hints and Descriptions
The decorator automatically generates JSON schemas from type hints and docstrings. The LLM sees:Tool Registry
Register tools globally for reuse across agents (src/agentor/tools/registry.py:23):Built-in Tools
Agentor includes these built-in tools in the registry:get_weather- Weather information (src/agentor/tools/registry.py:33)current_datetime- Current date and time (src/agentor/tools/registry.py:43)
BaseTool Class
Create reusable tool classes with multiple capabilities (src/agentor/tools/base.py:18):Capability Decorator
The@capability decorator (src/agentor/tools/base.py:12) marks methods as agent-callable tools:
Dynamic Tools from Functions
Create a tool from any function (src/agentor/tools/base.py:100):Serving Tools as MCP Servers
Serve anyBaseTool as a standalone MCP server (src/agentor/tools/base.py:73):
- Creates a LiteMCP server
- Registers all
@capabilitymethods as MCP tools - Serves at
http://0.0.0.0:8000/mcp
Built-in Tool Implementations
Agentor includes production-ready tools insrc/agentor/tools/:
Weather Tool
GitHub Tool
Gmail Tool
Shell Tool
Tool JSON Schema
Convert tools to JSON schema for documentation (src/agentor/tools/base.py:58):Tool Search API
Reduce context bloat with semantic tool search:Error Handling
Handle tool errors gracefully:Tool Context and Authentication
Tools receive context with API keys and configuration (src/agentor/tools/registry.py:15):OpenAI Function Conversion
All tools automatically convert to OpenAI function format (src/agentor/tools/base.py:46):Next Steps
MCP Integration
Connect external MCP servers as tools
Skills System
Combine tools with contextual instructions
Tool search
Use semantic search to reduce context size
