visualdiff
v0.1.0SnapDiff visual diffs: verify UI changes, compare pages, screenshots, HTML to image.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
snapdiff_verify_ui_change
Verify a UI change matches the stated intent. Returns a verdict (pass, expected_change_detected, unexpected_regression, no_change_detected, or needs_human_review), a next_action, and a review_url. Requires a SnapDiff project and a stored page baseline.
| Parameter | Type | Description |
|---|---|---|
after * | string | URL of the page after the change. |
intent * | string | Description of the intended UI change. |
page_name * | string | Name of the page with a stored baseline. |
project * | string | SnapDiff project slug. |
branch | string | Branch name for the comparison. |
full_page | boolean | Whether to capture the full page instead of the viewport. |
ignore_selectors | array | CSS selectors for elements to ignore in the comparison. |
intent_regions | array | Regions where the intended change is expected. |
match_tolerance_percent | number | Match tolerance as a percentage. |
threshold | number | Visual difference threshold. |
snapdiff_compare_pages
Visually compare two web pages and return a diff percentage plus a highlighted diff image. Pass a before and an after URL for an ad-hoc diff, or an after URL with a project and page_name to diff against the stored project baseline.
| Parameter | Type | Description |
|---|---|---|
after * | string | URL of the page after the change. |
before | string | URL of the page before the change. |
branch | string | Branch name for the comparison. |
full_page | boolean | Whether to capture the full page instead of the viewport. |
ignore_selectors | array | CSS selectors for elements to ignore in the comparison. |
page_name | string | Name of the page with a stored baseline. |
project | string | SnapDiff project slug. |
threshold | number | Visual difference threshold. |
snapdiff_capture_screenshot
Take a screenshot of a web page, to inspect its current layout, verify rendering, or capture a baseline for later comparison.
| Parameter | Type | Description |
|---|---|---|
url * | string | URL of the page to capture. |
dark_mode | boolean | Whether to capture the page in dark mode. |
full_page | boolean | Whether to capture the full page instead of the viewport. |
selector | string | CSS selector for the element to capture. |
width | number | Viewport width in pixels. |
snapdiff_html_to_image
Render HTML/CSS directly to an image, for social cards, OG images, email headers, or any visual built from code without a hosted URL.
| Parameter | Type | Description |
|---|---|---|
html * | string | HTML markup to render. |
css | string | CSS styles to apply to the HTML. |
height | number | Image height in pixels. |
width | number | Image width in pixels. |