Skip to main content
Glama

screenshot-diff

Compare two PNG screenshots—saved baselines or live captures—and get a compact visual-diff summary with diff images to spot layout, spacing, color, or rendering changes.

Instructions

Compare two PNG screenshots and return a compact visual-diff summary. Accepts saved baseline/current PNG paths, or one saved PNG plus one live full-resolution capture from a device. Always provide udid so the capture backend can be resolved. Use when stable before/after screenshots exist and the expected result is pixel-visible: layout, spacing, color, typography, image/icon rendering, clipping, overflow, or text rendering. For live captures, set exactly one of captureBaseline or captureCurrent; use baselinePath + captureCurrent for the common visual-regression flow. Physical iPhones: live captures are device-wide and need no registered app. Keep baselines per device model; different aspect ratios fail as a dimension mismatch. Returns { summary, diffPath, contextDiffPath }. The summary uses normalized [0,1] screen locations matching describe coordinates; diffPath is the full-size diff image and contextDiffPath is a downscaled image for MCP/agent display. Ignores the fixed top status-bar band for both pixel and OCR text comparisons. Fails if the input sources are invalid, PNG files cannot be read, outputDir cannot be written, or the simulator-server / emulator backend is not reachable.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
udidYesTarget device id from `list-devices` (iOS UDID or Android serial).
rotationNoOrientation override for live baseline/current captures. Ignored on physical iPhones.
outputDirNoDirectory where diff artifacts should be written. Optional — defaults to a temp directory; the diff images are returned in the result either way.
currentPathNoPath to the current PNG file. Required unless captureCurrent is true.
baselinePathNoPath to the baseline PNG file. Required unless captureBaseline is true.
captureCurrentNoCapture the current screenshot live at full resolution before diffing. Cannot be combined with captureBaseline.
captureBaselineNoCapture the baseline screenshot live at full resolution before diffing. Cannot be combined with captureCurrent.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed1 schema field changedv0.24.0
    • changedInput schema / properties / rotation / description
      Previous value: -"Orientation override for live baseline/current captures."New value: +"Orientation override for live baseline/current captures. Ignored on physical iPhones."
  2. First observedv0.15.0

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and it delivers extensively. It discloses the return contract ({ summary, diffPath, contextDiffPath }) and the coordinate normalization scheme ([0,1] screen locations matching describe coordinates). It also reveals important behavioral quirks: the fixed top status-bar band is ignored for both pixel and OCR comparisons, and live captures on physical iPhones are device-wide. It explicitly lists failure conditions (invalid sources, unreadable PNGs, unwritable outputDir, unreachable simulator-server/emulator backend), which is exactly the kind of behavioral context an agent needs and that annotations do not provide.

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?

The description is front-loaded with the core action, and each subsequent sentence adds distinct information: input modes, when to use, live-capture configuration, physical-device caveats, return format, ignored band, and failure conditions. It is dense but earned; every sentence carries a different fact. It loses a point only because it is longer than strictly necessary, and a couple of details appear twice in slightly different forms (the exactly-one live-capture rule appears in the body and again in the schema descriptions).

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?

For a 7-parameter comparison tool with no output schema and no annotations, this description is remarkably complete. It covers all input modes, the return value shape, coordinate conventions, the ignored status-bar band, device-specific behaviors, and failure modes. There is no obvious category of information an agent would need to invoke this tool correctly that is missing.

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?

The input schema already has 100% parameter coverage, so the baseline for this dimension is 3. The description adds significant semantics above that baseline: it explains the pipeline rule (exactly one of captureBaseline or captureCurrent; the common flow is baselinePath + captureCurrent), clarifies the role of outputDir (defaults to temp directory, artifacts still returned), and gives the physical-iPhone caveat that rotation is ignored. It also ties udid to backend resolution ('Always provide udid so the capture backend can be resolved'). These are real additions beyond the schema field comments, not repetition.

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?

The description opens with a specific verb-object pair ('Compare two PNG screenshots') and identifies the tool as a visual-diff operation distinct from the many sibling tools. It explicitly enumerates what the comparison covers (layout, spacing, color, typography, rendering, clipping, overflow, text rendering), so an agent can clearly distinguish this from screenshot or other capture tools. The sibling list contains many capture/gesture tools, but this one is unambiguously the diffing/comparison tool.

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

Usage Guidelines5/5

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

The description explicitly states when to use this tool ('Use when stable before/after screenshots exist and the expected result is pixel-visible'), and provides concrete guidance on how to configure live captures ('set exactly one of captureBaseline or captureCurrent; use baselinePath + captureCurrent for the common visual-regression flow'). It also gives device-specific guidance (physical iPhones need no registered app, keep baselines per device model) and documents a key limitation (different aspect ratios fail). This is among the most usage-rich descriptions possible for a tool with no separate usage-hints annotation.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/software-mansion/argent'

If you have feedback or need assistance with the MCP directory API, please join our Discord server