What are Custom Tools?
Custom tools allow you to extend your AI agents with specialized functionality. Whether you need simple utility functions or complex business logic, Upsonic provides multiple approaches to create tools that integrate seamlessly with your agents. Custom tools are Python functions or classes that you create to give your AI agents specific capabilities. They can:- Execute business logic and computations
- Integrate with external APIs and services
- Process and transform data
- Interact with databases and file systems
- Implement domain-specific algorithms
Key Benefits
- Flexible Creation: Use functions, classes, or toolkits
- Type Safety: Automatic schema generation from type hints
- Rich Configuration: Control execution behavior, caching, retries, and more
- Developer Friendly: Minimal boilerplate with decorator-based approach
Navigation
- Creating Function Tools - Create tools from Python functions
- Creating ToolKits - Organize multiple tools into toolkits with shared state
- Creating Class Tools - Auto-register all public methods as tools
- Tool Attributes - Comprehensive guide to all tool configuration options
- Tool Configurations - Configure caching, timeouts, execution modes, and more
- Advanced Features - Use agents as tools and combine multiple tools
Quick Comparison
| Type | Registration | Best For |
|---|---|---|
| Function Tool | @tool decorator | Simple, standalone operations |
| ToolKit | @tool on selected methods | Related tools with shared state |
| Class Tool | All public methods auto-registered | Quick prototyping, utility classes |

