Skip to main content
Glama

Animation

animation

Build AnimationPlayer keyframe tracks, SpriteFrames from sprite sheets, and AnimationTree state machines in one call; all edits undoable.

Instructions

Animate anything: build AnimationPlayer animations with all tracks and keys in one call (property tweens, method calls, sounds, 3D transforms), SpriteFrames for AnimatedSprite2D/3D from image files or a sliced sprite sheet, and AnimationTree state machines / blend spaces / blend trees with transitions and conditions. All edits are undoable.

Actions:

  • create: {name ('walk' or 'lib/walk'), tracks: [{type?=value, path: 'Sprite2D:modulate', keys: [{time, value, easing?}]}], length? (default: last key time), loop?: none|linear|pingpong|true, path? (AnimationPlayer; created if it doesn't exist), parent?/player? (where/what to name a new player), library?='', autoplay?, reset?=true (key the current values of animated properties into the default library's RESET animation, like the editor does; the editor applies RESET before saving so previews/AnimationTrees don't leak into the scene), step?, validate?=true, overwrite?=true} build a complete animation; adds an AnimationPlayer when the scene has none. Values: '#ff0000', [x,y], numbers, 'res://tex.png'. 2D 'rotation' is radians (or animate 'rotation_degrees'). Call methods with a method track: {type: 'method', path: 'Player', keys: [{time, method, args}]}.

  • list: {path?} animations (length, loop, track summary) of one player, or of every AnimationPlayer in the scene.

  • get: {path?, name} full tracks and keys of an animation.

  • edit: {path?, name, length?, loop?, step?} change animation settings.

  • add_track: {path?, name, tracks: [{type, path, keys}]} (or track: {...}) add tracks to an existing animation; extends length to fit keys (extend?=true); reset?=true adds missing RESET tracks.

  • set_keys: {path?, name, track: index|'Sprite2D:modulate', keys: [...], replace?=true} replace a track's keys (replace=false merges, overwriting keys at the same time).

  • remove_track: {path?, name, track: index|path}

  • delete: {path?, name} delete an animation.

  • rename: {path?, name, new_name}

  • set_autoplay: {path?, name} play this animation when the scene starts (name='' clears).

  • sprite_frames: {path: AnimatedSprite2D/3D node or res://frames.tres, animations: {name: {frames: ['res://run_1.png', 'res://run_*.png', {texture, duration}] | sheet: {texture, hframes, vframes, row? | frames?: [indices] | start?/count?, frame_size?: [w,h], margin?, separation?}, fps?=10, loop?=true|false|pingpong}}, autoplay? (animation name, or true = the first one), play? (animation shown in the editor), replace? (default merges into existing frames), save_path?} create SpriteFrames and assign it (sheets are sliced into AtlasTextures). If the sprite already uses a SpriteFrames .tres file, that file is updated.

  • tree: {path? (AnimationTree; created if missing) | parent?+name?, anim_player? (default: the only AnimationPlayer), type?=state_machine|blend_space_1d|blend_space_2d|blend_tree, states: ['idle', {name, animation?} | {name, type: blend_space_2d, blend_points}], transitions: [{from (name, list or '*'), to, condition?, expression?, switch_mode?: immediate|sync|at_end, auto?, xfade?, priority?}], start?, blend_points?: [{animation, pos: number|[x,y]}], min_space?, max_space?, nodes?/connections? (blend_tree: [{name, type: animation|blend2|blend3|add2|sub2|one_shot|time_scale|time_seek|transition, animation?, inputs? (transition: ['idle', 'run']), props?}], [{from, to: name|'output', port?: index or input name}]), parameters?: {'conditions/moving': false, 'shot/request': 'fire'}, props? (AnimationTree node props), active?=true, reset?=true (add missing RESET tracks so the tree playing in the editor can't leak its pose into the saved scene)} build a complete AnimationTree in one call; replaces the tree_root of an existing tree.

  • tree_info: {path?} describe an AnimationTree: states, transitions, blend points, settable parameters, problems (missing animations).

  • set_parameter: {path?, name: 'conditions/moving' | 'blend_position' | 'shot/request' (fire|abort|fade_out) | 'state/transition_request', value} or {parameters: {name: value}} set AnimationTree parameters (in game code: $AnimationTree.set('parameters/conditions/moving', true)).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keysNoKeys [{time, value, easing?}] (method: {time, method, args}).
loopNonone | linear | pingpong (true = linear).
nameNoAnimation name ('walk' or 'library/walk'); for tree: the new AnimationTree's name.
pathNoAnimationPlayer / AnimationTree / AnimatedSprite node path (or res://*.tres for sprite_frames). Optional when the scene has exactly one player/tree.
playNosprite_frames: animation the sprite shows in the editor.
stepNoKeyframe snap step in seconds.
typeNoTrack type filter (set_keys/remove_track), or AnimationTree root type (tree).
nodesNotree (blend_tree): [{name, type, animation?, props?}].
propsNotree: properties of the AnimationTree node itself, e.g. {callback_mode_process: 'physics'}.
resetNocreate/add_track/tree: add missing RESET tracks with the current property values (default true).
sceneNores:// scene to operate on; opened in the editor if needed. Defaults to the currently edited scene.
startNotree: start state (default: the first state).
trackNoadd_track: a track object. set_keys/remove_track: track index or path.
valueNo
actionYesWhat to do. See the tool description for each action's parameters.
activeNotree: AnimationTree.active (default true).
extendNoExtend the animation length to fit new keys (default true).
lengthNoAnimation length in seconds.
parentNoParent node for a new AnimationPlayer / AnimationTree.
playerNoName for a new AnimationPlayer (create).
statesNotree: states ['idle', 'run'] or [{name, animation?, type?, blend_points?}].
tracksNoTracks to build.
libraryNoAnimation library name (default '' = the player's default library).
replaceNoset_keys: replace all keys (default true). sprite_frames: start from empty SpriteFrames.
autoplayNocreate: true to autoplay this animation. sprite_frames: animation name to autoplay (true = the first one).
new_nameNoNew animation name (rename).
validateNoCheck that track nodes/properties exist (default true).
max_spaceNoBlend space maximum (number or [x,y]); default from the points.
min_spaceNoBlend space minimum (number or [x,y]); default from the points.
overwriteNocreate: replace an existing animation of the same name (default true).
save_pathNosprite_frames: also save the SpriteFrames as this res:// .tres.
animationsNosprite_frames: {name: {frames | sheet, fps?, loop?}}.
parametersNotree/set_parameter: {parameter: value}, e.g. {'conditions/moving': true, 'move/blend_position': [1, 0]}.
root_propsNotree: properties of the root AnimationNode (e.g. a state machine's allow_transition_to_self).
anim_playerNotree: AnimationPlayer node path (relative to the scene root).
connectionsNotree (blend_tree): [{from, to, port?}] ('output' is the final node).
transitionsNotree: [{from, to, condition?, expression?, switch_mode?, auto?, xfade?}].
blend_pointsNotree: blend space points [{animation, pos}].

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior1/5

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

Annotations declare destructiveHint=false, but the description advertises 'delete' animation, 'remove_track', 'overwrite?=true' and 'replace?=true' defaults that replace existing data. This contradicts the destructiveHint annotation even though the description notes all edits are undoable.

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 long but necessary for a 14-action, 38-parameter tool. It is front-loaded with a one-sentence summary and organized as an action list, though the bullets are extremely dense and repeat some schema detail.

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 complexity and lack of an output schema, the description covers return content for list/get/tree_info and explains mutation behavior and undoability. Some minor return/error details for edit and delete are absent, but the core operational picture is complete.

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

Parameters5/5

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

Schema coverage is already 97%, but the description adds action-specific parameter mapping that the schema cannot express: which parameters apply to create vs tree vs sprite_frames, defaults, nested key/track object shapes, easing values, sheet slicing options, and example values. This is rich semantic guidance beyond the input 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 opens with a specific verb and resource set: 'Animate anything: build AnimationPlayer animations... SpriteFrames... AnimationTree state machines' and enumerates every action. It clearly distinguishes the animation domain from sibling tools like node, scene, or signal.

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?

Each action is given clear context: create builds a complete animation, list returns one or all players, tree builds an AnimationTree and replaces an existing tree_root. It does not explicitly state when to prefer this tool over sibling tools, but the action-level guidance is strong.

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