Skip to main content
Glama

build_animation_state_machine

DestructiveIdempotent

Build or update an Animation Blueprint state machine from one atomic JSON spec: create states, transitions, and rules in a single idempotent call; re-running the same spec is a no-op.

Instructions

Atomic JSON-spec builder for an Animation Blueprint state machine. Builds (or reuses) the state machine, then iterates states, transitions, and per-transition rules in one idempotent call. Replaces 8+ primitive cmds (add_anim_state_machine + add_anim_state + add_anim_transition + set_anim_transition_rule_*) with a single spec. Re-running with the same spec is a no-op (each primitive is internally idempotent: state-by-name, transition-by-source+target). For repeated invocations that change rule shape, the rule is re-applied on the existing transition.

Returns: { success: bool, anim_blueprint_path: string, machine_name: string, machine_already_existed: bool, states_created: int, states_skipped: int, transitions_created: int, transitions_updated: int, transitions_skipped: int, errors: [string], compiled: bool, compiled_after: bool }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
specYesJSON describing the graph shape. states: [{name: str, animation?: str (/Game/Anim/Foo — optional; load-bearing for the runtime state asset but NOT created here), loop?: bool, pos?: [x, y]}]. transitions: [{from: str, to: str, blend?: number (= crossfade_duration seconds), bidirectional?: bool, priority_order?: int, rule?: object}]. Each rule variant maps 1:1 to an existing primitive cmd: {type: "automatic", enabled?: bool = false, trigger_time?: number = 0.0} | {type: "bool", variable: str (must exist on the AnimBP), invert?: bool = false} | {type: "comparison", variable: str (must be float/double on the AnimBP), operator: "=="|"!="|">"|"<"|">="|"<=", comparison_value: number}. An absent rule leaves the transition inert (no rule wired).
forceNoOptional. This command is REFUSED while a Play-in-Editor session is running: it either compiles a Blueprint (the reinstancer can retain a world, and CheckForWorldGCLeaks is Fatal -- it KILLS the editor) or writes to disk (Editor.AllowSavingAssetsDuringPIE=0 makes the engine refuse the write, so it would report success without writing a byte). Stop PIE and retry instead; force=true runs it anyway, at your own risk.
machine_nameNoAlias of `state_machine_name` (same value, same meaning). Accepted because sibling tools spell this parameter differently; prefer `state_machine_name`.
compile_afterNoOptional, default false; if true runs compile_anim_blueprint at the end
blueprint_nameNoAlias of `anim_blueprint_path` (same value, same meaning). Accepted because sibling tools spell this parameter differently; prefer `anim_blueprint_path`.
state_machine_nameNoTarget state machine name (created if missing via add_anim_state_machine)
anim_blueprint_pathNoPath to the UAnimBlueprint asset

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare idempotentHint=true and destructiveHint=true. The description adds atomicity, the specific idempotency mechanics (state-by-name, transition-by-source+target), and re-run behavior for changed rules. It also lists the return fields. While it doesn't detail what gets destroyed or auth requirements, it provides useful context beyond annotations.

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?

The description is front-loaded with the core purpose, followed by replacement scope, idempotency details, and return format. Every sentence adds relevant information without redundancy or padding.

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

Completeness5/5

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

For a complex builder tool with a nested spec object, the description covers purpose, behavior, idempotency, and return values. Combined with the detailed schema and annotations, an agent has enough information to invoke it correctly. No output schema exists, but the return format is fully described.

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 fully documents all parameters including the detailed spec structure and the force parameter's PIE behavior. The tool description adds no parameter-specific meaning beyond calling it a JSON-spec builder. Baseline 3 is appropriate.

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?

The description states a specific verb (builds) and resource (Animation Blueprint state machine), and explicitly distinguishes itself from siblings by naming the 8+ primitive commands it replaces. An agent can immediately tell what it does and how it differs from add_anim_state_machine, add_anim_state, etc.

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?

It clearly indicates the tool replaces multiple primitive commands with a single spec, implying when to use it over the alternatives. It also describes idempotency behavior for re-runs. However, it lacks explicit 'when not to use' conditions or direct guidance like 'use this instead of X when Y'.

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

Deploy Server

Other Tools