Skip to main content
Glama

Set the page viewport

browser_set_viewport
Destructive

Set or clear a persistent BiDi viewport override to control page dimensions and screenshot resolution, then read back the result.

Instructions

Set (or clear) the BiDi viewport override and read back the result. The override PERSISTS across sessions and changes screenshot resolution (screenshots are physical pixels: viewport x devicePixelRatio), so clearing it matters. Measured: clearing works by sending viewport=null and OMITTING devicePixelRatio; sending null for both times out, so this tool never does that.

Input Schema

NameRequiredDescriptionDefault
clearNoRemove the override (sent as viewport=null with devicePixelRatio omitted)
widthNoViewport width in CSS pixels
heightNoViewport height in CSS pixels
contextNoTab context id (default: the active tab)
devicePixelRatioNoDevice pixel ratio override

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

Goes well beyond the annotations: discloses that the override PERSISTS across sessions, that it changes screenshot resolution (viewport × devicePixelRatio), and a measured quirk that null/null times out. That is genuinely useful operational context for a destructive-flagged tool. It still doesn't say what the read-back returns or which contexts are affected when 'context' is 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?

Three tight sentences, front-loaded with the action and its persistence consequence; every sentence carries information. Milder deduction for the denseness of the final measured-behavior sentence, which mixes two separate facts (clearing mechanics and the timeout) in a slightly compressed way.

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 5-param, no-required, no-output-schema mutation tool, the description covers persistence, side effects on screenshots, and clearing mechanics — enough to call it correctly. The remaining gap is that 'read back the result' is never specified, so an agent doesn't know what state it receives to confirm success.

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 100%, so the baseline is 3. The description adds a little meaning by explaining that clearing is sent as viewport=null with devicePixelRatio omitted, but the schema's own 'clear' description already states this, so most of the added value is duplication rather than new semantics.

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+resource ('Set (or clear) the BiDi viewport override') and the read-back side effect. However, it does not distinguish itself from plausible siblings such as browser_set_window_size, browser_responsive_mode, or browser_screen_info, which an agent could easily confuse with viewport control.

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?

It implies usage by stressing that 'clearing it matters' and warning about the null/null timeout, which is a real invocation rule. But it gives no explicit when-to-use guidance versus window-size or responsive-mode tools, and no statement of preconditions (e.g., per-context scope, tab must exist).

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