Skip to content

ToolHandle

Defined in: src/agent/tool-caller.ts:40

A handle to a specific tool, providing .invoke() and .stream() methods.

Returned by the Proxy get trap when accessing agent.tool.toolName. This aligns with the agent-level agent.invoke() / agent.stream() pattern.

invoke: (input?, options?) => Promise<ToolResultBlock>;

Defined in: src/agent/tool-caller.ts:48

Invoke the tool and return the final result.

ParameterTypeDescription
input?JSONValueThe input parameters for the tool
options?DirectToolCallOptionsOptional configuration for this call

Promise<ToolResultBlock>

The tool result


stream: (input?, options?) => AsyncGenerator<ToolStreamEvent, ToolResultBlock, undefined>;

Defined in: src/agent/tool-caller.ts:57

Stream the tool execution, yielding intermediate events and returning the final result.

ParameterTypeDescription
input?JSONValueThe input parameters for the tool
options?DirectToolCallOptionsOptional configuration for this call

AsyncGenerator<ToolStreamEvent, ToolResultBlock, undefined>

Async generator that yields ToolStreamEvents and returns ToolResultBlock