Skip to main content
Glama

Browser Set Viewport

browser_set_viewport

Use this to change an inspected Chromium tab viewport width, height and optional mobile scale for responsive testing. It changes browser emulation, not the host monitor resolution.

Input Schema

NameRequiredDescriptionDefault
titleNoChoose a page whose title contains this text.
widthYesCSS viewport width for set_viewport.
deviceYesReMCP device id returned by list_devices. Required for every device operation.
heightYesCSS viewport height for set_viewport.
mobileNoEnable mobile emulation for set_viewport.
endpointNoLoopback Chrome DevTools endpoint. Defaults to REMCP_CDP_URL or http://127.0.0.1:9222.
target_idNoPage target id returned by browser_tabs.
timeout_msNoTimeout in milliseconds.
url_containsNoChoose a page whose URL contains this text.
device_scale_factorNoDevice scale factor for set_viewport; default 1.

Output Schema

NameRequiredDescriptionDefault
dataNoBrowser element action structured result for browser_action. Stable fields are declared explicitly; platform-specific fields may be added. Large results may return truncated/bytes/preview instead of the full payload.
textYesConcise human-readable result of the tool call.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, idempotentHint=false, destructiveHint=false and openWorldHint=true. The description adds real value beyond them by bounding the blast radius — it mutates browser emulation state only, not the host display. It does not say whether the viewport persists across navigations or resets, which would be the next useful fact.

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 tight sentences with no filler, and the primary action is front-loaded before the clarifying scope note. Every clause earns its place.

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?

With an output schema present and full parameter documentation, the description only needs to convey purpose and scope, which it does. The one gap is device/target selection semantics — whether the viewport applies to the whole device session or a single tab — which the agent must infer from parameters.

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 every parameter (device, width, height, mobile, device_scale_factor, target_id, endpoint, timeout_ms) is already documented in the schema. The description only echoes the width/height/mobile fields, adding no format or constraint detail beyond the structured data. Baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('change an inspected Chromium tab viewport width, height and optional mobile scale') and scopes it by purpose ('for responsive testing'). The clause 'changes browser emulation, not the host monitor resolution' crisply separates it from display/window tools such as window_resize.

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

Usage Guidelines4/5

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

The use case is clear: responsive-testing viewport emulation on an inspected tab. It does not name an explicit alternative or when-not condition (e.g., use window_resize for the real window), so it stops short of a 5.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources