Skip to main content
Glama

browser_setViewport

Set the browser viewport width and height for responsive testing; reset the override to restore the default window size.

Instructions

Change the viewport size (width × height) for responsive testing. Defaults to 1280×720. Pass reset:true to clear the override.

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_setViewport"
  }
}

Input Schema

NameRequiredDescriptionDefault
resetNoClear the override and return to the window size
widthNoViewport width in pixels (default 1280)
heightNoViewport height in pixels (default 720)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv4.5.0
    • changedInput schema / properties / height / description
      Previous value: -"Viewport height in pixels (default: 720)"New value: +"Viewport height in pixels (default 720)"
    • addedInput schema / properties / reset
      Added value: +{
      +  "description": "Clear the override and return to the window size",
      +  "type": "boolean"
      +}
    • changedInput schema / properties / width / description
      Previous value: -"Viewport width in pixels (default: 1280)"New value: +"Viewport width in pixels (default 1280)"
    • removedInput schema / required
      Removed value: -[
      -  "width",
      -  "height"
      -]
  2. First observedv2.0.4

TDQS

A3.6/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 behavioral burden and does disclose useful traits: it is an override, defaults to 1280×720, and can be cleared via reset:true. It omits whether the override persists across navigations, whether it applies to the active tab only or all tabs, and whether a page must be loaded first.

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?

Two short sentences, front-loaded with the action and its purpose, then the reset escape hatch. Nothing is wasted and no sentence needs to be re-read.

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 simple three-optional-parameter setter with no output schema, the description covers purpose, defaults, and the reset path. The remaining gap — persistence scope across tabs/navigations — is minor but real for a browser state tool.

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 description coverage is 100%, so all three parameters (width, height, reset) are already documented in the schema, including defaults and bounds. The description restates the defaults and the reset usage rather than adding new meaning, so the baseline of 3 applies.

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 — 'Change the viewport size (width × height)' — and adds intent with 'for responsive testing', so an agent knows exactly what state the tool mutates. It does not explicitly differentiate from siblings (e.g., screenshot/snapshot tools that also care about viewport), so it stops short of a 5.

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?

Usage is implied by 'for responsive testing' and the reset hint, giving an agent enough to know when it applies. There is no explicit when-to-use/when-not guidance or comparison to alternatives such as taking a screenshot at a given size, and no mention of prerequisites like an open tab or session.

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