Skip to main content
Glama

set_device

Switch browser device emulation between mobile and desktop modes using preset devices or custom viewport, user agent, and touch settings. Preserves cookies and returns page state.

Instructions

Switch browser device emulation between mobile and desktop modes. Recreates the browser context with new viewport, user agent, and touch settings. Cookies and localStorage are preserved. Use preset device names for convenience or provide custom parameters. Returns page_state showing the page as rendered in the new device mode. Cannot be used while sub-agents are running.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
deviceNoDevice preset name: 'iphone_15', 'iphone_se', 'iphone_15_pro_max', 'pixel_7', 'galaxy_s24', 'ipad_pro', 'ipad', 'galaxy_tab_s9', 'desktop', 'desktop_hd'. Use 'desktop' to reset to default mode. Cannot be combined with custom fields.
deviceScaleFactorNoDevice pixel ratio (e.g., 2 for retina, 3 for iPhone). Cannot be used with 'device'.
hasTouchNoEnable touch event support. Cannot be used with 'device'.
isMobileNoEnable mobile viewport behavior. Cannot be used with 'device'.
userAgentNoCustom user agent string. Cannot be used with 'device'.
viewportNoCustom viewport dimensions. Cannot be used with 'device'.
Behavior4/5

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

Discloses that cookies and localStorage are preserved, returns page_state, and cannot be used with sub-agents. No annotations provided, so description carries full burden; it does not contradict any annotations.

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?

Four sentences, front-loaded with main action, each sentence provides useful information 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?

Covers return value (page_state) and usage constraint (sub-agents). Lacks details about what happens if device is set while custom params are present, but schema already enforces exclusivity.

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 description coverage is 100%, so baseline is 3. The description adds context about using presets vs custom fields but does not significantly enhance understanding beyond the schema.

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?

Clearly states the tool switches browser device emulation between mobile and desktop modes, specifying it recreates the browser context with viewport, user agent, and touch settings. Distinct from any sibling tool.

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?

Provides guidance on using preset device names versus custom parameters, and explicitly states it cannot be used while sub-agents are running. However, no explicit alternative tool comparison is needed as no sibling does emulation.

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/Mingye-Lu/AgenticCrawler'

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