Skip to main content
Glama

ui_set_viewport

ui_set_viewport

Resize the current page viewport to test phone, tablet, or desktop layouts; recheck page state afterward to capture responsive layout changes.

Instructions

Resize the current page's viewport (320-3840 x 320-2160 CSS pixels), e.g. 375x812 for a phone or 768x1024 for a tablet. Layouts can change when the page is resized, so call ui_get_page_state again afterwards.

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": "ui_set_viewport"
  }
}

Input Schema

NameRequiredDescriptionDefault
widthYesWidth in CSS pixels
heightYesHeight in CSS pixels
session_idNoWhich open session to act on, as returned by ui_start_session. Optional with one open session; required when several are open.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does disclose the key side effect: resizing can change layout, so cached page state becomes stale. It does not mention session requirements or whether the change is reversible, but the central behavioral risk is covered.

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 sentences, zero waste. The action and range come first, the follow-up requirement second — correctly front-loaded.

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?

There is no output schema, and the description compensates by pointing at ui_get_page_state as the way to observe the result. The only gap is that it says nothing about session handling, which the schema documents instead.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/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 earns extra by mapping concrete values to device classes (phone/tablet) and restating the bounds in a readable form, which helps an agent pick sensible dimensions rather than guessing.

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 ('Resize the current page's viewport') with the valid range inline and concrete device examples (375x812 phone, 768x1024 tablet). No sibling tool does viewport resizing, so an agent can identify it immediately.

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 examples imply the responsive-testing context and it explicitly tells the agent what to do after the call ('call ui_get_page_state again'). It does not state any when-not-to-use condition or prerequisite, so it stops short of full routing guidance.

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