Compare with implementation
compare_screenshotPixel-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
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Page with your implementation, e.g. http://localhost:5173/sheet. Rendered in headless Chromium at the design's width, 2x. | |
| file | No | Which open Figma file (name or key) when several are connected. Default: the most recently active. | |
| image | No | Instead of url: path to a PNG screenshot of the implementation, cropped to the same element. | |
| target | No | Figma URL, node id(s) like "12:34" (comma-separated), or omit for the current selection in Figma. | |
| selector | No | CSS selector of the element to capture on that page (default: the full page). | |
| wait_for | No | Selector to wait for before capturing (default: selector). | |
| save_diff | No | Also write the comparison image to this path. | |
| threshold | No | Per-pixel colour tolerance 0–1 (default 0.1). |