Skip to main content
Glama

screenshot-diff

Compare two PNG screenshots to detect visual differences in layout, spacing, color, and rendering. Returns a compact diff summary with normalized coordinates.

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 simulator-server dependency 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. 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.
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.
Behavior4/5

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

With no annotations provided, the description fully covers behavioral traits: it ignores the status-bar band, explains failure conditions (invalid inputs, unreachable backend), and describes return values with coordinate normalization. This adds significant transparency beyond the bare schema.

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 a single well-structured paragraph that front-loads the main purpose in the first sentence. It covers all key aspects without excessive verbosity, though some bullet points could improve readability for complex parameter logic.

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?

Given 7 parameters, no output schema, and high complexity, the description is remarkably complete: it explains input modes, status-bar exclusion, failure conditions, output structure (summary, diffPath, contextDiffPath), and coordinate system normalization. No critical gaps remain.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

All 7 parameters have schema descriptions (100% coverage), but the description adds valuable context: the mutual exclusivity of captureBaseline/captureCurrent, the optional nature of outputDir, and the typical usage pattern (baselinePath + captureCurrent). This aids correct parameter combination.

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 clearly states 'Compare two PNG screenshots and return a compact visual-diff summary' with specific verb, resource, and output. It further elaborates on use cases like layout, spacing, color, etc., which distinguishes it from sibling tools like 'screenshot' that only capture images.

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 description provides explicit guidance on when to use ('Use when stable before/after screenshots exist...') and how to configure parameters for baseline/current paths or live captures. It offers a recommended workflow ('use baselinePath + captureCurrent for the common visual-regression flow') but does not explicitly list alternative tools to avoid.

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

Install Server

Other Tools

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