Skip to main content
Glama

Set Viewport

set_viewport

Set a page's viewport width and height to test layouts at specific screen sizes or reproduce responsive display issues.

Instructions

Set viewport dimensions for a page.

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
widthYes
heightYes
pageIdNoPage id. Defaults to the active page.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.6/5.0
Behavior2/5

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

With no annotations, the description carries the entire behavioral burden and discloses almost nothing: it does not say whether the change persists for the page lifetime, whether it emulates a device, whether it needs a launched browser/active page, or what happens on invalid sizes. Only the phrase 'for a page' hints at scope.

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

Conciseness3/5

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

A single front-loaded sentence with zero filler, which is structurally clean. However, it is concise to the point of under-specification, so the brevity costs more than it saves.

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 state-changing browser tool with no annotations, no output schema, and only one third of parameters documented needs far more than six words: prerequisites, units, and effect on rendering output are all missing.

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 coverage is 33% — only pageId is described — so width and height lack any semantic explanation in structured form. The description says 'dimensions' but never states units (CSS pixels vs device pixels), whether both must be set, or how pageId resolution to 'active page' behaves.

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 dimensions' — so an agent immediately knows this sizes the rendering surface. It does not distinguish itself from any sibling, but no sibling name suggests a competing viewport operation, so the ambiguity cost is low.

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

Usage Guidelines2/5

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

There is no guidance on when to call this: whether it must precede screenshot/pdf/snapshot to affect output, whether it applies per-page or globally, or what to do when no browser is open. The agent must infer all usage context from the name alone.

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