Skip to main content
Glama

compare_frames

Read-only

Count differing RGBA pixels between two sprite frames and return the bounding box around changes, optionally restricting comparison to a specific layer or canvas region.

Instructions

Count the pixels that differ between two frames and box them in.

A pixel differs when its RGBA differs; two fully transparent pixels are equal. bounds is the canvas box around the differences, null when the frames are identical. Without layer the visible composites are compared.

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>",
      "frame_a": "<frame_a>",
      "frame_b": "<frame_b>"
    },
    "name": "compare_frames"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesSprite file. Relative paths resolve against the server root.
layerNoLayer name or 'group/child' path for that layer's own pixels; omit for the visible layers composited
regionNoOnly compare this canvas rectangle; default all
frame_aYes1-based frame number
frame_bYes1-based frame number

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

Annotations only supply readOnlyHint=true, so the description carries the substantive behavior: the exact difference rule (RGBA inequality, two fully transparent pixels equal), the meaning of a null bounds result for identical frames, and the composite-vs-layer comparison default. It does not discuss failure modes (out-of-range frame index, unknown layer name), which is a minor remaining gap.

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?

Four short sentences with no filler, front-loaded with the core action and followed by the comparison rule and the return semantics. Every sentence contributes distinct information.

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?

With a full schema, an output schema, and a readOnly annotation, the description covers what remains: the diff rule and the null-when-identical semantics. It is sufficient for correct invocation, though it omits behavior on invalid frame numbers or layers.

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 description coverage is 100%, so parameter documentation is already handled by the schema. The description only reinforces the layer parameter's default behavior (already stated in the schema as "omit for the visible layers composited") and adds nothing about region, frame_a, or frame_b, so baseline 3 applies.

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?

"Count the pixels that differ between two frames and box them in" names a specific verb pair (count, bound) and a specific resource (two frames), which no sibling in the list performs. An agent can distinguish this from add_frames/copy_frames/check_animation without opening the schema.

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?

The purpose statement implies when the tool applies, and the last line clarifies the default comparison mode (visible composites when layer is omitted). However, there is no explicit statement of when to prefer this over other inspection tools, no exclusions, and no mention of preconditions such as valid frame ranges or layer existence.

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