Skip to main content
Glama
vola-trebla

playwright-spatial-layout-mcp

by vola-trebla

calculate_perceptual_contrast

Checks text color contrast against background using WCAG 2.x and APCA to confirm accessibility and real readability.

Instructions

Measures color contrast between a text element and its background using both WCAG 2.x and APCA (WCAG 3.0 draft) formulas simultaneously. Use to answer: does this text pass accessibility contrast requirements? Is it actually readable even if it technically passes the legacy formula?

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL of the page to analyze
viewportNoViewport size (default: 1280×720)
text_selectorYesCSS selector for the text element
background_selectorYesCSS selector for the background element
Behavior4/5

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

With no annotations provided, the description carries the burden of behavioral disclosure. It does a good job by stating that both WCAG 2.x and APCA formulas are evaluated simultaneously and that the tool is intended to expose cases where legacy WCAG is misleading. It does not mention side effects like network page loads or dependence on rendered CSS, but for a read-only analysis tool this is a meaningful, honest behavioral description.

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 sentences and front-loads the core action ('Measures color contrast...') followed by concrete user questions. Every phrase earns its place; there is no fluff or repetition of schema content.

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 largely complete: it explains what the tool measures, why the dual-formula approach matters, and the kinds of questions it answers. The schema provides thorough parameter documentation, including nested viewport fields. However, there is no output schema and the description does not mention what the return value looks like, so an agent is left to infer the exact response shape.

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?

The input schema already covers 100% of parameters with descriptions, so the baseline is 3. The description adds no extra parameter-level detail beyond the schema; it merely restates that text and background selectors are involved. It does not clarify how viewport size might influence contrast measurement or how selectors are resolved.

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 ('Measures') and names the exact resource ('color contrast between a text element and its background'), making it unmistakably distinct from the sibling layout/visual tools. It also names the two formulas (WCAG 2.x and APCA), which is concrete and differentiates the tool's scope.

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 clear, crisp use cases: 'does this text pass accessibility contrast requirements?' and 'Is it actually readable even if it technically passes the legacy formula?' These give strong context for when the tool should be used. However, it does not explicitly say when not to use it or name alternative sibling tools for similar measurement tasks.

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/vola-trebla/playwright-spatial-layout-mcp'

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