# `web_fetch` Fetch a URL over HTTP(S) and return its text. **Input** — `url` (required), `timeout` (optional, default 20s, max 60s), `user_agent` (optional), `raw` (optional, default false) Documentation, a raw file, a JSON API response, or a web page. HTML is stripped to the text a reader would see — script and style blocks dropped, block tags turned into line breaks, entities decoded — so a page doesn't arrive as a wall of markup. `raw` keeps the markup instead. Redirects are followed, up to five. The default `User-Agent` is a real Firefox string. Not to pass as a person: many sites answer an unfamiliar client with a 403 or a JavaScript wall, and the point is to get the same document a browser would. `user_agent` overrides it for a site that wants something else. Output is capped at 50,000 characters with a note saying so, and the download itself at 2 MB — beyond that it isn't something the model will read anyway. ## Why it blocks Tool execution is synchronous: the agent calls a tool and uses the dictionary it returns, so there is nowhere to await an `HTTPRequest`. This drives `HTTPClient` in a poll loop instead — the same reason [`remote`](remote.md) speaks raw HTTP to its bridge. The editor is blocked while a request runs, which is why the timeout is short and capped. A non-2xx response is returned as an error, but with a little of the body: a site's reason for a 403, or an API's error object, is usually the useful part. A binary response is refused rather than decoded into noise.