Skip to main content
Glama

suggest_contrast_fix

Read-only

Given failing WCAG color pairs, computes the smallest foreground or background adjustment to meet AA or AAA contrast ratios. Provides concrete passing values instead of manual trial.

Instructions

Given failing WCAG color pairs, return the MINIMAL color change that clears the target ratio. For each {fg,bg} pair, computes the smallest foreground adjustment (and an alternative background adjustment) that reaches AA/AAA — with the achieved ratio and direction. Feeds directly from audit_contrast's failing pairs: pass them here to get concrete passing values instead of brute-forcing colors by hand. Pure offline math.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
levelNoWCAG level when targetRatio is not given per-pair. Default AA.
pairsNoColor pairs to remediate. Each: { selector?, fg, bg, fontPx?, bold?, targetRatio? }. fontPx/bold pick the large-text threshold; targetRatio overrides the level.
Behavior5/5

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

The description adds significant behavioral context beyond the annotations: it is 'pure offline math', non-destructive, and guarantees minimal changes. It also explains the output includes both foreground and alternative background adjustments with achieved ratio. Annotations already mark readOnlyHint=true, confirming safety.

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 concise, front-loading the main action in the first sentence, and further details in subsequent sentences. No unnecessary words. It is well-structured and easy to scan.

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?

Given the tool has no output schema, the description explains the return format (minimal change, achieved ratio, direction) adequately. It could be more explicit about the exact structure (e.g., whether it returns an array of objects), but the context from sibling audit_contrast likely provides enough guidance.

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?

Schema coverage is 100% with descriptions for all parameters. The description adds minimal extra meaning—it explains that level defaults to AA and that pairs come from audit_contrast output. This meets the baseline for high schema coverage.

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's purpose: given failing WCAG color pairs, it returns the minimal color change to achieve a target contrast ratio. It distinguishes from brute-forcing by hand and explicitly mentions it feeds from audit_contrast, making its role specific.

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 tells when to use the tool: after running audit_contrast on failing pairs, to get concrete passing values. It contrasts with manual brute-forcing. However, it does not explicitly exclude cases where pairs are not failing or when other tools might be more appropriate.

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/rhinocap/raven-mcp'

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