Skip to main content
Glama
elsahafy
by elsahafy

visual_diff

Compare two PNG screenshots pixel-by-pixel to detect visual regressions, returning changed pixel count and percentage for UI testing without Playwright.

Instructions

Compare two PNG screenshots pixel-by-pixel for visual regression testing. Returns diff statistics including changed pixel count and percentage. Does not require Playwright.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
thresholdNoPer-channel difference threshold (0-255) below which pixels are considered identical
after_imageYesBase64-encoded PNG of the 'after' snapshot (no data URI prefix)
before_imageYesBase64-encoded PNG of the 'before' snapshot (no data URI prefix)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.1

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses the return shape (changed pixel count and percentage) and a dependency fact (Playwright not required), which is genuinely useful, but says nothing about whether a diff image is produced, side effects, or processing limits for large images.

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?

Three short sentences with zero filler; the core action is front-loaded and each sentence adds a distinct fact (action, return, dependency).

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 two-image comparison tool with no output schema and no annotations, the description covers the action, inputs (base64 PNGs, inferable from schema), and return summary. It is nearly complete, only lacking detail on the optional threshold's effect and whether image artifacts are emitted.

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 threshold, before_image, and after_image parameters are already documented in the schema. The description adds no additional parameter meaning (e.g., how threshold interacts with the reported percentage), so the baseline of 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?

States a specific verb and resources ('Compare two PNG screenshots pixel-by-pixel') plus the domain ('visual regression testing'). No sibling tool does image-to-image comparison, so the agent can route to it 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 'for visual regression testing' phrase implies the use case, and 'Does not require Playwright' hints at an alternative execution path, but no explicit when-to-use vs when-not guidance or named alternative tool is given.

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