snapdiff_compare_pages
Compare two web pages visually to detect UI differences. Supports ad-hoc comparison with two URLs or baseline comparison against stored page baselines.
Instructions
Visually compare two web pages to detect differences. Use this to verify that a code change didn't break the UI, compare staging vs production, or check if a page changed. Captures both pages as screenshots, runs pixel-level comparison, and returns a diff percentage plus a highlighted diff image showing exactly what changed. This is the primary tool — use it whenever you need to verify visual output.
Two modes:
Ad-hoc compare: pass
before+afterURLs.Baseline compare: pass
afterURL +project(slug or ID) +page_name. Compares against the last-accepted baseline for that page on the project's default branch. Use this when the user has set up a SnapDiff project and you want to verify a page still matches its approved state.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| after | Yes | URL of the "after" page (e.g. staging URL or localhost) — the page to check | |
| before | No | URL of the "before" page to compare against. Omit when using baseline mode. | |
| project | No | Project slug or ID for baseline mode. When set with page_name, diffs against the stored baseline. | |
| page_name | No | Page name within the project (e.g. "homepage", "pricing"). Required for baseline mode. | |
| branch | No | Branch name for baseline lookup. Defaults to the project's default branch. | |
| threshold | No | Pixel sensitivity 0.0-1.0. Lower = more sensitive. Default 0.1 | |
| ignore_selectors | No | CSS selectors to exclude from comparison (e.g. timestamps, ads) | |
| full_page | No | Compare full scrollable pages. Default false |