Skip to main content
Glama
sa2web

sa2web-mcp

by sa2web

browser_toggle_device

Toggle the current browser page between desktop and mobile device emulation instantly. Use Playwright device names or custom metrics to switch viewport size, touch, orientation, and user agent.

Instructions

Toggle the current browser page between desktop and mobile device emulation without recreating the browser context. Uses Playwright device descriptors and Chromium CDP for dynamic mobile metrics, touch, device scale factor, orientation, and user agent. On Firefox/WebKit only viewport resizing is available. Omit enabled to toggle the current state.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
widthNo
deviceNoPlaywright device name such as Pixel 7, iPhone 13, or iPad Mini. Desktop disables emulation.
heightNo
reloadNoReload after applying emulation so subsequent requests use the new user agent.
enabledNoEnable mobile emulation when true, restore desktop mode when false. Omit to toggle.
hasTouchNo
userAgentNo
orientationNo
deviceScaleFactorNo
Behavior4/5

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

With no annotations, the description provides good transparency by explaining that the tool preserves the browser context, uses Playwright device descriptors and CDP on Chromium, and has limited functionality (viewport only) on Firefox/WebKit.

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 concise with three front-loaded sentences, each providing essential information without redundancy.

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

Completeness3/5

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

While the description covers core functionality and limitations, it does not explain the interplay between parameters (e.g., when custom width/height override device presets) or the return value, leaving some gaps given the tool's complexity.

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 to many parameters not covered by the schema descriptions (e.g., device, hasTouch, orientation, userAgent, and the behavior of omitting 'enabled'), compensating for the low 33% schema description coverage.

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 action ('Toggle') and the resource ('device emulation'), differentiating it from sibling tools like browser_resize by emphasizing that it toggles between desktop and mobile without recreating the context.

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?

The description implies usage for switching emulation modes and notes browser-specific limitations, but does not explicitly state when to use this tool versus alternatives like browser_resize or browser_list_devices.

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/sa2web/sa2web-mcp'

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