/** * WebFetch Tool - Fetch and process web content * * Fetches content from a URL and optionally processes it with an LLM. */ import type { Tool } from '../types.js'; /** * Input parameters for webFetch tool */ export interface WebFetchInput { /** * The URL to fetch content from */ url: string; /** * Optional prompt to process the content with * If provided, the content will be processed and summarized */ prompt?: string; /** * Request timeout in milliseconds (default: 30000) */ timeout?: number; /** * Maximum content size to return in bytes (default: 100KB) * Larger content will be truncated */ maxSize?: number; } /** * Result of webFetch tool */ export interface WebFetchResult { /** * The fetched content (or processed result if prompt provided) */ content: string; /** * The URL that was fetched (may differ from input if redirected) */ url: string; /** * HTTP status code */ status: number; /** * Content type from response headers */ contentType: string; /** * Whether the content was truncated */ truncated: boolean; /** * Original content size in bytes */ originalSize: number; } /** * WebFetch tool definition */ export declare const webFetchTool: Tool; /** * Options for creating a webFetch tool */ export interface WebFetchOptions { /** * Default timeout for requests (default: 30000ms) */ defaultTimeout?: number; /** * Default max content size (default: 100KB) */ defaultMaxSize?: number; /** * Blocked domains (requests to these domains will fail) */ blockedDomains?: string[]; /** * Allowed domains (if set, only these domains are allowed) */ allowedDomains?: string[]; /** * Custom content processor function * Can be used to integrate LLM processing */ contentProcessor?: (content: string, prompt?: string) => Promise; /** * Custom headers to include in all requests */ customHeaders?: Record; } /** * Factory function to create a webFetch tool with custom options */ export declare function createWebFetchTool(options?: WebFetchOptions): Tool;