Skip to main content
Glama

IA-QA — 152 QA & Dev Tools for AI Agents

check_contrast_ratio

Read-onlyIdempotent

Calculate WCAG 2.1 contrast ratio between two colors. Returns ratio and compliance for AA/AAA normal and large text.

Input Schema

NameRequiredDescriptionDefault
backgroundYesBackground color in hex (e.g., "#ffffff")
foregroundYesForeground color in hex (e.g., "#333333")

Output Schema

NameRequiredDescriptionDefault
ratioNo
AA_largeNo
AAA_largeNo
AA_normalNo
AAA_normalNo
backgroundNo
foregroundNo
ratio_textNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "background": "#fff",
      +    "foreground": "#000"
      +  }
      +]
  2. Changed1 schema field changed
    • addedOutput schema / properties
      Added value: +{
      +  "AAA_large": {
      +    "type": "boolean"
      +  },
      +  "AAA_normal": {
      +    "type": "boolean"
      +  },
      +  "AA_large": {
      +    "type": "boolean"
      +  },
      +  "AA_normal": {
      +    "type": "boolean"
      +  },
      +  "background": {
      +    "type": "object"
      +  },
      +  "foreground": {
      +    "type": "object"
      +  },
      +  "ratio": {},
      +  "ratio_text": {
      +    "type": "string"
      +  }
      +}
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "type": "object"
      +}
  4. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/closed-world, so the safety profile is covered. The description adds real value beyond that by stating the return payload (ratio plus AA/AAA compliance for normal and large text), which tells the agent what to expect from a pure computation.

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?

Two sentences, zero filler: the operation first, the return value second. Nothing is repeated from the schema and nothing needs to be trimmed.

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?

For a deterministic two-parameter calculator with a full schema and an output schema, this is essentially complete — input format and output content are both known. Only minor gaps remain (e.g., shorthand hex acceptance, invalid-input behavior), which do not block correct invocation.

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% and both parameters already document hex format with examples. The description mentions 'two colors' but adds no format, ordering, or edge-case detail beyond the schema, so baseline 3 applies.

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?

Specific verb and resource: 'Calculate WCAG 2.1 contrast ratio between two colors.' The WCAG framing distinguishes it cleanly from the neighboring color_convert tool, and it also names what comes back.

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 implied by the WCAG framing (accessibility check), but the description never states when to prefer this over color_convert or other color utilities, and gives no exclusions or prerequisites.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.