Skip to main content
Many advanced use-cases will require writing custom Toolkits. A Toolkit is a collection of functions that can be added to an Agent. The functions in a Toolkit are designed to work together, share internal state and provide a better development experience. Here’s the general flow:
  1. Create a class inheriting the agno.tools.Toolkit class.
  2. Add your functions to the class.
  3. Include all the functions in the tools argument to the Toolkit constructor.
For example:
shell_toolkit.py

Adding Async Methods

Any toolkit can include async methods alongside sync methods. For operations that benefit from async execution (like HTTP requests, database queries, or browser automation), you can provide both sync and async variants of your tools. The framework automatically uses the appropriate version based on the execution context:
  • agent.run() / agent.print_response() → uses sync tools
  • agent.arun() / agent.aprint_response() → uses async tools if available, otherwise falls back to sync tools
To add async tools to your Toolkits, use the async_tools parameter:
The async_tools parameter takes a list of tuples where each tuple contains:
  • The async method reference
  • The tool name (should match the sync tool name for automatic switching)
The function name of the async tool is different but we register it with same name as the sync function that the LLM sees. Example: In the above code block, the async tool is afetch_data but the LLM sees it as fetch_data.
Important Tips:
  • Fill in the docstrings for each function with detailed descriptions of the function and its arguments.
  • Remember that this function is provided to the LLM and is not used elsewhere in code, so the docstring should make sense to an LLM and the name of the functions need to be descriptive.
See the Toolkit Reference for more details.