Skip to main content
Glama

WCAG contrast ratio

bursia_contrast_ratio
Read-onlyIdempotent

WCAG contrast ratio between two hex colors, with AA/AAA pass flags. Pure computation, free.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "foreground": "<foreground>",
      "background": "<background>"
    },
    "name": "bursia_contrast_ratio"
  }
}

Input Schema

NameRequiredDescriptionDefault
backgroundYesBackground color in hex, e.g. #070b16.
foregroundYesText color in hex, e.g. #ffffff.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedInput schema / properties / background / description
      Added value: +"Background color in hex, e.g. #070b16."
    • addedInput schema / properties / foreground / description
      Added value: +"Text color in hex, e.g. #ffffff."
  2. 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, non-destructive, closed-world behavior, so the bar is low. The description adds real value beyond that by confirming it is 'pure computation' (no network, no side effects) and 'free' (no cost or quota), which annotations do not convey.

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?

A single tight sentence, front-loaded with the core operation and followed by the returned flags and the cost note. Every clause carries information and nothing is padded.

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?

With no output schema, the description usefully discloses that the response includes AA/AAA pass flags alongside the ratio. It stops short of specifying the numeric ratio's format or required input validation, but for a simple two-parameter pure function it is nearly complete.

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 100% and both parameters are documented as hex colors with examples. The description only restates 'two hex colors' and adds no format or validation detail beyond what the schema already provides, 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?

States a specific verb and resource: it computes the WCAG contrast ratio between two hex colors and reports AA/AAA pass flags. This is inherently distinct from the nearest sibling, bursia_color_convert, since it measures a compliance ratio rather than converting formats.

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 rather than stated: an agent can infer this is the tool for accessibility checks on a text/background pair, and 'free' hints at a cost advantage over paid alternatives. However, there is no explicit when-to-use, when-not-to-use, or named alternative.

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.

Resources