Skip to content

Interface: ToolResult

@providerprotocol/ai


@providerprotocol/ai / @providerprotocol/ai / 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.

const result: ToolResult = {
toolCallId: 'call_abc123',
result: { temperature: 72, conditions: 'sunny' }
};
// Error result
const errorResult: ToolResult = {
toolCallId: 'call_abc123',
result: 'Location not found',
isError: true
};

optional isError: boolean

Defined in: src/types/tool.ts:85

Whether the tool execution resulted in an error


result: unknown

Defined in: src/types/tool.ts:82

The result data (can be any serializable value)


toolCallId: string

Defined in: src/types/tool.ts:79

The tool call ID this result corresponds to