Skip to main content
Glama

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
widthNo
deviceNopreset: "mobile" = 390x844 dpr3 phone (+mobile UA), "desktop" = 1280x800. Overridden by explicit width/height.
heightNo
mobileNoemulate a mobile device (default false)
hasTouchNoemulate touch input (default false; mouse clicks won't drive touch-only games)
sessionIdNo
deviceScaleFactorNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the behavioral burden, and it does disclose useful traits: the operation affects an existing session without relaunching, and hasTouch defaults to false so mouse clicks can drive the game. This gives the agent meaningful insight into side effects and input behavior, though it does not fully detail all page-state implications.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and front-loaded: it states the core purpose first, then gives relevant parameter guidance. Every clause earns its place, with no filler or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

While the main game-viewport use case is well covered, the tool has 7 parameters and no output schema or annotations. The description does not explain how to provide sessionId, when to use device presets versus explicit dimensions, or what deviceScaleFactor controls, leaving some invocation choices underspecified.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is only 43%, and the description adds value for width/height via the concrete 390x844 example and explains hasTouch behavior. However, sessionId and deviceScaleFactor are left unexplained, so the description only partially compensates for the low schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly identifies the operation: resizing an existing session's viewport, and explicitly states it does so without relaunching. This distinguishes it from launch-oriented and navigation-oriented sibling tools like browser_launch and page_goto.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It provides practical guidance for the main use case: use portrait dimensions for canvas/WebGL games so click coordinates land correctly, and keep hasTouch:false unless the game specifically needs touch input. It could be stronger by naming alternative tools or explicit when-not-to-use conditions, but the guidance is clear and actionable.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.