set_state
Atomically store a checkpoint with an optional version guard to ensure conflict-safe updates when multiple agents coordinate.
Instructions
Atomically write a checkpoint with optional version guard. Pass expected_version from a prior get_state call. expected_version=0 → create-only (fails if key exists). expected_version=N → update only if stored version matches (conflict-safe). Omit expected_version or pass -1 → unconditional write. Use force_set_state for simpler unconditional writes.
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": {
"key": "<key>",
"value": "<value>"
},
"name": "set_state"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | Checkpoint key | |
| value | Yes | Value to store (must be JSON-encoded string) | |
| expected_version | No | Version guard: -1=unconditional, 0=create-only, N=versioned update |