emulate
Applies device, network, geolocation, color scheme, and accessibility emulation settings to a target page in one call so you can test responsive behavior.
Instructions
Emulates various features on the target page. Each call replaces all emulation settings (except extraHttpHeaders), so pass all desired settings in a single call.
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": {
"pageId": "<pageId>"
},
"name": "emulate"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pageId | Yes | Targets a specific page by ID. | |
| viewport | No | Emulate device viewports '<width>x<height>x<devicePixelRatio>[,mobile][,touch][,landscape]'. 'touch' and 'mobile' to emulate mobile devices. 'landscape' to emulate landscape mode. Omit to clear the viewport override. | |
| userAgent | No | User agent to emulate. Omit or set to empty string to clear the user agent override. | |
| colorScheme | No | Emulate the dark or the light mode. Omit or set to "auto" to reset to the default. | |
| geolocation | No | Geolocation (`<latitude>,<longitude>`) to emulate. Latitude between -90 and 90. Longitude between -180 and 180. Omit to clear the geolocation override. | |
| forcedColors | No | Emulate the `forced-colors` CSS media feature. Omit or set to "auto" to reset to the default. | |
| prefersContrast | No | Emulate the `prefers-contrast` CSS media feature. Omit or set to "auto" to reset to the default. | |
| extraHttpHeaders | No | Extra HTTP headers as a JSON string object, e.g. {"X-Custom": "value", "Authorization": "Bearer token"}. Headers are included into every HTTP request originating from the page and persist across navigations until cleared. Pass an empty string to clear all extra headers. | |
| cpuThrottlingRate | No | Represents the CPU slowdown factor. Omit or set the rate to 1 to disable throttling | |
| networkConditions | No | Throttle network. Omit to disable throttling. | |
| prefersReducedMotion | No | Emulate the `prefers-reduced-motion` CSS media feature. Omit or set to "auto" to reset to the default. |