Skip to main content
Agents use tools to take actions and interact with external systems. Tools are functions that an Agent can run to achieve tasks. For example: searching the web, running SQL, sending an email or calling APIs. You can use any python function as a tool or use a pre-built Agno toolkit. The general syntax is:

Using a Toolkit

Agno provides many pre-built toolkits that you can add to your Agents. For example, let’s use the DuckDuckGo toolkit to search the web.
You can find more toolkits in the Toolkits guide.
1

Create Web Search Agent

Create a file web_search.py
web_search.py
2

Run the agent

Install libraries
Run the agent

Writing your own Tools

For more control, write your own python functions and add them as tools to an Agent. For example, here’s how to add a get_top_hackernews_stories tool to an Agent.
hn_agent.py
Read more about:

Accessing built-in parameters in tools

You can access agent attributes like session_state, dependencies, agent and team in your tools.
To access session data, like session_state and dependencies, you will use the run_context object. See the RunContext schema for more information.
For example:
See more in the Tool Built-in Parameters section.

MCP Tools

Agno supports Model Context Protocol (MCP) tools. The general syntax is:
Learn more about MCP tools in the MCP tools guide.

Developer Resources