set_state
Directly write/overwrite session state in Redis for a project, without needing to fire a real request through stateCaptureExpr first. Useful for forcing a stateful test scenario into a specific state (e.g. jump straight to 'settled' or 'completed') without building fake helper mock endpoints. Merges with (does not replace) any existing variables already saved under the same sessionKey — pass only the fields you want to add or overwrite.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"projectSlug": "<projectSlug>",
"sessionKey": "<sessionKey>",
"variables": "<variables>"
},
"name": "set_state"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| variables | Yes | Map of variable names to literal values to write into state, e.g. {"status": "settled", "balance": 500000}. Accessible afterwards as state.<name> in rule conditions and {{state.<name>}} in responseBody. | |
| sessionKey | Yes | The exact session key that stateLookupExpr on other mocks will resolve to | |
| ttlMinutes | No | How long the state should live in Redis, in minutes. Defaults to 15 (matching stateCaptureExpr's TTL) if omitted. | |
| projectSlug | Yes | Project slug |