Skip to main content

Tool Integration

Patterns for giving agents access to external tools, APIs, and functions.

Function Tools

Define Python functions as tools.
from agno import Agent

def get_weather(location: str) -> dict:
    """Get weather for a location."""
    # Implementation
    return {"temp": 72, "condition": "sunny"}

agent = Agent(
    model=OpenAI(id="gpt-4o"),
    tools=[get_weather],
    show_tool_calls=True
)

Built-in Tools

Use pre-built tools from frameworks.
from agno.tools import DuckDuckGoTools, FileTools

agent = Agent(
    tools=[DuckDuckGoTools(), FileTools()]
)

Third-Party Tools

Integrate external services.
from langchain.tools import TavilySearchResults
from langchain.agents import initialize_agent

search = TavilySearchResults(api_key=api_key)

agent = initialize_agent(
    tools=[search],
    llm=llm,
    agent_type="openai-functions"
)

MCP Tools

Model Context Protocol for standardized tool access.
from agno.tools.mcp import MCPTools

# GitHub MCP
github_mcp = MCPTools(
    server_script="npx",
    server_args=["-y", "@modelcontextprotocol/server-github"],
    env={"GITHUB_PERSONAL_ACCESS_TOKEN": token}
)

agent = Agent(tools=[github_mcp])

Tool Configuration

name
string
required
Tool name for agent to reference
description
string
required
Clear description of what tool does and when to use it
parameters
object
JSON schema of tool parameters

MCP Agents

Learn about MCP integrations

Framework Guides

Framework-specific tool patterns

Build docs developers (and LLMs) love