Skip to main content
Glama

add_sm_state

Add a state to a state machine, binding a timeline that plays while active; the first state becomes the initial state automatically.

Instructions

Add a state to a state machine. Each state plays one timeline while active. The first state added becomes the initial state automatically.

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": {
      "smId": "<smId>",
      "id": "<id>",
      "name": "<name>",
      "timelineId": "<timelineId>"
    },
    "name": "add_sm_state"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesUnique state id e.g. "idle"
nameYesDisplay name
smIdYesState machine id
speedNoPlayback rate multiplier (default 1)
requestIdNo
sessionIdNo
timelineIdYesTimeline that plays while this state is active
expectedRevisionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

The annotations only declare that this is a write operation in a closed world. The description usefully adds the side effect that the first added state implicitly becomes the initial state and that a state binds to a timeline, which goes beyond the annotations. It does not address concurrency (expectedRevision), idempotency (requestId), duplicate-id behavior, or effect on existing states.

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 short sentences, front-loaded with the action, then the semantic model, then the notable default. Minimal waste; only the middle sentence is arguably informational padding rather than invocation guidance.

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?

For an 8-parameter mutation tool with no output schema, the description covers the core concept but leaves the session/request/revision parameters and error conditions unexplained. It is adequate to call the tool in the happy path but not complete enough to call it safely in concurrent or retry scenarios.

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 coverage is 63%, with id, name, smId, timelineId, and speed documented inline, so the schema carries most of the load. The description adds conceptual meaning for timelineId ("Each state plays one timeline while active") but says nothing about requestId, sessionId, or expectedRevision, which remain opaque.

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 ("Add a state to a state machine") and explains the state's role of playing one timeline while active. It is distinguishable from siblings like add_sm_transition or set_initial_state, though it never names those alternatives directly.

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 implied: you call this when building a state machine, and the note that the first state becomes the initial state hints at ordering effects. There is no explicit guidance on when to use this versus set_initial_state or add_sm_transition, and no stated prerequisites (e.g. that the state machine and timeline must already exist).

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