Skip to main content
The Toolkit class provides a way to group related tools together with shared configuration. It handles registration of sync and async tools, filtering, and connection management.

Constructor

from agno.tools import Toolkit

toolkit = Toolkit(
    name="my_tools",
    tools=[func1, func2],
    instructions="Use these tools to..."
)

Core Parameters

name
str
default:"toolkit"
Descriptive name for the toolkit.
tools
Sequence[Callable | Function]
default:"[]"
List of tools (functions or Function objects from @tool decorator).
async_tools
Sequence[tuple[Callable, str]]
default:"None"
List of (async_callable, tool_name) tuples for async variants.
instructions
str
default:"None"
Instructions for using the toolkit.
add_instructions
bool
default:"False"
Whether to add instructions to the agent’s system message.

Tool Filtering

include_tools
List[str]
default:"None"
List of tool names to include from the toolkit.
exclude_tools
List[str]
default:"None"
List of tool names to exclude from the toolkit.

HITL Configuration

requires_confirmation_tools
List[str]
default:"None"
Tools that require user confirmation before execution.
external_execution_required_tools
List[str]
default:"None"
Tools that will be executed outside the agent loop.
stop_after_tool_call_tools
List[str]
default:"None"
Tools that stop the agent after execution.
show_result_tools
List[str]
default:"None"
Tools whose results should be shown to the user.

Caching

cache_results
bool
default:"False"
Enable in-memory caching of function results.
cache_ttl
int
default:"3600"
Time-to-live for cached results in seconds.
cache_dir
str
default:"None"
Directory to store cache files.
auto_register
bool
default:"True"
Whether to automatically register all methods in the class.

Methods

register()

Register a function with the toolkit.
toolkit.register(my_function)

get_functions()

Get sync functions dict.
functions = toolkit.get_functions()

get_async_functions()

Get functions optimized for async execution.
async_functions = toolkit.get_async_functions()

connect()

Establish any required connections (override in subclasses).
toolkit.connect()

close()

Close any open connections (override in subclasses).
toolkit.close()

Creating Custom Toolkits

from agno.tools import Toolkit

class WeatherToolkit(Toolkit):
    def __init__(self, api_key: str):
        self.api_key = api_key
        
        super().__init__(
            name="weather",
            tools=[self.get_weather, self.get_forecast],
            instructions="Use these tools to get weather information"
        )
    
    def get_weather(self, city: str) -> str:
        """Get current weather for a city."""
        # Implementation
        return f"Weather in {city}: Sunny"
    
    def get_forecast(self, city: str, days: int = 5) -> str:
        """Get weather forecast for a city."""
        # Implementation
        return f"Forecast for {city}: ..."

Example Usage

from agno import Agent
from agno.tools import Toolkit

def search_web(query: str) -> str:
    """Search the web for information."""
    return f"Results for {query}"

def read_file(path: str) -> str:
    """Read a file from disk."""
    with open(path) as f:
        return f.read()

toolkit = Toolkit(
    name="utilities",
    tools=[search_web, read_file]
)

agent = Agent(model="gpt-4o", tools=[toolkit])

Built-in Toolkits

Agno provides several pre-built toolkits:
  • DuckDuckGoToolkit: Web search capabilities
  • FileSystemToolkit: File operations
  • GitHubToolkit: GitHub API integration
  • SlackToolkit: Slack messaging
  • EmailToolkit: Email operations
  • DatabaseToolkit: Database queries

Build docs developers (and LLMs) love