Skip to main content
Glama

page.set_viewport

Resize the emulated browser viewport to a set width, height, and scale, or enable mobile emulation for testing responsive layouts on a specific page or browser.

Instructions

Resize the emulated viewport. See device.preset for realistic device profiles.

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

NameRequiredDescriptionDefault
resetNo
widthNo
heightNo
mobileNo
target_idNoTarget handle (tgt_*). Omit for the active page.
browser_idNoBrowser handle (br_*). Omit to use the only running browser, or auto-launch one.
device_scale_factorNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior2/5

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

Annotations declare readOnlyHint=false and openWorldHint=true, so the mutating nature is already flagged, and the description adds only that the viewport is "emulated." It does not disclose side effects such as whether the resize reloads the page, invalidates layout state, overrides a device preset, or what happens when dimensions are omitted.

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

Conciseness4/5

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

Two short sentences, action front-loaded with the alternative reference second — nothing is wasted. It stays lean but is arguably too terse for a seven-parameter mutation tool.

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

Completeness2/5

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

For a seven-parameter, zero-required, mutation tool with low schema coverage and no output schema, the description leaves too much implicit. An agent could call it with a bare width/height but would have no basis for using reset, mobile, device_scale_factor, or the browser_id/target_id targeting semantics.

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

Parameters2/5

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

Schema description coverage is only 29%, so six of the seven parameters (width, height, mobile, device_scale_factor, reset) rest entirely on their names. The single sentence about device.preset hints that profiles supply realistic dimensions, but it never explains units, interaction between width/height and device_scale_factor, or what reset reverts.

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

Purpose4/5

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

The description opens with a concrete verb+resource, "Resize the emulated viewport," which tells an agent exactly what changes. It also cross-references device.preset for device profiles, which differentiates it from device.viewport at a high level, though it never explicitly contrasts the two.

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

Usage Guidelines3/5

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

The only guidance is the pointer "See device.preset for realistic device profiles," which implies an alternative for preset-based sizing but gives no explicit when-to-use/when-not conditions. Nothing tells the agent what to do with width/height alone versus mobile, or when to prefer reset.

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

Deploy Server

Other Tools