page_set_viewport
Resize the browser viewport of an active session to match your target device, ensuring correct rendering and interaction for responsive or mobile-first testing.
Instructions
Resize an existing session's viewport without relaunching. Use a portrait size (e.g. {width:390,height:844}) for canvas/WebGL games so the game fills the screen and page_click_at coordinates land on it. Keep hasTouch:false (default) so mouse clicks drive the game; set hasTouch:true only for games that require touch input.
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": "page_set_viewport"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| width | No | ||
| device | No | preset: "mobile" = 390x844 dpr3 phone (+mobile UA), "desktop" = 1280x800. Overridden by explicit width/height. | |
| height | No | ||
| mobile | No | emulate a mobile device (default false) | |
| hasTouch | No | emulate touch input (default false; mouse clicks won't drive touch-only games) | |
| sessionId | No | ||
| deviceScaleFactor | No |