Class: ToolResultMessage
@providerprotocol/ai / @providerprotocol/ai / ToolResultMessage
Class: ToolResultMessage
Section titled “Class: ToolResultMessage”Defined in: src/types/messages.ts:320
Tool execution result message.
Contains the results of executing one or more tool calls, sent back to the model for further processing.
Example
Section titled “Example”const msg = new ToolResultMessage([ { toolCallId: 'call_1', result: { temperature: 72, conditions: 'sunny' } }, { toolCallId: 'call_2', result: 'File not found', isError: true }]);Extends
Section titled “Extends”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ToolResultMessage(
results,options?):ToolResultMessage
Defined in: src/types/messages.ts:333
Creates a new tool result message.
Parameters
Section titled “Parameters”results
Section titled “results”Array of tool execution results
options?
Section titled “options?”Optional message ID and metadata
Returns
Section titled “Returns”ToolResultMessage
Overrides
Section titled “Overrides”Properties
Section titled “Properties”
readonlyid:string
Defined in: src/types/messages.ts:124
Unique message identifier
Inherited from
Section titled “Inherited from”metadata?
Section titled “metadata?”
readonlyoptionalmetadata:MessageMetadata
Defined in: src/types/messages.ts:130
Provider-specific metadata, namespaced by provider name
Inherited from
Section titled “Inherited from”results
Section titled “results”
readonlyresults:ToolResult[]
Defined in: src/types/messages.ts:325
Results from tool executions
timestamp
Section titled “timestamp”
readonlytimestamp:Date
Defined in: src/types/messages.ts:127
Timestamp when the message was created
Inherited from
Section titled “Inherited from”
readonlytype:"tool_result"
Defined in: src/types/messages.ts:322
Message type discriminator
Overrides
Section titled “Overrides”Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get audio():
AudioBlock[]
Defined in: src/types/messages.ts:180
All audio content blocks in this message.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”documents
Section titled “documents”Get Signature
Section titled “Get Signature”get documents():
DocumentBlock[]
Defined in: src/types/messages.ts:173
All document content blocks in this message.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”images
Section titled “images”Get Signature
Section titled “Get Signature”get images():
ImageBlock[]
Defined in: src/types/messages.ts:166
All image content blocks in this message.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”reasoning
Section titled “reasoning”Get Signature
Section titled “Get Signature”get reasoning():
ReasoningBlock[]
Defined in: src/types/messages.ts:195
All reasoning/thinking content blocks in this message. Available when using extended thinking models.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Get Signature
Section titled “Get Signature”get text():
string
Defined in: src/types/messages.ts:156
Concatenated text content from all text blocks. Blocks are joined with double newlines.
Returns
Section titled “Returns”string
Inherited from
Section titled “Inherited from”Get Signature
Section titled “Get Signature”get video():
VideoBlock[]
Defined in: src/types/messages.ts:187
All video content blocks in this message.
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”getContent()
Section titled “getContent()”
protectedgetContent():ContentBlock[]
Defined in: src/types/messages.ts:338
Returns the content blocks for this message. Implemented by subclasses to provide type-specific content.