Skip to main content
Create custom tools with the @tool decorator. Agno automatically extracts function signatures and docstrings to describe tools to the model.

Capabilities

Basic Tool Decorator

cookbook/91_models/tool_decorator/tool_decorator.py

Async Tools

cookbook/91_models/tool_decorator/tool_decorator_async.py

Tools with Instructions

Add custom instructions that the model sees when using the tool.
cookbook/91_models/tool_decorator/tool_decorator_with_instructions.py

Cache Tool Calls

Cache tool results to avoid repeated calls.
cookbook/91_models/tool_decorator/cache_tool_calls.py

Stop After Tool Call

Stop agent execution after a specific tool is called.
cookbook/91_models/tool_decorator/stop_after_tool_call.py

Tools on Class Methods

Use class methods as tools for stateful operations.
cookbook/91_models/tool_decorator/tool_decorator_on_class_method.py

Tool Options

Run Examples