> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agno.com/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>
  Agno 2.7.2 leaves Anthropic tool selection automatic because the adapter omits `Agent.tool_choice` from the request.
</Note>

## Usage

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

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U "agno[anthropic,ddg]"
    ```
  </Step>

  <Step title="Export your Anthropic API key">
    <CodeGroup>
      ```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"
      ```
    </CodeGroup>
  </Step>

  <Step title="Run the agent">
    Save the code above as `tool_use.py`, then run:

    ```bash theme={null}
    python tool_use.py
    ```
  </Step>
</Steps>

## Developer Resources

* [WebSearchTools](/tools/toolkits/search/websearch)
* [Tool overview](/tools/overview)
* [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)
