Tool Invocations
Submit and track tool calls as part of post-call analysis
Overview
Tool invocations allow you to capture and analyze the tools used during calls. This documentation covers how to submit tool calls, parameter options, result formats, and how Roark tracks versioning for tools.
Submitting Tool Calls
Tool calls can be submitted as part of your post-call-analysis
by including a toolInvocations
array in your request payload. Each tool invocation requires:
name
: The name of the tool being invokeddescription
: A brief description of what the tool doesstartOffsetMs
: The start time offset in milliseconds with respect to the start of the callendTimeOffsetMs
: The end time offset in milliseconds with respect to the start of the callparameters
: The parameters passed to the toolresult
: The result of the tool invocation
Tracking Input Parameters
Parameters can be submitted in two different formats:
Simple Key-Value Pairs
The most basic format is a simple key-value pair. Roark will automatically infer the type of the parameter, and rely on the name of the parameter to understand the context.
Detailed Key-Value Pairs
To ensure that the usage of the tool is clear and the types are correctly inferred, you can manually provide the description
and type
for each parameter. Type can be one of: string
, number
, boolean
.
Tracking Results
The result returned by the tool can be a string or a JSON object.
String Results
For simple responses, you can pass in a string:
JSON Object Results
For structured data, you can pass a JSON object:
Tool Execution Duration
Roark calculates execution duration automatically using the difference between startOffsetMs
and endTimeOffsetMs
:
startOffsetMs
: Time offset (in milliseconds) from the beginning of the call when the tool execution startedendTimeOffsetMs
: Time offset (in milliseconds) from the beginning of the call when the tool execution ended
Tool Versioning
The system automatically tracks changes to your tool calls and creates new versions when:
- A tool with the same name receives a different schema for input parameters
- A tool with the same name is called with a different description
Example
If you previously called a tool:
And later change it to:
The system will automatically create a new version to track these changes.