Interface: ToolExecution
@providerprotocol/ai / @providerprotocol/ai / ToolExecution
Interface: ToolExecution
Section titled “Interface: ToolExecution”Defined in: src/types/tool.ts:327
Record of a completed tool execution.
Contains all information about a tool call that was executed, including timing and result data.
Example
Section titled “Example”const execution: ToolExecution = { toolName: 'get_weather', toolCallId: 'call_abc123', arguments: { location: 'San Francisco' }, result: { temperature: 72 }, isError: false, duration: 150, approved: true};Properties
Section titled “Properties”approved?
Section titled “approved?”
optionalapproved:boolean
Defined in: src/types/tool.ts:347
Whether approval was required and granted (undefined if no approval handler)
arguments
Section titled “arguments”arguments:
Record<string,unknown>
Defined in: src/types/tool.ts:335
Arguments that were passed to the tool
duration
Section titled “duration”duration:
number
Defined in: src/types/tool.ts:344
Execution duration in milliseconds
isError
Section titled “isError”isError:
boolean
Defined in: src/types/tool.ts:341
Whether the tool execution resulted in an error
result
Section titled “result”result:
unknown
Defined in: src/types/tool.ts:338
Result returned by the tool
toolCallId
Section titled “toolCallId”toolCallId:
string
Defined in: src/types/tool.ts:332
Unique identifier for this tool call
toolName
Section titled “toolName”toolName:
string
Defined in: src/types/tool.ts:329
Name of the tool that was called