Skip to main content
Glama

Check palette contrast

check_palette_contrast
Read-onlyIdempotent

Use this when the user has a colour palette (2 to 12 colours) and wants to know which combinations are accessible: "check contrast of my color palette", "which of these colors can I use for text", "accessible color palette checker". Returns the full pairwise WCAG 2.x contrast matrix (ratios truncated, rounded down), which pairs pass AA/AAA for text or 3:1 for large text and UI, and a recommended text colour for each background (a palette colour that passes AA, otherwise black or white). Does not generate new colours; use generate_accessible_palette for a tonal scale and check_color_contrast for fixes to one pair.

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": {
      "colors": "<colors>"
    },
    "name": "check_palette_contrast"
  }
}

Input Schema

NameRequiredDescriptionDefault
namesNoOptional labels in the same order as colors, e.g. ["Primary", "Accent", "Surface", "Ink"].
colorsYes2 to 12 colours to test against each other, e.g. ["#1E6FD9", "#F59E0B", "#FFFFFF", "#111827"]. Hex, rgb(), hsl(), hwb(), lab(), lch(), oklab(), oklch(), color(display-p3 ...) or CSS names; translucent colours are composited over white.

Output Schema

NameRequiredDescriptionDefault
kindYes
colorsYes
matrixYes
requestYes
summaryYes
warningsYes
best_textYes
text_pairsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Adds real behavioural detail beyond the annotations: ratios are truncated/rounded down, thresholds covered are AA/AAA for text and 3:1 for large text and UI, and a fallback text colour (black or white) is chosen when no palette colour passes. The annotations already declare readOnly/idempotent/non-destructive, so the safety profile is covered and no contradiction exists; the only minor gap is that the response shape somewhat overlaps the output schema.

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?

Front-loaded with the trigger condition, then output, then exclusions — a good ordering. The three quoted example utterances are somewhat redundant with the preceding condition, but they are short and plausibly aid matching.

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?

For a read-only, two-parameter tool with an output schema, the description covers everything needed: trigger, scope, threshold semantics, rounding behaviour, fallback logic, and sibling routing. Return-value details are partly redundant with the output schema but do not leave anything an agent needs unresolved.

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 the schema already spells out the 2–12 range, supported colour formats, and the white compositing rule, so the description does not need to repeat it. The description only restates the palette size and adds no new meaning for the optional names parameter. Baseline 3 applies when the schema carries the parameter burden.

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 (check contrast of a colour palette), plus the exact input shape (2 to 12 colours) and the output artifact (full pairwise WCAG contrast matrix). It also explicitly excludes the two sibling concerns: generating colours (generate_accessible_palette) and fixing a single pair (check_color_contrast).

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?

Opens with a triggering condition (user has a palette and wants to know which combinations are accessible) and quotes realistic user phrasings. It closes with explicit when-not guidance naming both alternatives and the distinct job each one does, so an agent can route without guessing.

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