ToolResultBlock
Defined in: src/types/messages.ts:244
Tool result content block.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ToolResultBlock(data): ToolResultBlock;Defined in: src/types/messages.ts:272
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
data | { toolUseId: string; status: "success" | "error"; content: ToolResultContent[]; error?: Error; } |
data.toolUseId | string |
data.status | "success" | "error" |
data.content | ToolResultContent[] |
data.error? | Error |
Returns
Section titled “Returns”ToolResultBlock
Properties
Section titled “Properties”readonly type: "toolResultBlock";Defined in: src/types/messages.ts:248
Discriminator for tool result content.
toolUseId
Section titled “toolUseId”readonly toolUseId: string;Defined in: src/types/messages.ts:253
The ID of the tool use that this result corresponds to.
Implementation of
Section titled “Implementation of”status
Section titled “status”readonly status: "success" | "error";Defined in: src/types/messages.ts:258
Status of the tool execution.
Implementation of
Section titled “Implementation of”content
Section titled “content”readonly content: ToolResultContent[];Defined in: src/types/messages.ts:263
The content returned by the tool.
Implementation of
Section titled “Implementation of”error?
Section titled “error?”readonly optional error: Error;Defined in: src/types/messages.ts:270
The original error object when status is ‘error’. Available for inspection by hooks, error handlers, and event loop. Tools must wrap non-Error thrown values into Error objects.