Skip to main content
Glama

emulate_media

Idempotent

Override browser media features and user agent to simulate different environments, such as dark mode, reduced motion, or print rendering, for testing adaptive styles.

Instructions

Make the page believe it runs elsewhere, until reset or reload: prefers-color-scheme, prefers-reduced-motion, print mode, navigator.userAgent/platform. user_agent changes only what page JS reads — the request header is network_rules modify_header. Pair with viewport_resize to emulate a device.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
resetNoRemove all emulations
tab_idNoTarget tab; omitted = last tab navigated in this session, else the active one
printModeNoMake print media queries match, without opening a print dialog
user_agentNoOverrides navigator.userAgent and appVersion in the page (not the HTTP header)
colorSchemeNoValue reported to prefers-color-scheme queries
reducedMotionNoValue reported to prefers-reduced-motion queries

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.10.0
    • addedInput schema / properties / colorScheme / description
      Added value: +"Value reported to prefers-color-scheme queries"
    • addedInput schema / properties / printMode / description
      Added value: +"Make print media queries match, without opening a print dialog"
    • addedInput schema / properties / reducedMotion / description
      Added value: +"Value reported to prefers-reduced-motion queries"
    • addedInput schema / properties / tab_id / description
      Added value: +"Target tab; omitted = last tab navigated in this session, else the active one"
  2. Changed1 schema field changedv1.9.0
    • addedInput schema / properties / user_agent
      Added value: +{
      +  "description": "Overrides navigator.userAgent and appVersion in the page (not the HTTP header)",
      +  "type": "string"
      +}
  3. First observedv1.8.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already indicate idempotent and non-destructive behavior; the description adds valuable behavioral details such as the temporary nature of emulation, the reset parameter, and the fact that user_agent does not affect the HTTP header. No contradictions with annotations were found.

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, well-structured, and avoids unnecessary detail. It packs essential information into a few sentences and clearly separates the tool's purpose, scope, and parameter behavior.

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?

The description is complete for the tool's apparent simple use case: it explains scope, reset behavior, and parameter semantics, and notes how it fits with viewport_resize. Since there is no output schema and the tool likely returns no meaningful data, the absence of return-value details is acceptable.

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 schema covers all six parameters with descriptions and enums, and the description reinforces important nuances such as user_agent not being the HTTP header and reset removing all emulations. This adds meaningful context beyond the structured 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?

The description clearly states the tool's purpose: making the page believe it is in a different environment for media queries and user agent. It also distinguishes it from related tools by explicitly noting that user_agent changes only what page JS reads, not the HTTP header, and by recommending pairing with viewport_resize.

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 practical usage guidance, including the reset option, the scope until reset/reload, and the relationship to viewport_resize for device emulation. It does not explicitly say 'use this when...' but the context and parameter details make the intended use clear.

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