Skip to main content
Glama

check_contrast

Check WCAG contrast ratio between two colors to ensure text readability against accent backgrounds. Pass foreground and background hex or rgb values to guard against unreadable combinations.

Instructions

Check the WCAG contrast ratio between two colours before shipping a theme.

Guards against unreadable text-on-accent: pass two colours -- as hex (#d97706) or rgb()/rgba() -- such as a button's text vs. its accent background, or body text vs. the page background. Use it on the palette and accent from extract_brand when picking text colours.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
backgroundYesThe colour behind it (hex or ``rgb()``).
foregroundYesThe text/foreground colour (hex or ``rgb()``).

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

No annotations are provided, but the description implies a read-only check without side effects. It does not explicitly state whether it's idempotent or non-destructive, but the nature of the tool (calculating a ratio) makes it clear. A higher score would require explicit mention of safety or permissions.

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 extremely concise (two sentences) yet packed with information. The first sentence states the core purpose, and the second provides usage guidance and examples. No wasted words.

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?

Given the tool's simplicity (2 parameters, clear purpose) and the existence of an output schema (not provided but noted), the description is complete. It tells the agent what the tool does, when to use it, and what inputs to provide, without needing to explain return values.

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?

The description adds meaning beyond the schema by specifying accepted color formats (hex with example, rgb()/rgba()) and giving real-world context (foreground as text, background as accent). This helps the agent understand parameter roles and valid inputs beyond the schema's minimal descriptions.

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 ('Check') and resource ('WCAG contrast ratio'), and explicitly states the context ('before shipping a theme'). It clearly distinguishes from sibling tools like extract_brand or restyle_theme by focusing on contrast validation.

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

Usage Guidelines5/5

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

The description gives explicit when-to-use guidance: 'Guards against unreadable text-on-accent' and provides concrete examples (button text vs background, body text vs page background). It also advises to use it in conjunction with extract_brand, offering a clear workflow.

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/stemcreations/ghost-mcp'

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