Proximity and alignment check
check_proximity_alignmentFind layout slips that read as mistakes. Pass boxes (array or JSON string of {x, y, w, h, label}, 2 to 400 boxes) or html plus optional css. For markup, geometry comes from data-x, data-y, data-w, data-h attributes or from left, top, width and height in px (inline style, or simple .class, #id and tag rules in css); elements without all four are skipped and counted. Nothing is rendered, so this reads declared numbers only. Reports (1) near-misses: left, right, top, bottom or center lines of two boxes that differ by more than 0.01px and no more than tolerance (default 6px), with both values and the difference; (2) inconsistent gaps between three or more siblings that share a row or column, listing every gap and the most common one; (3) orphans, boxes that line up with nothing and sit more than twice the median nearest-neighbor distance away. Sources: Müller-Brockmann, Grid Systems in Graphic Design (alignment to a shared structure); Lupton, Thinking with Type (alignment and grouping); Wroblewski, Web Form Design (labels close to their fields). The tolerance and orphan thresholds are conventions. Pure arithmetic, nothing stored.
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": "check_proximity_alignment"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| css | No | CSS for the markup (simple class, id and tag selectors). | |
| html | No | Markup with positioned elements (alternative to boxes). | |
| boxes | No | Boxes as {x, y, w, h, label}. A JSON string is also accepted. | |
| tolerance | No | Near-miss window in px (default 6, max 50). |