Open Agent Loops
API Reference

WebBackend

@open-agent-loops/core


Defined in: tools/builtin/builtin.types.ts:443

The read-only web capability seam — implement this against an online service.

Remarks

Backs the two read-only web tools (web_search and web_fetch). It is the network counterpart to FileReadBackend: both bundle two read-only lookups (there: read + glob; here: search + fetch) over a resource the core knows nothing about, hence a seam rather than a shipped implementation. Wire search to e.g. Brave / Tavily / Exa / Bing, and fetch to an HTTP client plus an HTML-to-text extractor.

SECURITY: fetch dereferences a model-supplied URL, so it can reach internal addresses (SSRF) and exfiltrate via the request. The backend owns allow-listing and redirect limits; route the resulting web_fetch tool through the permission gate (../../permissions) before granting it to a model you do not fully trust — the same advice as for ShellBackend. search is inert by comparison, like SearchBackend.

See

Methods

fetch()

fetch(request, ctx): Promise<WebFetchResult>;

Defined in: tools/builtin/builtin.types.ts:459

Fetch one URL and return its extracted contents.

Parameters

ParameterTypeDescription
requestWebFetchRequestThe URL plus an optional byte cap.
ctxToolContextPer-call context; ctx.signal may be used to abort the fetch.

Returns

Promise<WebFetchResult>

The final URL, status, content type, and extracted text.


search(query, ctx): Promise<WebSearchResult[]>;

Defined in: tools/builtin/builtin.types.ts:451

Run a web search and return the ranked hits.

Parameters

ParameterTypeDescription
queryWebSearchQueryThe search request (query string and optional cap).
ctxToolContextPer-call context; ctx.signal may be used to abort the search.

Returns

Promise<WebSearchResult[]>

The ranked results.

On this page