Skip to main content
Tools are what make Agents and Teams capable of real-world action. While using LLMs directly you can only generate text responses, Agents and Teams equipped with tools can interact with external systems and perform practical actions. Tools can require confirmation. When that happens, the run pauses until the requirement is resolved. Some examples of actions that can be performed with tools are: searching the web, running SQL, sending an email or calling APIs. Agno comes with 120+ pre-built toolkits, which you can use to give your Agents all kinds of abilities. You can also write your own tools to give your Agents even more capabilities. The general syntax is:
In the example above, the get_weather function is a tool. When called, the tool result is shown in the output.

How do tools work?

The heart of Agent execution is the LLM loop. The typical execution flow of the LLM loop is:
  1. The agent sends the run context (system message, user message, chat history, etc) and tool definitions to the model.
  2. The model responds with a message or a tool call.
  3. If the model makes a tool call, the tool is executed and the result is returned to the model.
  4. The model processes the updated context, repeating this loop until it produces a final message without any tool calls.
  5. The agent returns this final response to the caller.

Tool definitions

Agno automatically converts your tool functions into the required tool definition format for the model. Typically this is a JSON schema that describes the parameters and return type of the tool. For example:
This will be converted into the following tool definition:
This tool definition is then sent to the model so that it knows how to call the tool when it is requested. You’ll notice as well that the Args section is automatically stripped from the definition, parsed and used to populate the definitions of individual properties. When using a Pydantic model in an argument of a tool function, Agno will automatically convert the model into the required tool definition format. For example:
This will be converted into the following tool definition:
  • Always create a docstring for your tool functions. Make sure to include the Args section and cover each of the arguments of the function.
  • Use sensible names for your tool functions. Remember this is directly used by the model to call the tool when it is requested.

Tool Execution

When the model requests a tool call, the tool is executed and the result is returned to the model.
  • A model can request multiple tool calls in a single response.
  • When using arun to execute the agent or team, and the model requests multiple tool calls, the tools will be executed concurrently.
Agno Agents can execute multiple tools concurrently, allowing you to process function calls that the model makes efficiently. This is especially valuable when the functions involve time-consuming operations. It improves responsiveness and reduces overall execution time.
When you call arun or aprint_response, your tools will execute concurrently. If you provide synchronous functions as tools, they will execute concurrently on separate threads.
Concurrent execution of tools requires a model that supports parallel function calling. For example, OpenAI models have a parallel_tool_calls parameter (enabled by default) that allows multiple tool calls to be requested and executed simultaneously.
async_tools.py
In this example, gpt-5.2 makes three simultaneous tool calls to atask1, atask2 and atask3. Normally these tool calls would execute sequentially, but using the aprint_response function, they run concurrently, improving execution time.

Using a Toolkit

An Agno Toolkit provides a way to manage multiple tools with additional control over their execution.
In this example, the HackerNewsTools toolkit is added to the agent. This toolkit enables the agent to fetch stories from HackerNews.

Tool Built-in Parameters

Agno automatically provides special parameters to your tools that give access to the agent’s parameters, state and other variables. Agno strips these parameters from the tool definition sent to the model and injects the values at execution time, so the model never sees them.

Using the Run Context

You can access values from the current run via the run_context parameter: run_context.session_state, run_context.dependencies, run_context.knowledge_filters, run_context.metadata. See the RunContext schema. This allows tools to access and modify persistent data across conversations. This is useful in cases where a tool result is relevant for the next steps of the conversation. Add run_context as a parameter in your tool function to access the agent’s persistent state:
See more in Agent State.

Using the Agent or Team

You can access the Agent or Team instance directly in your tool function by adding agent or team as a parameter. This gives you full access to the agent’s or team’s properties like model, instructions, etc.
When using team as a parameter, make sure the tool is being used within a Team context. Similarly, use agent when the tool is used with an Agent.

Media Parameters

The built-in parameters images, videos, audios, and files allow tools to access and modify the input media to an agent.
Using the send_media_to_model parameter, you can control whether the media is sent to the model or not and using store_media parameter, you can control whether the media is stored in the RunOutput or not.
See the image input example and file input example for an advanced example using media.

Tool Results

Tools can return different types of results depending on their complexity and what they need to communicate back to the agent.

Simple Return Types

Most tools can return simple Python types directly like str, int, float, dict, and list:

ToolResult for Media Content

When your tool needs to return media artifacts (images, videos, audio), you must use ToolResult:
ParameterTypeDefaultDescription
contentstrRequiredMain text content/output from the tool
imagesOptional[List[Image]]NoneGenerated image artifacts
videosOptional[List[Video]]NoneGenerated video artifacts
audiosOptional[List[Audio]]NoneGenerated audio artifacts
This would make generated media available to the LLM model.

Callable Factories

Agno tools support callable factory pattern for dynamic configuration. Implement a dynamic tool factory using callables for runtime dependency injection and context-aware toolset customization.
  • Runtime Resolution: Tools are lazily initialized at the start of each run via signature-based injection.
  • Context Injection: Automatically maps agent/team, run_context, and session_state to the factory parameters.
  • Granular Scoping: Enables unique tool sets tailored specifically to the user_id or session_id.
  • Performance Optimization: Includes built-in caching (cache_callables) to memoize toolsets based on unique session keys.
ParametersPurpose
agentAccesses the base agent instance/configuration.
run_contextProvides metadata like user_id for scoping tools.
session_stateAllows tools to be shaped by current conversation memory.

Learn more

Agent Tools

Equip agents with tools for external actions

Updating an Agent's Tools

Add or update tools after initialization

Available Toolkits

Browse 120+ pre-built toolkits

MCP Tools

Connect to Model Context Protocol servers

Reasoning Tools

Give agents think and analyze tools for step-by-step reasoning

Creating your own tools

Write custom Python functions as tools