Skip to main content
Glama

Screen Diff

screen_diff
Read-onlyIdempotent

Compare two screenshots or frames to obtain an SSIM score, changed share, and highlighted changed boxes, so you can confirm a UI change affected only the expected areas.

Instructions

Compare two screenshots or frames: SSIM score, changed share, and changed boxes in b's pixels, to check a UI change happened only where expected.

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": {
      "a": "<a>",
      "b": "<b>"
    },
    "name": "screen_diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
aYesBefore image (or video: first frame).
bYesAfter image (or video); scaled to a's size.
returnImageNoReturn b inline with changes outlined (default true).
pixelThresholdNoMean 0-255 difference for a ~32x32 cell to count as changed (default 12).

Output Schema

NameRequiredDescriptionDefault
ssimYes
regionsYes
meanDiffYes
identicalYes
changedFractionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.47.0
    • changedInput schema / properties / a / description
      Previous value: -"The 'before' image (or video: its first frame is used)."New value: +"Before image (or video: first frame)."
    • changedInput schema / properties / b / description
      Previous value: -"The 'after' image (or video). Scaled to a's size if it differs."New value: +"After image (or video); scaled to a's size."
    • changedInput schema / properties / pixelThreshold / description
      Previous value: -"How different (0-255 mean) a cell of about 32x32 image pixels must be to count as changed (default 12: catches a changed label or a toast)."New value: +"Mean 0-255 difference for a ~32x32 cell to count as changed (default 12)."
    • changedInput schema / properties / returnImage / description
      Previous value: -"Also return 'b' inline with the changed regions outlined in red (default true)."New value: +"Return b inline with changes outlined (default true)."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": {},
      +  "properties": {
      +    "changedFraction": {
      +      "type": "number"
      +    },
      +    "identical": {
      +      "type": "boolean"
      +    },
      +    "meanDiff": {
      +      "type": "number"
      +    },
      +    "regions": {
      +      "items": {},
      +      "type": "array"
      +    },
      +    "ssim": {
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    }
      +  },
      +  "required": [
      +    "identical",
      +    "ssim",
      +    "meanDiff",
      +    "changedFraction",
      +    "regions"
      +  ],
      +  "type": "object"
      +}
  2. Changed1 schema field changedv0.39.0
    • changedInput schema / properties / pixelThreshold / description
      Previous value: -"How different (0-255 mean per 8 px cell, at ~320 px analysis width) an area must be to count as changed (default 12)."New value: +"How different (0-255 mean) a cell of about 32x32 image pixels must be to count as changed (default 12: catches a changed label or a toast)."
  3. First observedv0.32.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), so the bar is lower; the description adds real value by disclosing the output fields and, importantly, the coordinate frame ('changed boxes in b's pixels'), which matters because the schema notes b is scaled to a's size. It does not mention cost, resolution limits, or what happens with mismatched aspect ratios beyond the scaling note.

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?

A single front-loaded sentence with the action and outputs first and the motivation last; every clause carries information. The phrase 'changed boxes in b's pixels, to check' makes the reader re-parse slightly, but the density is appropriate for a tool with an output schema.

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 an output schema present, the description needn't enumerate return values, yet it summarizes them anyway and covers the core behavior for a read-only diff tool. The remaining gap is guidance on when a change-check should use wait_for_change instead, but nothing an agent needs in order to call it correctly is missing.

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 the schema already documents a, b, returnImage, and pixelThreshold thoroughly (including the ~32x32 cell and default 12 semantics). The description adds only the output coordinate-frame hint and nothing about thresholds or the inline-image toggle, which is the expected baseline when the schema does the heavy lifting.

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 ('Compare two screenshots or frames') and names the concrete outputs (SSIM score, changed share, changed boxes), so an agent can tell this apart from screenshot, wait_for_change, or sample_frames. It stops short of naming a sibling it is easily confused with, so the differentiation is implied rather than explicit.

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?

The closing clause 'to check a UI change happened only where expected' gives a clear intended use case, which is enough for an agent to pick this over wait_for_change (time-based) or screenshot (single capture). It offers no explicit when-not conditions or named alternatives, so it is strong context without full routing guidance.

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