API Reference
webSearchTool
function webSearchTool(backend): Tool;Defined in: tools/builtin/web.ts:41
Build a web_search tool bound to a backend.
Parameters
| Parameter | Type | Description |
|---|---|---|
backend | WebBackend | The WebBackend whose search performs the lookup. |
Returns
A Tool named web_search ready to pass to the agent loop or a ToolRegistry.
Remarks
Read-only, so it keeps the default parallel execution mode (a batch of searches can run concurrently). Results are shaped by formatWebSearchResults.
See
Example
const tool = webSearchTool(myWebBackend);
await runAgent({ ...opts, tools: [tool] });
// The model can now call: web_search({ query: "agentic loop", maxResults: 5 })