Skip to main content
Agents use tools to take actions, like looking up records, calling APIs, updating systems, and completing work for users. Add a Python function or toolkit to tools, and the model can select it when a request requires it.
order_agent.py
Agno builds a tool definition from the function name, docstring, and type hints. The model receives that definition, chooses the tool and arguments, then uses the result to produce its response.

Choose a Tool Source

Tool Execution

The execution flow:
  1. The agent sends the model its context and available tool definitions.
  2. The model returns a response or requests one or more tool calls.
  3. Agno validates the arguments and executes each requested tool.
  4. Tool results are added to the model context.
  5. The loop continues until the model returns a final response.
When a model requests multiple tool calls, arun() and aprint_response() can execute them concurrently. The selected model must support parallel tool calls.

Design Tools for Reliable Calls

The model uses the tool schema to decide when and how to call a function. Use include_tools and exclude_tools to limit operations exposed by a toolkit. See Including and Excluding Tools.

Control Tool Execution

Runs with human-in-the-loop requirements pause until your application resolves the active requirement and continues the run.

Tool Built-in Parameters

Agno strips built-in parameters from the schema sent to the model and injects them when the tool runs.

Access Run Context

Add a run_context: RunContext parameter when a tool needs the current user, session state, dependencies, metadata, or knowledge filters. Agno injects the value at execution time and omits it from the schema sent to the model.
See the RunContext reference and State Management.

Return Tool Results

Functions can return strings, numbers, dictionaries, lists, and other serializable values. Use ToolResult when a tool needs to return media or files alongside text.

Next Steps

Agent Tools

Add functions and toolkits to an agent.

Available Toolkits

Browse integrations by data source and operation.

Create Tools

Build Python functions and reusable toolkits.

MCP Tools

Connect agents to Model Context Protocol servers.

Update Tools

Add or replace tools after initialization.

Tool Hooks

Run logic before and after tool calls.