Skip to main content
Glama

analyze_contrast

Read-onlyIdempotent

Check WCAG contrast between two hex colors and determine pass or fail for normal and large text sizes. Use foreground, background, font size, and weight inputs.

Instructions

Calculate WCAG contrast for two opaque hex colors and normal/large text thresholds.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fontPxNo
weightNo
backgroundYes
foregroundYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description adds one genuinely useful behavioral constraint — inputs must be opaque hex colors (no alpha) — and hints that output is evaluated against text thresholds, but it says nothing about return format, rounding, or which WCAG levels are applied.

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?

A single front-loaded sentence with no filler; the verb and resource lead. It is arguably too terse for a 4-parameter tool, but nothing in it is wasted.

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?

With no output schema, the description should convey what comes back and how thresholds are interpreted. It gestures at 'normal/large text thresholds' but omits the WCAG level(s) (AA vs AAA) and the shape of the result, so it is adequate rather than complete for a simple but result-oriented calculator.

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 description coverage is 0%, so the description must carry the burden, and it only partially does. It explains the two color inputs ('two opaque hex colors') but does not clarify fontPx or weight, nor how they map onto the 'normal/large text thresholds' it mentions, leaving two of four parameters unexplained.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb and resource: 'Calculate WCAG contrast' for two hex colors, which is clearly distinguishable from siblings like check_accessibility_markup or check_motion_accessibility. It also states the scope (two opaque hex colors, normal/large text thresholds), though it does not explicitly name an alternative tool.

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

Usage Guidelines3/5

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

Usage is only implied: the mention of 'normal/large text thresholds' signals an accessibility-contrast check, but there is no explicit when-to-use, when-not-to-use, or pointer to sibling tools such as check_accessibility_markup. An agent can infer the context but receives no routing guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.