WebFetch and WebSearch Guide

Holon agents have two built-in web tools that enable them to retrieve and search the public web. These tools are part of the Web capability family and are available to every agent by default.

WebFetch

WebFetch fetches a specific HTTP or HTTPS URL, extracts readable text, and returns structured provenance. The agent uses it to read web pages, documentation, or API responses.

Parameters

ParameterRequiredDescription
urlyesHTTP or HTTPS URL to fetch
max_charsnoMaximum characters to return (default: no hard limit)
extract_modenoHow to extract content from the response

Extract modes

ModeBehavior
auto (default)Detect content type: render HTML to text, pass text through unchanged
textStrip HTML tags and return plain text
rawReturn the raw response body without processing

What WebFetch returns

Each response includes provenance metadata:

The fetched content is treated as untrusted external content by the runtime. The agent receives the provenance wrapper and is instructed not to escalate trust based on fetched content alone.

Example usage

An agent calls WebFetch like any other tool:

WebFetch { url: "https://example.com/docs/api", max_chars: 5000 }

The runtime fetches the URL, applies Holon's web policy, extracts readable text, and returns the result.

WebSearch

WebSearch searches the web through Holon's web provider registry and returns structured results with citations.

Parameters

ParameterRequiredDescription
queryyesSearch query string
max_resultsnoMaximum number of results to return
providernoSearch provider to use (default: configured provider)

Search providers

Holon uses a provider-based search model with multiple provider options:

Search results from all providers are standardized into a consistent format with title, URL, and snippet text. Citations are preserved so agents can follow up with WebFetch for full page content.

Search configuration is part of onboarding and can be changed later with holon config set.

What WebSearch returns

Each result includes:

Results are structured so the agent can follow up with WebFetch to read full pages when needed. The tool description explicitly tells the agent: "Use WebFetch after search when full page content is needed."

Example usage

WebSearch { query: "Rust async runtime design patterns", max_results: 5 }

Web policy

Holon applies a configurable web policy to all fetch and search operations:

The policy is controlled through Holon's configuration and applies uniformly to both WebFetch and WebSearch.

When agents use these tools

Agents decide when to use web tools based on the task context. Common patterns:

The runtime exposes both tools in the model-facing tool schema, and the agent selects them through normal tool-calling when the task requires web access.

XSearch

XSearch searches public X (Twitter) posts using xAI's hosted x_search endpoint. It operates as an isolated provider request — independent of the main conversation model — and returns durable text with citations.

When to use XSearch

Use XSearch for X-specific content, accounts, or discussions. Use WebSearch for the general web.

Parameters

ParameterRequiredDescription
queryyesSearch query string
allowed_x_handlesnoRestrict results to these X handles (max 10, without @)
excluded_x_handlesnoExclude results from these X handles (max 10, without @)
from_datenoStart date in YYYY-MM-DD format
to_datenoEnd date in YYYY-MM-DD format

What XSearch returns

FieldDescription
textSearch result text from the model response
citationsStructured citations with URL, title, and text position indices
providerAlways xai
backendAlways x_search
modelxAI model used for the search
diagnosticsProvider request ID, latency, and hosted item type counts

Prerequisites

XSearch requires:

  1. xAI provider configured with openai_responses transport and valid credentials (OAuth device login through Codex, or API key).
  2. XSearch enabled (enabled by default when xAI credentials are available).

To disable XSearch:

holon config set x_search.enabled false

Configuration

XSearch configuration uses these keys:

KeyTypeDefaultDescription
x_search.enabledbooleantrueEnable XSearch when xAI credentials are available
x_search.modelmodel_refgrok-4.3xAI model route for isolated XSearch requests
x_search.timeout_secondsinteger60Request timeout in seconds

The default model is grok-4.3. XSearch uses the xAI provider's OAuth credentials and refreshes tokens only on 401 Unauthorized responses.

Example usage

XSearch { query: "Holon runtime agent framework", from_date: "2026-01-01" }

Configuration

Web tools are controlled through Holon's web configuration section:

# Check current web configuration
holon config get web

# Disable web tools entirely
holon config set web.enabled false

See Configuration reference for the full web configuration schema.

See also