Skip to main content
Glama

apply_operations

Destructive

Run an ordered batch of sprite edits in one atomic call: if any operation fails, the whole batch rolls back. Validate the plan first with dry_run.

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?) [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)

Input Schema

TableJSON 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.8/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, yet the description adds substantial behavior beyond that: full-batch rollback on any op failure, the error naming the failing op index, dry_run validating shape only ('runtime issues surface on a real run'), 1-based frame rejection rather than clamping, and selection clipping. This is rich, non-obvious disclosure.

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?

Key semantics (atomicity, ordering, dry_run, frame numbering) are front-loaded before the long op catalog. The catalog is long but every line is functional reference an agent needs to construct valid operations, so no sentence is wasted.

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?

Despite having no output schema, the description specifies the return value (workflow_manifest.v1 with a per-op operations list and pixels_written/pixels_outside_selection/selection_applied when pixels are touched). Combined with the destructiveness annotations, an agent has everything needed to call it correctly.

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% (filename and the operations array are opaque), so the description carries the burden and does so exhaustively: it enumerates every op with its argument names, marks optionals with '?', documents aliases (from_frame/to_frame, from_color/to_color), and states that unlisted args are rejected. This is far beyond what the schema provides.

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 key differentiator of 'atomic, single-process batch'. This clearly separates it from the many single-op siblings like draw_line, add_layer, and set_frame_duration that do one thing each.

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?

Explains the batching context well: ops run in order against the same open sprite, so later ops see earlier ones, and dry_run=True is recommended for validation before a real run. It does not explicitly name when to prefer this over calling individual op tools, so it stops short of full when/when-not/alternatives guidance.

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