Skip to main content
Glama

set_device_emulation

Emulate Apple device viewports, pixel ratios, and touch support in Safari DevTools using presets or custom values.

Instructions

Emulate an Apple device by resizing the viewport and overriding device pixel ratio and touch support at the JS level. The user agent is overridden via navigator.userAgent (JS-level only — HTTP request headers are not affected). Choose a preset (iPhone SE, iPhone 14, iPhone 15 Pro, iPhone 16 Pro Max, iPad Mini, iPad Air, iPad Pro 11, iPad Pro 13) or provide custom values. Use reset_device_emulation to restore defaults.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
widthNoViewport width in CSS pixels.
deviceNoApple device preset name. Overrides width/height/dpr/userAgent if provided.
heightNoViewport height in CSS pixels.
userAgentNoCustom user agent string (JS-level override only; HTTP headers unchanged).
devicePixelRatioNoDevice pixel ratio (e.g. 2 for Retina).
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 discloses that user agent override is JS-level only (not affecting HTTP headers), and that touch support is overridden. However, it does not mention whether the emulation persists across navigations or affects only the current tab, which would add further transparency.

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, front-loaded with the core purpose, followed by a list of presets and a pointer to the reset sibling. Every sentence is essential and no extraneous information is included.

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 tool with 5 parameters, no output schema, and moderate complexity, the description covers purpose, usage, and behavioral traits adequately. It even provides a way to undo. Lacking is explicit mention of whether the emulation resets on navigation or is page-specific, but overall it is sufficient for agent selection.

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 description coverage is 100% for all 5 parameters. The description adds value by explaining that the 'device' preset overrides width/height/dpr/userAgent, and clarifies that userAgent is a JS-level override. This goes beyond the schema's property descriptions.

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 verb 'emulate' and the specific resource 'Apple device' by resizing viewport, overriding device pixel ratio and touch support at JS level. It lists available presets and mentions the sibling tool reset_device_emulation for restoration, distinguishing its purpose.

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 explicit guidance on how to use the tool: choose a preset or provide custom values, and it mentions reset_device_emulation to restore defaults. While it does not explicitly state when not to use it, the context is clear for its intended purpose.

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/HayoDev/safari-devtools-mcp'

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