Skip to main content
Glama

Emulate device metrics (size / DPR / mobile)

emulate_device

Override viewport size, device pixel ratio, and mobile mode for responsive testing while keeping coordinate math stable on scaled displays; clear the override per tab when done.

Instructions

Override viewport size, device pixel ratio, and mobile flag (CDP Emulation) for responsive testing — also stabilizes coordinate math on scaled displays. The override persists for the tab until reset:true (or its debugger detaches).

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": {
      "tabId": "<tabId>"
    },
    "name": "emulate_device"
  }
}

Input Schema

NameRequiredDescriptionDefault
resetNoClear the override
tabIdYesTarget tab ID (must be in the MCP group)
widthNoViewport width in px (1-10000)
heightNoViewport height in px (1-10000)
mobileNoMobile mode (default false)
deviceScaleFactorNoDevice pixel ratio (default 1)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.24.1

TDQS

A3.6/5.0
Behavior3/5

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

No annotations are supplied, so the description carries the full burden. It does disclose the most important behavioral trait — the override persists for the tab until reset:true or the debugger detaches. It adds nothing about whether the emulation affects other tools' reads, screenshots, or coordinate outputs, or about failure modes when the tab is outside the MCP group, which the schema only hints at.

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, front-loaded with the action and the three dimensions it controls, followed by the lifecycle rule. Dense with concrete detail and free of filler.

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?

For a six-parameter, unannotated state-mutating tool with no output schema, the description covers the essentials: what it overrides, why, and how the state ends. The remaining gap is how the persisted override interacts with other tools and siblings like resize_window, which an agent would likely need to reason about.

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 coverage is 100%, so all six parameters are already documented in the schema and the baseline applies. The description adds modest value by framing the three settable dimensions as a group and by clarifying that reset:true clears the whole override rather than one field, but it adds no units, defaults, or interaction rules beyond that.

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?

States a specific verb (override) and the exact resources affected (viewport size, device pixel ratio, mobile flag), plus the underlying mechanism (CDP Emulation). This is far beyond a restatement of the name. It stops short of explicitly contrasting with the sibling resize_window, so an agent must infer the emulation-vs-actual-window distinction.

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

Usage Guidelines3/5

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

Gives a use case (responsive testing) and a secondary motivation (stabilizing coordinate math on scaled displays), which is genuine when-to-use context. However, it offers no exclusions and never names resize_window or any sibling as the alternative for a different need, leaving the choice between similar tools to inference.

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