Skip to main content
Glama

create_state_machine

Build a state machine that switches between pre-built timelines using events and guards for interactive multi-state animation flows.

Instructions

Create a state machine that switches between timelines based on events/guards. Create the per-state timelines FIRST, then this, then add_sm_state for each state. Use for interactive / multi-state scenarios (hover→active, idle→walk→run, 4 seasons…).

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": {
      "id": "<id>"
    },
    "name": "create_state_machine"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesUnique state machine id e.g. "player_sm"
nameNoDisplay name shown in the SM editor
requestIdNo
sessionIdNo
expectedRevisionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations only tell the agent this is a mutating, non-open-world call. The description adds real behavioral context beyond that: it is a container-creating step that depends on prior timeline creation and is followed by per-state calls. It stops short of saying what happens on duplicate id, whether creation is reversible, or how revision/conflict handling works.

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?

Three short sentences, each with distinct purpose (what it does, call order, when to use), front-loaded with the core action and free of filler.

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?

For a create tool with no output schema and thin annotations, the workflow ordering and scenario guidance cover the main ambiguity. Remaining gaps are duplicate-id behavior, return value, and the meaning of expectedRevision, which is a moderate omission rather than a blocking one.

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

Parameters2/5

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

Schema coverage is only 40%: id and name are documented inline, but requestId, sessionId, and expectedRevision carry no description. The description says nothing about any parameter, so it does not compensate — notably the concurrency-control parameter expectedRevision remains opaque to an agent.

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 ("Create a state machine") plus its mechanism ("switches between timelines based on events/guards"), which separates it cleanly from siblings like create_timeline, add_sm_state, and add_sm_transition.

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

Usage Guidelines5/5

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

Gives an explicit ordering prerequisite ("Create the per-state timelines FIRST, then this, then add_sm_state for each state") and names concrete use cases (hover→active, idle→walk→run, seasons). An agent knows both the sequence of calls and the scenario that selects this tool.

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