Skip to main content
Glama

Set Viewport

set_viewport

Change viewport dimensions mid-session and enable mobile emulation with touch events and user agent to test responsive layouts, breakpoints, and mobile UI.

Instructions

Change viewport size mid-session. mobile=True triggers touch events + UA. For mobile UI / breakpoint reveal.

Ex: set_viewport('t0', 375, 667, mobile=True) → {"width":375,"height":667}

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": {
      "tab_id": "<tab_id>",
      "width": "<width>",
      "height": "<height>"
    },
    "name": "set_viewport"
  }
}

Input Schema

NameRequiredDescriptionDefault
widthYes
heightYes
mobileNo
tab_idYes
device_scale_factorNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations provided, the description carries the full behavioral burden. It usefully discloses that mobile=True triggers touch events and a user-agent change, but it omits persistence, permissions, side effects, and the role of device_scale_factor.

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?

The description is short, front-loaded, and every sentence contributes: purpose, mobile behavior, use case, and a concrete example. There is no wasted wording.

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?

An output schema exists, so return-value detail is not required. Still, for a five-parameter mutation tool with 0% schema description coverage and no annotations, the description leaves too much unexplained, especially device_scale_factor, tab_id meaning, and viewport-change side effects.

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 description coverage is 0%, so the description must explain all five parameters. It clarifies mobile and demonstrates tab_id, width, and height in the example, but device_scale_factor is completely undocumented and tab_id semantics remain implicit.

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?

The description states a specific verb and resource: 'Change viewport size mid-session.' It also adds mobile-specific behavior, but it does not explicitly distinguish the tool from any sibling or clarify its place in the larger browser-control workflow.

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 phrase 'For mobile UI / breakpoint reveal' gives a clear usage context, and the example shows typical invocation. However, it does not state when not to use it or name alternatives such as screenshot sizing or device emulation workflows.

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