cookbook/91_tools/README.md
Examples for using and creating tools in Agno.
| Type | Description |
|---|---|
| Built-in Tools | Pre-built toolkits (YFinance, DuckDuckGo, etc.) |
| Custom Tools | Your own tools with @tool decorator |
| MCP Tools | Model Context Protocol servers |
| Async Tools | Async tool execution |
from agno.tools import tool
@tool
def get_weather(city: str) -> str:
"""Get weather for a city."""
return f"Weather in {city}: Sunny, 72F"
agent = Agent(tools=[get_weather])
Model Context Protocol allows connecting to external tool servers:
from agno.tools.mcp import MCPTools
tools = MCPTools(servers=["npx", "-y", "@anthropic/mcp-server-filesystem"])
agent = Agent(tools=[tools])
mcp/ - MCP server examplestool_decorator/ - Custom tool patternstool_hooks/ - Pre/post processingasync/ - Async execution