Skip to main content
Glama
Browser MCP Server

Browser MCP Server

set_viewport

Set the browser viewport width and height in pixels to test responsive layouts. Define exact dimensions for consistent page rendering and responsive testing.

Instructions

Set viewport size. Useful for responsive testing.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "width": "<width>",
      "height": "<height>"
    },
    "name": "set_viewport"
  }
}

Input Schema

NameRequiredDescriptionDefault
widthYesViewport width in pixels
heightYesViewport height in pixels
pageIdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.0.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description carries the full burden and discloses very little: it does not say whether the change applies to the current page only, whether it persists across navigations, whether it resets device emulation, or whether it requires an attached browser. The only behavioral hint is the vague 'responsive testing' phrase.

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 with the action front-loaded and no padding. The second sentence is thin but not wasteful; nothing is buried or repetitive.

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?

A browser-state mutation tool with zero annotations, no output schema, and an undocumented pageId parameter leaves important gaps. An agent cannot tell the scope of the change or what the tool returns, which matters for a stateful browser session.

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?

The schema documents width and height at 67% coverage, but pageId has no description anywhere and the description adds no meaning to any parameter. It does not clarify units beyond the schema, nor what pageId targets or defaults to.

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 ('Set viewport size') that an agent can act on immediately. It does not differentiate from nearby siblings such as emulate_device, which also affects viewport/device metrics, 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?

'Useful for responsive testing' implies a context but gives no explicit when-to-use rule, no when-not, and no named alternative. An agent must infer that emulate_device is the choice for full device emulation rather than a bare size change.

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