> ## Documentation Index
> Fetch the complete documentation index at: https://docs.roark.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# roark simulation tool mock

> Mock a tool call during a test call

The 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.

```bash Synopsis theme={"theme":{"light":"everforest-light","dark":"everforest-dark"}}
roark simulation tool mock [options]
```

> [!NOTE]
>
> Calls `POST /v1/simulation/tool-mock`

## Options

**--simulation-job-id** `string` *required*

The simulation this session belongs to, from the agent-config resolve response (`simulationJobId`). Roark re-validates it against the live simulation before answering.

**--session-id** `string`

Your session or room identifier, echoed back in logs for correlation.

**--tool-name** `string` *required*

The tool the agent invoked.

**--tool-description** `string`

The tool's contract: its description and, ideally, its parameter and return shape. The more contract you pass, the more faithful the simulated response.

**--arguments** `object`

The arguments the agent called the tool with, verbatim.

## Example

```bash theme={"theme":{"light":"everforest-light","dark":"everforest-dark"}}
roark simulation tool mock --simulation-job-id <value> --tool-name <value>
```

Every command also takes the [global options](/cli-reference/overview.md#global-options) and sets one
of the [exit codes](/cli-reference/overview.md#exit-codes).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.