diff_component
Render two versions of a UI component, compare them pixel by pixel, and get a diff image with the percentage of changed pixels to catch visual regressions during refactoring.
Instructions
Visual regression test: render before/after code and return a pixel diff image with percentage changed. Use this during refactoring to catch unintended visual changes.
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": {
"before": "<before>",
"after": "<after>"
},
"name": "diff_component"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| before | Yes | Component code BEFORE the change | |
| after | Yes | Component code AFTER the change | |
| framework | No | Framework: html, react, vue, or svelte | react |
| width | No | Viewport width (px) | |
| height | No | Viewport height (px) |