web_fetch
Fetches a single URL and returns its content. Use this when you have a specific URL in mind — for example, after web.search returns a link you want to read, or when the user pastes a URL.
Modes (extract):
'auto' (default): picks the right mode based on response content type.
'markdown': for HTML pages; returns cleaned markdown plus the page .
'text': for JSON/XML/plaintext APIs; returns the raw decoded body.
'file': for images, PDFs, audio, video, archives, or any binary — ingests the bytes into the user's file storage and returns a file_id you can pass to messages.send (to send as an attachment), agents.add_file (to add to agent knowledge), or files.read.
Use web.fetch (not files.upload) when you need the file_id immediately for the next tool call — files.upload(source_url=…) is async and won't have the file ready in the same turn.
Use web.search (not web.fetch) when you don't have a specific URL yet and need to find one.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | URL to fetch (http or https). Must be publicly reachable. | |
| extract | No | How to handle the response: 'auto' (default), 'markdown' (HTML → markdown), 'text' (raw body), or 'file' (ingest as binary, return file_id). | auto |
| in_workspace | No | Run this one call in this workspace id instead of the session's. Nothing is stored; other sessions are not affected. |