Skip to main content
Glama

screenshot_diff

Idempotent

Compare screenshots against a saved baseline or between two URLs to detect visual changes, showing pixel-diff percentage and red-highlighted areas.

Instructions

Visual regression: save a named baseline (viewport, element, or a PNG such as the design mockup) and compare later — changed-pixel % and a red-highlighted diff; or compare_urls: production vs staging in this tab, pixels plus text diff, logged-in pages included. Baselines are in-memory (lost on service worker restart).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
maskNocompare_urls: selectors hidden on both pages (dates, carousels, ads)
nameNoBaseline id: reuse the same one to compare across runsdefault
url_aNocompare_urls: reference page, e.g. production
url_bNocompare_urls: page under test, e.g. staging or a PR preview
actionYesbaseline stores, compare measures against it, compare_urls diffs url_a vs url_b here, clear drops baselines
tab_idNoTarget tab; omitted = last tab navigated in this session, else the active one
selectorNoCapture one element (default viewport)
from_fileNoaction=baseline: take it from this PNG (design mockup) instead of capturing
thresholdNoPer-channel tolerance 0-255

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv1.16.1
    • changedInput schema / properties / action / description
      Previous value: -"baseline stores, compare measures against it, clear drops baselines"New value: +"baseline stores, compare measures against it, compare_urls diffs url_a vs url_b here, clear drops baselines"
    • changedInput schema / properties / action / enum
      Previous value: -[
      -  "baseline",
      -  "compare",
      -  "list",
      -  "clear"
      -]New value: +[
      +  "baseline",
      +  "compare",
      +  "compare_urls",
      +  "list",
      +  "clear"
      +]
    • addedInput schema / properties / from_file
      Added value: +{
      +  "description": "action=baseline: take it from this PNG (design mockup) instead of capturing",
      +  "type": "string"
      +}
    • addedInput schema / properties / mask
      Added value: +{
      +  "description": "compare_urls: selectors hidden on both pages (dates, carousels, ads)",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • addedInput schema / properties / url_a
      Added value: +{
      +  "description": "compare_urls: reference page, e.g. production",
      +  "type": "string"
      +}
    • addedInput schema / properties / url_b
      Added value: +{
      +  "description": "compare_urls: page under test, e.g. staging or a PR preview",
      +  "type": "string"
      +}
  2. Changed3 schema fields changedv1.10.0
    • addedInput schema / properties / action / description
      Added value: +"baseline stores, compare measures against it, clear drops baselines"
    • addedInput schema / properties / name / description
      Added value: +"Baseline id: reuse the same one to compare across runs"
    • addedInput schema / properties / tab_id / description
      Added value: +"Target tab; omitted = last tab navigated in this session, else the active one"
  3. First observedv1.8.0

TDQS

A4.3/5.0
Behavior4/5

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

The description explicitly notes that baselines are in-memory and lost on service worker restart, which is important stateful behavior. It also mentions that 'clear drops baselines' in the action parameter. It does not fully detail navigation side effects for compare_urls, but the provided context exceeds the annotations alone.

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 dense but efficient, packing the core workflow into two sentences. The em-dash list and semicolon structure keep related ideas together, though there is slight redundancy between 'changed-pixel %' and 'pixels plus text diff'.

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?

Given the complexity of multiple actions and parameters, the description covers the essential workflow, output characteristics (changed-pixel percentage and diff highlight), and the in-memory limitation. It does not specify the exact return format, but the parameter-level descriptions and action enum cover most operational details.

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 9 parameters have descriptions in the schema, and the main description adds meaningful context such as using from_file for design mockups and threshold as per-channel tolerance. The descriptions clarify the distinction between compare and compare_urls, so an agent can infer parameter usage without external documentation.

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 'Visual regression:' and clearly defines the tool's purpose: saving named baselines and comparing later, with support for viewport, element, or PNG baselines. It also distinguishes compare_urls for production-vs-staging diffs, making the intended use obvious.

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 explains when to use the tool for visual regression and specifically calls out compare_urls for production-vs-staging comparisons. It does not explicitly contrast it with sibling screenshot tools, but the regression-focused wording is enough to imply the alternative use cases.

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