Skip to main content
Glama
microsoft

Playwright MCP Server

Official
by microsoft

browser_emulate_media

Destructive

Override CSS media features such as color scheme, contrast, reduced motion, forced colors, and media type to test page styles under different user preferences.

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

TableJSON 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.0.82

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already signal a non-read-only, potentially destructive operation. The description adds genuine behavioral nuance: omitted parameters are left unchanged, and null clears an override, which clarifies how state mutates and how to reset it. This adds value beyond the annotations without contradicting them.

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 tight sentences: the first states the tool's purpose with an example, and the second states the omission/null behavior. No filler is present, and the primary action is front-loaded.

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 five optional parameters and complete schema coverage, the description is largely sufficient. It lacks explicit details about persistence scope or how to clear all overrides at once, but the null-clears-override rule and the schema fill most practical gaps.

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 input schema already documents all five parameters thoroughly, so the baseline is 3. The description adds a cross-cutting semantic not present in the schema: omitted parameters remain unchanged while null clears an override. This distinction is essential for correct invocation.

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 uses a specific verb ('Emulate'), names the resource ('CSS media features for the page'), and includes a concrete light/dark example. This clearly distinguishes it from the sibling browser tools and tells an agent exactly what domain it operates on.

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 provides important invocation semantics: omitted parameters are left unchanged, and null clears an override. However, it does not explicitly state when to prefer this tool over alternatives, though the unique purpose among siblings makes the intended context largely inferable.

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