@tool decorator to convert any Python function into an agent-callable tool.
- Uses the function name as the tool name.
- Parses the docstring as the tool description.
- Generates a JSON Schema from type hints.
- Makes the tool available to any agent.
Decorator Options
Learn More
Parameters
Type hints, descriptions, and JSON Schema.
Hooks
Run logic before and after execution.
Caching
Cache results for identical arguments.
Async Tools
Non-blocking I/O operations.
Dependencies
Inject services and state into tools.