API Reference
searchTool
function searchTool(backend): Tool;Defined in: tools/builtin/search.ts:38
Build a search tool bound to a backend.
Parameters
| Parameter | Type | Description |
|---|---|---|
backend | SearchBackend | The SearchBackend that performs the actual regex search. |
Returns
A Tool named 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 formatSearchResults.
See
Example
const tool = searchTool(mySearchBackend);
await runAgent({ ...opts, tools: [tool] });
// The model can now call: search({ pattern: "TODO", path: "src", ignoreCase: true })