> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zylon.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Web Fetch tool

> Fetch and extract a URL mentioned in the message.

<Warning>
  **Upcoming release — Zylon 1.58**

  These docs are published ahead of release so you can prepare your API integrations. The release image is not yet available. For installations running 1.57, use the [1.57 documentation](/en/v1.57/overview).
</Warning>

Use Web Fetch when you need the assistant to retrieve content from a URL.

## Prerequisites

* An API token. See [Backoffice Developer Console](/en/v1.58/developer-manual/get-started/developer-console).

## Requirements

* Tool spec: `{ "name": "web_extract", "type": "web_extract_v1" }`
* No `tool_context` required

## Basic request and response

This example validates a request that enables the web fetch tool:

```bash theme={null}
curl -X POST "https://{BASE_URL}/api/gpt/v1/messages/validate" \
  -H "Authorization: Bearer {API_TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "default",
    "max_tokens": 64,
    "messages": [
      { "role": "user", "content": "Summarize https://example.com/" }
    ],
    "tools": [
      { "name": "web_extract", "type": "web_extract_v1" }
    ],
    "tool_choice": { "type": "auto" }
  }'
```

Example response:

```json theme={null}
{ "valid": true, "errors": null }
```

To run the request, send the same body to `POST /messages`.

## Response blocks

Zylon runs this tool on the server. The response contains a `server_tool_use` block with the call, followed by a `web_fetch_tool_result` block with the result. The call ID starts with `srvtoolu_`. Don't send a `tool_result` back for it.

```json theme={null}
[
  { "type": "server_tool_use", "id": "srvtoolu_3c4d", "name": "web_extract", "input": { "url": "https://example.com/" } },
  {
    "type": "web_fetch_tool_result",
    "tool_use_id": "srvtoolu_3c4d",
    "content": {
      "type": "web_fetch_result",
      "url": "https://example.com/",
      "retrieved_at": "2026-10-08T10:00:00Z",
      "content": {
        "type": "document",
        "title": "Example Domain",
        "source": { "type": "text", "media_type": "text/plain", "data": "# Example Domain\n\nThis domain is for use in examples." }
      }
    }
  }
]
```

Error:

```json theme={null}
{
  "type": "web_fetch_tool_result",
  "tool_use_id": "srvtoolu_3c4d",
  "content": { "type": "web_fetch_tool_result_error", "error_code": "url_not_accessible" }
}
```

These blocks have no `is_error` field. To detect a failure, check whether `content.type` ends in `_error`, then read `content.error_code`.

With the Zylon extension enabled (`system.extensions` includes `zylon`), the result is returned as a plain `tool_result` block with `text` content instead.

See [Migrating from 1.57 to 1.58](/en/v1.58/developer-manual/build-with-zylon/workspace-api/api-migration-1-57-to-1-58) for the full list of server tool blocks.

## Tips

* The URL must appear in the user message.
* Keep the prompt concise to reduce extraction time.

## Next steps

* Learn how messages return tool blocks: [Messages](/en/v1.58/developer-manual/build-with-zylon/working-with-messages)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.