Mock a tool call during a test call
Changed onThe server half of the tool guard for code-first agents. When a guarded tool fires during a Roark test call, send the invocation here instead of executing it: Roark answers with a simulated backend response that is valid JSON, shaped by the tool contract you pass, consistent with the test scenario, and consistent with earlier mocked responses in the same call. Real callers are never affected: the guard only diverts when the agent-config resolve response identified the session as a Roark simulation, and this endpoint independently re-validates the simulation before answering.
Failure contract for your wrapper: 404 means the simulation id is unknown to this project (treat the session as real). 409 means the simulation has already ended (stale session state: do NOT execute the real tool; return your static fallback). 5xx means generation failed (return your static fallback).
Identical retries (same tool, same arguments) within a few minutes return the stored response, so double-fired handlers stay consistent.
Request
- Base URLhttps://api.roark.ai
- URLhttps://api.roark.ai/v1/simulation/tool-mock
- AuthHTTP bearer
Request body
Example request
{
"toolName": "book_appointment",
"toolDescription": "Books an appointment. Args: date (YYYY-MM-DD), time (HH:MM). Returns {confirmationId, status}.",
"arguments": {
"date": "2026-10-01",
"time": "15:00"
}
}Response
The simulated tool response. Return result from your tool.
Changes
- info
added the required property
/to the response with the status
- info
- info
endpoint added
- info