Skip to main content
Glama

erase_region

Clears all pixels inside a rectangular area on a layer across selected frames, making them transparent (or opaque black on background layers). Use it to remove unwanted sprite regions in batch.

Instructions

Make the pixels of a layer inside rect transparent in each of the frames.

On the background layer, which cannot be transparent, they turn opaque black. Cel content beyond the canvas edge inside rect is erased too. Frames where the layer has no cel are skipped and counted. Linked cels in other frames keep their pixels.

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": {
      "path": "<path>",
      "layer": "<layer>",
      "rect": "<rect>"
    },
    "name": "erase_region"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesSprite file. Relative paths resolve against the server root.
rectYesCanvas rectangle to clear
layerYesLayer name, or a 'group/child' path for nested layers
framesNoFrames: a number, "1-4", "1-4,7" or "all" (1-based)

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does substantial work: it discloses the background-layer fallback to opaque black, erasure beyond canvas edges, skipping and counting frames without a cel, and that linked cels elsewhere are untouched. It omits irreversibility/undo and permission requirements for a mutate operation, which are the remaining gaps.

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 the core action in the first sentence, followed by the edge cases an agent most needs. A few sentences are terse to the point of fragmentary ('Linked cels in other frames keep their pixels'), but each one carries distinct information and nothing is wasted.

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?

For a destructive, unannotated mutation tool, the description covers the non-obvious behavior that would otherwise cause surprises (background layer, off-canvas, cel-less frames, linked cels). Return values need not be described because an output schema exists, but destructive/irreversible semantics are never stated.

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 coverage is 100%, so the schema already documents path, layer, rect, and frame syntax. The description adds only indirect meaning (frames are processed individually, and empty ones are skipped and counted); it does not elaborate on layer path resolution or rect coordinates beyond what the schema states. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: making pixels of a named layer transparent inside a rectangle, across frames. The scope qualifiers (canvas rect, each frame) implicitly separate it from siblings like draw_rect or clear_cels, but no sibling is actually named.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied by the operation's semantics rather than spelled out: an agent can infer this is for rectangular erasure, not drawing or clearing whole cels. There is no explicit when-to-use, when-not, or alternative recommended (e.g., clear_cels or draw_rect), leaving routing to inference.

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