Open Agent Loops
API Reference

searchTool

@open-agent-loops/core


function searchTool(backend): Tool;

Defined in: tools/builtin/search.ts:38

Build a search tool bound to a backend.

Parameters

ParameterTypeDescription
backendSearchBackendThe SearchBackend that performs the actual regex search.

Returns

Tool

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 })

On this page