Set a state entry
set_stateWrite one entry of a state store (created with its first entry): value is any JSON, at most 1 MiB. ttl_seconds deletes it after that long; if_version writes only if the entry is at that version (0: only if it does not exist), so concurrent writers never overwrite each other unawares. Returns the entry with its new version. State is billed with storage, and each write is billed too (get_storage).
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": {
"store": "<store>",
"key": "<key>",
"value": "<value>"
},
"name": "set_state"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | The entry's key: any text up to 512 bytes. | |
| store | Yes | The store's name: letters, digits, dots, dashes and underscores. | |
| value | Yes | Any JSON. | |
| if_version | No | Write only if the entry is at this version; 0: only if it does not exist. | |
| ttl_seconds | No | Delete the entry after this many seconds. |