Explain why an element renders the way it does
visual_inspectExplains why a selected element renders incorrectly by returning computed styles, box metrics, ancestor colour chain, and matching CSS rules with source origins for debugging.
Instructions
The companion to visual_audit: audit answers WHAT looked wrong, this answers WHY. Returns the computed styles, the box metrics, the ancestor colour chain, and every CSS rule that matches the selector with its origin (file:line in the project). It does not resolve which rule wins — specificity, order and !important are left for you to judge from the evidence.
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": {
"url": "<url>",
"selector": "<selector>"
},
"name": "visual_inspect"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Absolute URL, path relative to baseUrl, or local HTML file path. | |
| engine | No | Engine to inspect in. Chromium returns file:line for every rule via CDP; webkit/firefox return selectors and declarations from the CSSOM, without line numbers. | |
| selector | Yes | CSS selector. Reuse the selector reported by a finding. | |
| viewport | No | Viewport to render at. Default 1440x900; match the finding's viewport for a responsive bug. | |
| properties | No | Computed properties to include. Defaults to a curated layout/colour set. |