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

# Agent with Tools

> Give a Claude agent a web search tool and let Agno execute the tool-use loop.

Attach `WebSearchTools` to an agent to answer a question with current web results.

## Code

```python tool_use.py theme={null}
from agno.agent import Agent
from agno.models.anthropic import Claude
from agno.tools.websearch import WebSearchTools

agent = Agent(
    model=Claude(id="claude-sonnet-4-6"),
    tools=[WebSearchTools()],
    markdown=True,
)

if __name__ == "__main__":
    agent.print_response("What are the latest developments in fusion energy?")
```

Agno converts each function into Anthropic's `name`, `description`, and `input_schema` tool shape. It executes returned `tool_use` blocks and sends the matching `tool_result` blocks back to Claude.

> [!NOTE]
>
> Anthropic tool selection remains automatic because the `Claude` adapter does not send `Agent.tool_choice` in the request.

## Usage

<Snippet file="create-venv-step.mdx" />

**1. Install dependencies**

```bash theme={null}
uv pip install -U "agno[anthropic,ddg]"
```

**2. Export your Anthropic API key**

```bash Mac/Linux theme={null}
export ANTHROPIC_API_KEY="your_anthropic_api_key_here"
```

```powershell Windows theme={null}
$Env:ANTHROPIC_API_KEY="your_anthropic_api_key_here"
```

**3. Run the agent**

Save the code above as `tool_use.py`, then run:

```bash theme={null}
python tool_use.py
```

## Developer Resources

* [WebSearchTools](https://agno-v2.mintlify.site/tools/toolkits/search/websearch.md)
* [Tool overview](https://agno-v2.mintlify.site/tools/overview.md)
* [Anthropic tool use](https://platform.claude.com/docs/en/agents-and-tools/tool-use/how-tool-use-works)
* [Define tools](https://platform.claude.com/docs/en/agents-and-tools/tool-use/define-tools)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.