Skip to main content
Glama

veil_set_viewport

Set the browser viewport size and device pixel ratio to emulate mobile or desktop screens, ensuring consistent screenshot dimensions.

Instructions

Set the viewport size (and optional deviceScaleFactor / mobile emulation) — the page sees this as window.innerWidth/Height, screen size, and devicePixelRatio. Emulate a phone or force a fixed desktop size for reproducible screenshots.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
widthYes
heightYes
mobileNomobile emulation (default false)
deviceScaleFactorNodevice pixel ratio (default 1)
Behavior4/5

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

With no annotations provided, the description carries the full burden. It explains that the tool affects window.innerWidth/Height, screen size, and devicePixelRatio, and mentions optional parameters. This gives the agent a good understanding of what changes will occur, exceeding a simple 'set viewport' statement.

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 long, front-loaded with the primary function, and includes a practical use case. Every sentence adds value without redundancy.

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?

Given no output schema and no annotations, the description covers the tool's effect on the page, the parameters, and use cases. It could mention that mobile emulation might affect touch events or device orientation, but overall it is thorough enough for an agent to invoke correctly.

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?

The description adds meaning beyond the schema: it explains that width/height affect the page's view of innerWidth/Height and screen size. For optional parameters, the schema already provides descriptions, but the description clarifies their role in the context of viewport emulation. Required parameters (width, height) are not described in the schema but their purpose is made clear.

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's action: 'Set the viewport size (and optional deviceScaleFactor / mobile emulation).' It also explains the effect on the page ('window.innerWidth/Height, screen size, and devicePixelRatio'). This distinguishes it from sibling tools like veil_set_user_agent or navigation tools.

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 description provides usage context: 'Emulate a phone or force a fixed desktop size for reproducible screenshots.' This indicates when to use the tool. However, it does not explicitly state when not to use it or compare with alternatives, but the context is clear.

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/acunningham-ship-it/veilbrowser'

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