Web Browser Tools

WebBrowser Tools enable an Agent to open a URL in a web browser.

Prerequisites

The following example requires the google-genai and ddgs libraries.

uv pip install -U agno google-genai ddgs

Set the agent model's API key in the same terminal:

export GOOGLE_API_KEY="your-api-key"

Example

cookbook/91_tools/webbrowser_tools.py
from agno.agent import Agent
from agno.models.google import Gemini
from agno.tools.webbrowser import WebBrowserTools
from agno.tools.websearch import WebSearchTools

agent = Agent(
    model=Gemini("gemini-2.0-flash"),
    tools=[WebBrowserTools(enable_open_page=True), WebSearchTools()],
    instructions=[
        "Find related websites and pages using DuckDuckGo",
        "Use web browser to open the site",
    ],
    markdown=True,
)
agent.print_response("Find an article explaining MCP and open it in the web browser.")

Toolkit Params

ParameterTypeDefaultDescription
enable_open_pageboolTrueEnables functionality to open URLs in browser
allboolFalseEnables all functionality when set to True

Toolkit Functions

FunctionDescription
open_pageOpens a URL in a web browser

Run with a current model

The cookbook uses the retired gemini-2.0-flash. Replace its model line before running the saved script:

model=Gemini(id="gemini-3.6-flash"),

See Google's model lifecycle. WebBrowserTools opens the default browser on the machine running Python; run this example in a desktop environment with a browser. It does not create a remote browser session or read page content. WebSearchTools() can choose multiple backends; pass backend="duckduckgo" if the cookbook's DuckDuckGo instruction must match the configured backend.

Developer Resources