Skip to main content
Glama

apply_operations

Destructive

Apply multiple sprite edit operations in one atomic batch so related layer, frame, and pixel changes run in order against the same open sprite, with dry-run validation and rollback on failure.

Instructions

Apply a list of edit operations to a sprite in one atomic, single-process batch.

Each operation is {"op": "<name>", "args": {...}}. Ops run in order against the same open sprite, so later ops see earlier ones (e.g. add a layer then draw on it). Arguments not listed for an op are rejected rather than ignored.

Atomic: if any op fails the whole batch is rolled back and nothing is saved; the error names the failing op index. dry_run=True validates the op list and returns the plan without launching Aseprite (shape checks only; runtime issues like a missing layer surface on a real run).

Frames are 1-based, and an arg=frame argument must name a frame that already exists: an out-of-range frame is rejected with the sprite's valid range rather than clamped, so a per-op summary always describes the frames actually touched.

Returns a workflow_manifest.v1 (kind "batch") with a per-op operations list, and, when the ops touched pixels, the same pixels_written / pixels_outside_selection / selection_applied fields every other tool reports: a batch run under an active selection is clipped to it, and these say how much the mask refused.

Operations and their arguments ('?' marks an optional argument): add_frame(duration_ms=int?, copy_from=frame?) add_layer(name=str, group=str?, opacity=int?, blend_mode=str?, visible=bool?) add_slice(name=str, x=int, y=int, width=int, height=int, color=color?) add_tag(name=str, from=frame, to=frame, direction=str?, color=color?, repeats=int?) [also accepts from_frame for from, to_frame for to] clear_layer(layer=str?, frame=frame?) copy_cel(layer=str, from=frame, to=frame, to_layer=str?) [also accepts from_frame for from, to_frame for to] delete_cel(layer=str, frame=frame) draw_ellipse(layer=str?, frame=frame?, cx=int, cy=int, rx=int, ry=int, color=color) draw_line(layer=str?, frame=frame?, x1=int, y1=int, x2=int, y2=int, color=color) draw_pixels(layer=str?, frame=frame?, pixels=list, color=color?) draw_rectangle(layer=str?, frame=frame?, x=int, y=int, width=int, height=int, color=color) duplicate_frame(frame=frame) fill_ellipse(layer=str?, frame=frame?, cx=int, cy=int, rx=int, ry=int, color=color) fill_layer(layer=str?, frame=frame?, color=color) fill_rectangle(layer=str?, frame=frame?, x=int, y=int, width=int, height=int, color=color) remove_frame(frame=frame) remove_layer(layer=str) remove_slice(name=str) remove_tag(name=str) rename_layer(layer=str, new_name=str) replace_color(layer=str?, frame=frame?, from=color, to=color, tolerance=int?) [also accepts from_color for from, to_color for to] set_all_frame_durations(duration_ms=int) set_cel_opacity(layer=str, frame=frame, opacity=int) set_cel_position(layer=str, frame=frame, x=int, y=int) set_frame_duration(frame=frame, duration_ms=int) set_layer_opacity(layer=str, opacity=int) set_layer_visible(layer=str, visible=bool) set_pixel(layer=str?, frame=frame?, x=int, y=int, color=color)

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": {
      "filename": "<filename>",
      "operations": "<operations>"
    },
    "name": "apply_operations"
  }
}

Input Schema

NameRequiredDescriptionDefault
dry_runNoDefault: false.
filenameYes
operationsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.10.0
    • addedInput schema / properties / dry_run / description
      Added value: +"Default: false."
    • removedInput schema / properties / dry_run / title
      Removed value: -"Dry Run"
    • removedInput schema / properties / filename / title
      Removed value: -"Filename"
    • removedInput schema / properties / operations / title
      Removed value: -"Operations"
    • removedInput schema / title
      Removed value: -"apply_operationsArguments"
  2. First observedv0.7.0

TDQS

A4.7/5.0
Behavior5/5

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

Adds substantial behavior beyond the destructiveHint=true annotation: all-or-nothing rollback with the error naming the failing op index, ordering/semantics of ops sharing one open sprite, rejection of unlisted arguments, and the fact that dry_run only does shape checks so runtime issues surface on a real run. It also discloses that frames are 1-based and out-of-range frames are rejected rather than clamped, which is exactly the kind of surprise an agent needs warned about.

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?

Front-loaded with purpose and atomicity before the reference catalog, and nearly every sentence carries unique information. The op catalog is long but is genuine reference material; only the parenthetical alias notes and repeated '?'/'frame' notation add mild density without new concepts.

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?

No output schema exists, so the description explains the return value (workflow_manifest.v1, kind 'batch', per-op operations list) and the pixel-accounting fields including clipping under an active selection. For a destructive batch mutation with a thin schema, this covers what an agent needs to call it correctly and interpret the result.

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 only 33% and 'operations' is a bare array of additionalProperties:true objects, so the description carries the entire burden — and it does, enumerating 29 ops with their argument names, types, optionality, and legacy aliases (from_frame for from, etc.). This is meaning that exists nowhere in the structured 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?

States a specific verb and resource — apply a list of edit operations to a sprite — plus the distinguishing scope: one atomic, single-process batch. It also makes the batch-vs-per-op distinction explicit by clarifying that ops run in order against the same open sprite, which separates it from the per-operation siblings like add_layer or draw_line.

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?

Usage context is clear: use it to batch edits atomically, and use dry_run=True to validate a plan without launching Aseprite. What is missing is an explicit statement of when NOT to use it (e.g. a single one-off edit where the individual op tools are simpler), so the agent must infer the alternative from the 'batch' framing.

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