Website Tools

WebsiteTools exposes a read_url function to read a website's contents, or an add_website_to_knowledge function when a Knowledge instance is passed in.

WebsiteTools enable an Agent to read a website's contents, or to add them to a knowledge base when one is provided.

Prerequisites

The following example requires the beautifulsoup4 library.

uv pip install -U agno beautifulsoup4 openai

Example

The following agent will read the contents of a website.

cookbook/91_tools/website_tools.py
from agno.agent import Agent
from agno.tools.website import WebsiteTools

agent = Agent(tools=[WebsiteTools()])
agent.print_response("Search web page: 'https://docs.agno.com/introduction'", markdown=True)

read_url uses WebsiteReader with its default max_depth=3 and max_links=10, so results can include linked pages as well as the starting URL.

For insertion, configure a regular Knowledge instance with an appropriate vector store and embedder. Managed-page Knowledge uses sync_pages and rejects the insert operation used by this toolkit.

Toolkit Params

ParameterTypeDefaultDescription
knowledgeOptional[Knowledge]NoneThe knowledge base to add website contents to. When provided, add_website_to_knowledge is registered instead of read_url.

Toolkit Functions

FunctionDescription
add_website_to_knowledgeAdds a website's content to the knowledge base. Registered only when knowledge is provided. Accepts a valid HTTP or HTTPS URL.
read_urlReads a URL and returns the contents. Registered when no knowledge is provided.

Developer Resources