set_viewport
Resize a session's viewport to a device preset or custom width/height, then screenshot. Persists for later actions to test responsive layouts within the same session.
Instructions
Resize a session's viewport to a device preset or custom width/height, then screenshot. Returns the new size and screenshot. Persists for later actions in the session — use this to test responsive layouts inside an ongoing session (unlike test_responsive, which opens throwaway pages).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| width | No | Viewport width in pixels (custom size) | |
| device | No | Device preset: mobile_sm (320x568 iPhone SE), mobile (375x812 iPhone 12), mobile_lg (428x926 iPhone 14 Pro Max), tablet (768x1024 iPad), tablet_lg (1024x1366 iPad Pro), laptop (1366x768), desktop (1920x1080), desktop_lg (2560x1440) | |
| height | No | Viewport height in pixels (custom size) | |
| observe | No | What to return about the resulting page. 'screenshot' (default): full-page image. 'none': structured result only, no image — cheapest, use through setup steps of a flow. 'map': semantic page map (get_page_map — token-light, best for 'what can I do next?'). 'checks': run_checks_on_session output (a11y/seo/perf/etc.). | screenshot |
| session_id | Yes | Session ID |