Advance deterministic story state
step_story_stateAdvance branching stories by applying player choices through a deterministic reducer that checks guards, applies state effects, and returns the next scene with updated state and traceable memory.
Instructions
Run the deterministic story-state reducer for one or more player choices. Evaluates requires guards, applies set / add / append effects through a single write path, and returns the next scene, updated state, fired guards, available choices and a turn-stamped memory trace with a verifiable SHA-256 trace hash. Zero silent state drift.
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": {
"story": "<story>",
"choices": "<choices>"
},
"name": "step_story_state"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| state | No | Optional state overrides applied on top of initialState. | |
| story | Yes | A branching-story-kit v1 story graph: {id?, title?, startScene (or legacy start), initialState?, scenes}. Scenes map id -> {title, body, ending?, choices?}. Choices carry label, next (or href), optional requires {key: minimum} and optional effects {key: value | {op: set|add|append|delete, value}}. | |
| memory | No | Optional prior memory log: strings or {turn, fact} objects. | |
| choices | Yes | Ordered player choices. Each entry is an integer index into the current scene's choices, a case-insensitive choice label, or {index}/{label}. | |
| remember | No | Facts to plant in the turn-stamped memory log before stepping. | |
| startScene | No | Optional override for the entry scene. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||