set_viewport
Reproduce mobile or tablet layout issues by changing the viewport size on the connected tab. Then re-inspect to see which CSS rules apply.
Instructions
Emulate a viewport size (and optional deviceScaleFactor) on the connected tab, then re-inspect. Use for responsive bugs — 'it breaks on mobile', 'the menu is wrong at tablet width', anything behind a media query — since resizing can change which @media rule wins. Follow with a fresh page_snapshot / explain_styles at the new size.
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": {
"width": "<width>",
"height": "<height>"
},
"name": "set_viewport"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| width | Yes | Viewport width in CSS px | |
| height | Yes | Viewport height in CSS px | |
| deviceScaleFactor | No | Default 1 |