Skip to main content
Glama

validate_theme_contrast

Ensure your designs meet WCAG accessibility standards by validating color contrast ratios. Enter foreground and background hex colors to determine if the contrast passes and get improvement recommendations.

Instructions

Validate color contrast ratio for WCAG compliance.

Use this tool to check if your color combinations meet accessibility standards before using them in designs.

Args: foreground: Foreground (text) color in hex format (e.g., "#000000") background: Background color in hex format (e.g., "#FFFFFF") wcag_level: Target WCAG level - "AA" or "AAA" text_size: Text size category - "normal" or "large" (large = 18pt+ or 14pt+ bold)

Returns: Dict containing: - passes: Boolean indicating if contrast meets requirements - ratio: Calculated contrast ratio (e.g., 7.5) - required_ratio: Minimum required ratio for the level/size - message: Human-readable result message - recommendations: Suggestions if contrast fails

Example: validate_theme_contrast( foreground="#FFFFFF", background="#3B82F6", # blue-500 wcag_level="AA" )

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
text_sizeNonormal
backgroundYes
foregroundYes
wcag_levelNoAA
Behavior5/5

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

With no annotations, the description fully conveys behavior: it returns a dict with passes, ratio, required_ratio, message, and recommendations. It also specifies hex format requirement.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is structured with Args and Returns sections and includes an example, but it is slightly long. Still, every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite no output schema, the description details the return dictionary. The example further clarifies usage. Everything needed for a validation tool is present.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description compensates fully by explaining each parameter: foreground/background hex format, wcag_level options, and text_size with size definitions.

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 it validates color contrast ratio for WCAG compliance. This distinguishes it from sibling tools which are design or project management related.

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 explains to use this tool before using color combinations in designs. It provides good context but does not explicitly mention when not to use or alternatives.

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/archolet/claude-gemini-bridge'

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