tools, and the model can select it when a request requires it.
order_agent.py
Choose a Tool Source
Tool Execution
The execution flow:- The agent sends the model its context and available tool definitions.
- The model returns a response or requests one or more tool calls.
- Agno validates the arguments and executes each requested tool.
- Tool results are added to the model context.
- The loop continues until the model returns a final response.
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 arun_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.
Return Tool Results
Functions can return strings, numbers, dictionaries, lists, and other serializable values. UseToolResult 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.