> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2-docs-align-with-readme.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Tools

> Extend agents with tools to interact with external systems, APIs, and services.

Tools extend agents with capabilities to interact with external systems, APIs, and services. Agno provides built-in tools and makes it easy to create custom ones.

```python theme={null}
from agno.agent import Agent
from agno.tools import tool

@tool
def get_weather(city: str) -> str:
    """Get current weather for a city."""
    return f"Weather in {city}: 72°F, sunny"

agent = Agent(tools=[get_weather])
agent.print_response("What's the weather in San Francisco?")
```

## Tool Categories

<CardGroup cols={2}>
  <Card title="MCP" icon="plug" href="/cookbook/tools/mcp">
    Model Context Protocol for standardized tool integration.
  </Card>

  <Card title="Custom Tools" icon="wrench" href="/cookbook/tools/custom-tools">
    Build your own tools with the @tool decorator.
  </Card>

  <Card title="Tool Hooks" icon="bolt" href="/cookbook/tools/tool-hooks">
    Pre and post execution hooks for tools.
  </Card>

  <Card title="Built-in Tools" icon="toolbox" href="/cookbook/tools/built-in">
    Ready-to-use tools for search, files, databases, and more.
  </Card>
</CardGroup>

## Quick Examples

### Using Built-in Tools

```python theme={null}
from agno.agent import Agent
from agno.tools.duckduckgo import DuckDuckGoTools
from agno.tools.yfinance import YFinanceTools

agent = Agent(
    tools=[
        DuckDuckGoTools(),
        YFinanceTools(stock_price=True, analyst_recommendations=True),
    ],
)

agent.print_response("What's NVDA's stock price and recent news?")
```

### Creating Custom Tools

```python cookbook/91_models/tool_decorator/tool_decorator.py theme={null}
from agno.agent import Agent
from agno.tools import tool

@tool(show_result=True)
def calculate_bmi(weight_kg: float, height_m: float) -> float:
    """Calculate Body Mass Index."""
    return weight_kg / (height_m ** 2)

agent = Agent(tools=[calculate_bmi])
agent.print_response("Calculate BMI for someone who is 70kg and 1.75m tall")
```

### Using MCP Servers

```python cookbook/91_models/mcp/filesystem.py theme={null}
import asyncio
from agno.agent import Agent
from agno.tools.mcp import MCPTools

async def main():
    async with MCPTools("npx -y @modelcontextprotocol/server-filesystem .") as mcp:
        agent = Agent(tools=[mcp])
        await agent.aprint_response("What files are in the current directory?")

asyncio.run(main())
```

## Run Examples

```bash theme={null}
git clone https://github.com/agno-agi/agno.git
cd agno/cookbook/91_models

# Custom tools
python tool_decorator/tool_decorator.py

# MCP
python mcp/filesystem.py

# Tool hooks
python tool_hooks/pre_and_post_hooks.py
```
