Skip to main content
Glama

Compare with implementation

compare_screenshot
Read-only

Pixel-diffs a running page or PNG screenshot against its Figma render, returning the mismatch percentage and differing regions mapped to Figma layers.

Instructions

Pixel-diffs your implementation against the Figma render of the target. Pass url (+ selector) to have Lupa render your running page at the design's width, or image = a PNG screenshot. Returns the mismatch %, the differing regions mapped to Figma layers, and a design | implementation | diff image.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "compare_screenshot"
  }
}

Input Schema

NameRequiredDescriptionDefault
urlNoPage with your implementation, e.g. http://localhost:5173/sheet. Rendered in headless Chromium at the design's width, 2x.
fileNoWhich open Figma file (name or key) when several are connected. Default: the most recently active.
imageNoInstead of url: path to a PNG screenshot of the implementation, cropped to the same element.
targetNoFigma URL, node id(s) like "12:34" (comma-separated), or omit for the current selection in Figma.
selectorNoCSS selector of the element to capture on that page (default: the full page).
wait_forNoSelector to wait for before capturing (default: selector).
save_diffNoAlso write the comparison image to this path.
thresholdNoPer-pixel colour tolerance 0–1 (default 0.1).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations only declare readOnlyHint=true, so the description carries the rest. It discloses meaningfully more than the annotations: the page is rendered in headless Chromium at the design's width, and it spells out the return payload (mismatch %, differing regions mapped to Figma layers, composite design|implementation|diff image) since there is no output schema. It omits any note on cost/latency of launching a browser render, which is the main residual gap.

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 tight sentences, front-loaded with the purpose before the invocation modes and return values. No filler or redundancy.

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 8 optional parameters and no output schema, the description covers the modes and the return values well enough for correct invocation. It leaves default-resolution behavior (target defaults to Figma selection, wait_for defaults to selector) entirely to the schema, which is acceptable given 100% schema coverage but leaves a small gap for a zero-required-parameter tool.

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 coverage is 100%, so baseline is 3. The description adds the url-vs-image mutual exclusivity, which the schema only implies, but says nothing about target defaulting to the current selection, wait_for, save_diff, or threshold.

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 resource: 'Pixel-diffs your implementation against the Figma render of the target.' It is clearly distinct from sibling get_screenshot (which views rather than compares) without needing to name it.

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?

Explains the two operating modes clearly: pass url (+ selector) to have Lupa render the running page, or image for a pre-captured PNG. It gives clear context for invocation but does not state when to prefer this over get_screenshot or export_assets, so it stops short of full alternative routing.

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