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.
Properties
Section titled “Properties”invoke
Section titled “invoke”invoke: (input?, options?) => Promise<ToolResultBlock>;Defined in: src/agent/tool-caller.ts:48
Invoke the tool and return the final result.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
input? | JSONValue | The input parameters for the tool |
options? | DirectToolCallOptions | Optional configuration for this call |
Returns
Section titled “Returns”Promise<ToolResultBlock>
The tool result
stream
Section titled “stream”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.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
input? | JSONValue | The input parameters for the tool |
options? | DirectToolCallOptions | Optional configuration for this call |
Returns
Section titled “Returns”AsyncGenerator<ToolStreamEvent, ToolResultBlock, undefined>
Async generator that yields ToolStreamEvents and returns ToolResultBlock