Skip to main content
Glama

Advance deterministic story state

step_story_state
Read-onlyIdempotent

Advance 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

NameRequiredDescriptionDefault
stateNoOptional state overrides applied on top of initialState.
storyYesA 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}}.
memoryNoOptional prior memory log: strings or {turn, fact} objects.
choicesYesOrdered player choices. Each entry is an integer index into the current scene's choices, a case-insensitive choice label, or {index}/{label}.
rememberNoFacts to plant in the turn-stamped memory log before stepping.
startSceneNoOptional override for the entry scene.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the readOnly/idempotent/non-destructive annotations, the description discloses the internal mechanics an agent actually needs: guard evaluation, a single write path for set/add/append, and a SHA-256 trace hash for verifiability. The phrase 'single write path' sits in mild tension with readOnlyHint=true, but it reads as an in-memory reducer producing new state rather than an external mutation, so it is not a contradiction.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three front-loaded sentences, each carrying content: what runs, what it evaluates/applies, and what comes back. The trailing 'Zero silent state drift' is a tagline rather than information, the one element that does not fully earn its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Outputs are covered by the output schema and safety by annotations, so the description need not restate them. What is missing is failure semantics for a complex nested-input tool: whether an unmet `requires` guard throws, skips, or returns the choice as unavailable, and what happens on an unresolvable label or index.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already carries parameter meaning and baseline 3 applies. The description reinforces the effects vocabulary but mentions only set/add/append while the schema also lists a delete op, and it adds nothing about choice-resolution fallback behavior beyond what the schema states.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: 'Run the deterministic story-state reducer for one or more player choices', plus what it evaluates and returns. An agent can distinguish it from a validation or drift-detection sibling, though no sibling is named explicitly to sharpen the boundary.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied: it is the tool you call to advance the story given player choices. There is no explicit statement of when to prefer validate_story_graph or detect_state_drift first, nor any precondition such as 'graph must be valid' or 'only call after choices are collected'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.