Skip to main content
Glama

playwright__browser_emulate_media

Destructive

Emulate CSS media features for the page, for example switch between the light and dark color scheme. Omitted parameters are left unchanged; null clears an override.

Instructions

Emulate CSS media features for the page, for example switch between the light and dark color scheme. Omitted parameters are left unchanged; null clears an override.

Input Schema

NameRequiredDescriptionDefault
mediaNoChanges the CSS media type of the page
contrastNoEmulates the prefers-contrast media feature
colorSchemeNoEmulates the prefers-color-scheme media feature
forcedColorsNoEmulates the forced-colors media feature
reducedMotionNoEmulates the prefers-reduced-motion media feature

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.4.1

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=true and openWorldHint=true, so the agent knows this mutates page state. The description usefully adds the state model ('omitted parameters are left unchanged; null clears an override'), but it never explains the scope/lifetime of the override (per page? per session?) or that emulation persists and affects later screenshots/snapshots.

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 sentences, zero filler, and the core purpose is front-loaded ahead of the override-semantics detail. Every clause carries information.

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?

With annotations covering safety and no output schema to explain, the definition is essentially complete for calling the tool. The only real gap is that an agent cannot tell how long the emulation persists or whether it must be reset, which matters for a stateful, destructive-hinted tool.

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 coverage is 100%, so per-parameter meaning (media, contrast, colorScheme, forcedColors, reducedMotion) is already documented in the schema, establishing the baseline of 3. The description adds non-obvious cross-parameter semantics — omission preserves current values while explicit null clears an override — which is genuinely useful information the schema does not convey.

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?

States a specific verb ('emulate') and resource ('CSS media features for the page') and grounds it with a concrete example (light/dark color scheme). This is clearly distinguishable from render-adjacent siblings like browser_resize, which changes viewport dimensions rather than media feature emulation.

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 example case ('switch between the light and dark color scheme') implies the testing scenario in which this tool is used, but there is no explicit when-to-use/when-not guidance and no named alternative. Nothing tells an agent when emulation is preferable to, say, resizing or evaluating CSS directly.

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