Skip to main content
Glama

set_viewport

Resize a session's viewport to a device preset or custom width/height, then screenshot. Persists for later actions to test responsive layouts within the same session.

Instructions

Resize a session's viewport to a device preset or custom width/height, then screenshot. Returns the new size and screenshot. Persists for later actions in the session — use this to test responsive layouts inside an ongoing session (unlike test_responsive, which opens throwaway pages).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
widthNoViewport width in pixels (custom size)
deviceNoDevice preset: mobile_sm (320x568 iPhone SE), mobile (375x812 iPhone 12), mobile_lg (428x926 iPhone 14 Pro Max), tablet (768x1024 iPad), tablet_lg (1024x1366 iPad Pro), laptop (1366x768), desktop (1920x1080), desktop_lg (2560x1440)
heightNoViewport height in pixels (custom size)
observeNoWhat to return about the resulting page. 'screenshot' (default): full-page image. 'none': structured result only, no image — cheapest, use through setup steps of a flow. 'map': semantic page map (get_page_map — token-light, best for 'what can I do next?'). 'checks': run_checks_on_session output (a11y/seo/perf/etc.).screenshot
session_idYesSession ID
Behavior4/5

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

No annotations provided, so the description carries the full burden. It discloses that the resize persists for later actions and returns the new size and screenshot. It lacks details on potential side effects (e.g., invalid parameters), but is otherwise transparent.

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 two sentences with zero waste. The first sentence states the core action and outcome, the second provides usage context and sibling differentiation. Every sentence is essential.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema, the description explains the return (new size, screenshot). It also covers persistence. With 5 parameters, it provides enough context for an agent to use the tool effectively.

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%, baseline 3. The description adds value by explaining device presets with dimensions and elaborating on the observe parameter options (screenshot, none, map, checks), which goes beyond the schema's enum description.

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?

The description clearly states the tool resizes a viewport and takes a screenshot. It distinguishes itself from sibling tool 'test_responsive' by noting that this resizes an ongoing session while the sibling opens throwaway pages.

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

Usage Guidelines5/5

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

The description explicitly says to use this to test responsive layouts inside an ongoing session and contrasts it with test_responsive, which opens throwaway pages, providing clear when-to-use and alternative.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/segentic-lab/periscope-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server