Skip to main content
Glama

check_contrast

Check WCAG 2.1 contrast ratio between two hex colors to determine if it meets AA thresholds (4.5:1 normal, 3:1 large text/non-text).

Instructions

Check the WCAG 2.1 contrast ratio between two hex colors and whether it clears the AA thresholds (4.5:1 for normal text, 3:1 for large text or non-text).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
backgroundYes
foregroundYes
Behavior3/5

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

Without annotations, the description must disclose behavior. It states the tool computes the ratio and checks thresholds, which is the core action. However, it does not specify the return format (e.g., does it return a boolean, the ratio, or a pass/fail object?) or any error handling for invalid hex inputs. This is a gap given the lack of annotations.

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 a single, well-structured sentence that front-loads the purpose with the verb 'Check' and efficiently includes the key thresholds. It is concise with no unnecessary words, earning a perfect score.

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?

The tool is simple (two parameters, no output schema), but the description does not fully explain what the tool returns. Since there is no output schema, the description should clarify the return value, which it only implies by saying 'whether it clears'—it doesn't explicitly state the output format or any additional information like the ratio itself. Some context is provided (WCAG 2.1, AA thresholds), but completeness suffers from missing return details.

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 schema has 0% description coverage, so the description must compensate. It adds that the parameters are hex colors and mentions the AA thresholds, which provides context beyond the parameter names. However, it does not detail the exact format (e.g., with or without '#') or clarify which parameter is foreground vs. background beyond the names themselves. This is some added meaning but not comprehensive.

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 checks WCAG 2.1 contrast ratio between two hex colors and evaluates against AA thresholds. The verb 'Check' and specific resource (contrast ratio) make the purpose unambiguous, and it is distinct from sibling tools like generate_sitemap or solve_palette.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites (e.g., having hex colors), when not to use it, or mention any related tools. This leaves the agent to infer usage context from the tool name alone.

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/Polymathie-Studio/ds4ai-mcp'

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