vrt_compare
Compare a webpage screenshot with a Figma or local design reference to detect visual differences and return diff percentage, image, and diagnostic analysis.
Instructions
Visual regression test: compare a page screenshot against a design reference. Captures screenshot of URL, compares with Figma design or local image using odiff. Returns diff percentage, path to diff image, and analysis for AI feedback loop.
Workflow:
Provide design source (Figma or local file path)
Tool captures page screenshot (with optional pre-actions)
Compares using odiff
Returns diff result with percentage, diff image, and diagnostic analysis
Features:
Retry with configurable wait strategy
Pre-actions (click, scroll, type, wait) before capture
Crop to specific element
Side-by-side comparison image
Smart analysis for high diff percentages
Use session_id to reuse cached design across iterations.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"page_url": "<page_url>",
"design_source": "<design_source>"
},
"name": "vrt_compare"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page_url | Yes | URL of the page to capture screenshot from | |
| viewport | No | Browser viewport size. If not provided, auto-matches design image dimensions. | |
| threshold | No | Diff threshold percentage (default: 1 means 1%) | |
| session_id | No | Session ID for caching. Reuse to skip re-fetching design. | |
| wait_until | No | Page load strategy (default: 'networkidle') | networkidle |
| pre_actions | No | Actions to perform before capturing screenshot | |
| retry_count | No | Number of retry attempts (1-3, default: 1) | |
| retry_delay | No | Delay between retries in ms (default: 1000) | |
| antialiasing | No | Enable antialiasing tolerance in odiff | |
| design_source | Yes | Design reference source | |
| crop_to_element | No | CSS selector of element to crop screenshot to | |
| skip_design_fetch | No | Skip fetching design, use cached version from session | |
| wait_for_selector | No | CSS selector to wait for before capturing (graceful degradation on failure) | |
| auto_match_viewport | No | Automatically set viewport to match design image dimensions. Default: true when viewport not specified. | |
| generate_side_by_side | No | Generate a side-by-side comparison image (design | screenshot | diff) |