Interface: ToolResult
@providerprotocol/ai / @providerprotocol/ai / ToolResult
Interface: ToolResult
Section titled “Interface: ToolResult”Defined in: src/types/tool.ts:77
Result of tool execution.
Returned after executing a tool, containing the result data and whether an error occurred.
Example
Section titled “Example”const result: ToolResult = { toolCallId: 'call_abc123', result: { temperature: 72, conditions: 'sunny' }};
// Error resultconst errorResult: ToolResult = { toolCallId: 'call_abc123', result: 'Location not found', isError: true};Properties
Section titled “Properties”isError?
Section titled “isError?”
optionalisError:boolean
Defined in: src/types/tool.ts:85
Whether the tool execution resulted in an error
result
Section titled “result”result:
unknown
Defined in: src/types/tool.ts:82
The result data (can be any serializable value)
toolCallId
Section titled “toolCallId”toolCallId:
string
Defined in: src/types/tool.ts:79
The tool call ID this result corresponds to