Skip to content

Web access

Two default capabilities put the web within the agent’s reach: web_fetch reads a specific page, and web_search looks things up. Both are on by default.

web_fetch performs an HTTP GET on a URL, reduces the response to text (stripping HTML to plain content, capped so a huge page does not overwhelm the model), and asks a small, fast summarizer model to answer your prompt over that content. It returns the answer, not the raw page, so a long article never floods the conversation. Fetched content is cached for 15 minutes, so repeated fetches of the same URL are fast while each prompt is answered fresh.

The tool takes a url and an optional prompt. With a prompt, the summarizer answers over the page; leave the prompt empty and it returns the page text verbatim instead. Only http and https URLs are allowed.

By default the summarizer runs on the small, fast model for the main agent’s provider, so its credentials line up with the main model (on Amazon Bedrock, the summarizer follows the main model’s family, Anthropic-on-Bedrock or OpenAI-on-Bedrock). Override it with builtin_tools={"web_fetch": {"model": ...}}, which takes the same forms as model:

from strands_harness import create_harness
agent = create_harness(builtin_tools={"web_fetch": {"model": "bedrock/global.anthropic.claude-haiku-4-5-20251001-v1:0"}})

web_search lets the agent look things up while it answers. It isn’t a separate tool: it turns on the web search built into the model provider. OpenAI, Anthropic, Google, and the GPT-5 and GPT-6 models on bedrock-mantle have one.

For models that don’t provide web search, the harness logs a message and builds the agent without it. If you asked for it explicitly in builtin_tools, you get an error instead, so the request doesn’t silently do nothing.

To search with those models anyway, set {"web_search": "exa"} in builtin_tools. The harness then searches through Exa instead, on any model, including ones with their own search. No setup is needed to get started, and setting EXA_API_KEY lifts the free tier’s rate limit. Exa is a third party, so every search query is sent to Exa and handled under its terms; weigh that before using it for sensitive work. You can also connect the MCP server of your preferred search provider instead; see connect MCP servers.

Both are selected by name through builtin_tools. To turn either off, leave it out of the list or set it to False; see add tools and instructions for how selection works. To change the summarizer model, see choose a model and reasoning.