Skip to content

createFetchUrlTool

createFetchUrlTool(options): FetchUrlTool

Defined in: packages/tools/src/web/tools.ts:109

Builds the fetchUrl tool: one http(s) URL in, readable text or markdown out. Private, loopback, and link-local addresses are refused — including after a redirect — unless FetchUrlToolOptions.allowedUrls or FetchUrlToolOptions.allowPrivateNetwork say otherwise.

Distinct from web search (which finds pages). Fetched content is untrusted text; HTML is converted with Turndown and javascript:/data: links are flattened to visible text. See the module comment above and FETCH_URL_DESCRIPTION.

FetchUrlToolOptions

FetchUrlTool