Skip to main content
Glama
Pagewright (browser-mcp)

Pagewright (browser-mcp)

by zamansheikh

browser_set_viewport

Emulate screen sizes to test responsive layouts with presets or custom dimensions; reset to restore the real browser window.

Instructions

Emulate a screen size to test responsive layouts: preset "mobile" (390x844), "mobile-small" (360x640), "tablet" (820x1180), "laptop" (1366x768), "desktop" (1440x900), "desktop-hd" (1920x1080), or custom width/height. reset:true restores the real window.

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": "browser_set_viewport"
  }
}

Input Schema

NameRequiredDescriptionDefault
resetNo
tabIdNoTab to act on. Defaults to the tab last opened/selected by an agent, else the active tab.
widthNo
heightNo
mobileNo
presetNo
deviceScaleFactorNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose real behavior: exact preset dimensions and the fact that reset restores the actual window. It does not say whether the emulated viewport survives navigation or reloads, whether it affects screenshots, or what precedence applies when preset and width/height are both supplied. Useful but incomplete for a state-mutating tool.

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?

Front-loaded with the action and purpose, then the preset catalog, then the reset escape hatch. Two sentences with no filler. The preset list is dense but earns its space since the enum values alone don't convey pixel sizes.

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

Completeness4/5

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

For a 7-parameter emulation tool with no annotations and no output schema, the definition covers the primary path (presets) and the inverse path (reset) well. The remaining gap is the secondary parameters and precedence rules, which is meaningful but narrower than the coverage the presets receive.

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 14% (only tabId is documented), so the description must compensate. It adds real value by spelling out the five preset dimensions and reset semantics, but leaves mobile, width/height, and deviceScaleFactor undefined, including the critical question of how preset interacts with explicit width/height.

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?

States a specific verb and resource: 'Emulate a screen size to test responsive layouts', and immediately enumerates the preset names with their pixel dimensions. The purpose is unmistakable and distinct from siblings like browser_audit_layout or browser_screenshot. It stops short of naming an alternative tool, but the verb+resource pairing is unambiguous.

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 phrase 'to test responsive layouts' implies the use case, and 'reset:true restores the real window' signals how to undo the emulation. However, there is no guidance on when to prefer this over browser_audit_layout, or on whether the viewport persists across navigations, so usage must be inferred.

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