Skip to main content
Glama

generate_state_machine

Add an AnimationNodeStateMachine sub-resource block directly into a .tscn file, defining visual state blocks and transitions without opening the Godot editor. Use this tool to automate state machine setup for animations in your scene.

Instructions

State Machine Graph Generator: Inject an AnimationNodeStateMachine sub-resource block into a .tscn file -- define visual state blocks without opening the editor.

Each state dict must have:

  • 'name': state name (e.g. 'Idle')

  • 'animation': animation clip name (e.g. 'idle')

  • 'position': optional [x, y] graph layout coordinates

Args: scene_path: Absolute path to the .tscn scene file. node_name: Name for the AnimationTree node (e.g. 'AnimationTree'). states: List of state definition dicts. anim_player_path: NodePath to the AnimationPlayer. start_state: Start state name (defaults to first state).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
statesYes
node_nameYes
scene_pathYes
start_stateNo
anim_player_pathNoAnimationPlayer

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.1/5.0
Behavior3/5

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

With no annotations provided, the description must carry the behavioral disclosure burden. It indicates the tool modifies a .tscn file ('inject'), but does not detail side effects like overwriting existing nodes, file backup, or failure behavior. It also doesn't mention permissions or whether the operation is reversible. This is a partial disclosure, not fully transparent.

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?

The description is structured with a summary line, a bullet list of state dict requirements, and an Args list. It is a bit verbose but every part serves a purpose. The core purpose is front-loaded, and the parameter details are organized clearly.

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?

Given the tool has 5 parameters and an output schema, the description covers all parameters with practical examples and explains the expected input format for the states list. It doesn't describe return values, but the output schema exists, so that is not required. For a mutation tool on scene files, it is reasonably complete, though it could mention error conditions or idempotency.

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?

The schema has zero descriptions for parameters, so the description compensates by explaining each argument in the Args section, including the required fields for each state dict (name, animation, position). It also clarifies the default behavior of start_state ('defaults to first state'), which is not evident from the schema's empty default. This adds meaningful guidance beyond the schema.

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 action ('Inject an AnimationNodeStateMachine sub-resource block'), the target resource type, and the file type (.tscn). It clearly distinguishes this from sibling tools like create_scene or add_node by focusing on state machine generation.

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?

The description says 'define visual state blocks without opening the editor', which implies when to use it. It does not explicitly list exclusions or alternative tools, but the purpose is specific enough that an agent can infer this is for state machine creation, not general scene editing.

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