Skip to main content
Glama

Ask the story engine directly

engine

Reads Twine engine state such as passage, turns, visited passages, and variable values without re-rendering the page, so agents can inspect progress and story variables using minimal tokens.

Instructions

Read engine state without re-rendering the page: passage, turns, variable count, visited passages, or specific variable paths. ~160 bytes where an observation costs ~1.5 KB. SugarCube, Chapbook and Snowman; Harlowe reports unsupported.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "engine"
  }
}

Input Schema

NameRequiredDescriptionDefault
limitNoWith include:"actions": how many to return (default 20).
pathsNoWith include:"paths": dot paths like "player.hp" or "coins".
game_idNoSession id from open_game. Omit when a single game is open.
includeNosummary (default): passage/turns/counts. paths: read the paths you name. visited: passages the engine says you reached. actions: what this session did.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.0

TDQS

A4.4/5.0
Behavior4/5

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

No annotations are supplied, so the description carries the full burden, and it does disclose meaningful behavior: it is a non-rendering read, it is dramatically cheaper than an observation, and it has engine-specific support with Harlowe reporting unsupported. It leaves out prerequisites such as requiring an open session (only implied via the game_id schema text) and what happens on unsupported-engine failure beyond 'reports unsupported'.

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

Conciseness5/5

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

Two sentences, zero filler, with the core capability front-loaded and the cost/compatibility facts packed into compact clauses. Every sentence carries decision-relevant information.

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

Completeness4/5

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

With 4 optional parameters, no annotations, and no output schema, the description correctly compensates by listing the data an agent gets back and its relative cost. It is nearly complete; the only real gap is an explicit statement that a game session must already be open before calling it.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description adds real value by mapping its enumeration (passage, turns, variable count, visited passages, specific variable paths) onto the include modes summary/paths/visited. The cost framing also tells the agent why choosing a narrower include (e.g. paths) is worthwhile, which the schema alone does not.

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

Purpose5/5

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

States a specific verb and resource ("Read engine state") and enumerates exactly what is returned: passage, turns, variable count, visited passages, or specific variable paths. The phrase "without re-rendering the page" and the byte-cost contrast implicitly separate it from heavier observation-style siblings, so an agent can distinguish it without opening the schema.

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

Usage Guidelines4/5

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

Gives clear selection context: use it when you want state cheaply and do not want to trigger a re-render (~160 bytes vs ~1.5 KB for an observation). It also states a hard exclusion — Harlowe reports unsupported — with SugarCube, Chapbook and Snowman supported. It stops short of naming the overlapping sibling (get_variables) or explicitly saying when not to use it beyond engine compatibility.

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