Skip to main content
Glama
PaletteCraft MCP

PaletteCraft MCP

Check and adjust a text color

check_contrast
Read-onlyIdempotent

Calculate WCAG 2 contrast between two opaque sRGB hex colors and suggest a foreground shade that meets a required 3:1, 4.5:1, or 7:1 threshold when possible.

Instructions

Calculate WCAG 2 contrast for two opaque sRGB hex colors and suggest a foreground shade at the requested minimum if possible.

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": "check_contrast"
  }
}

Input Schema

NameRequiredDescriptionDefault
thresholdNo
backgroundYes
foregroundYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/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 safety profile is covered. The description usefully adds that only opaque sRGB hex is supported and that a suggested shade is only produced 'if possible', hinting at failure cases, but it never says what is returned (ratio, pass/fail, suggested hex) or how ties are resolved.

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 front-loaded sentence carrying the computation, the input constraints, and the adjustment behavior with no filler. Nothing in it could be removed without losing signal.

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?

For a three-parameter tool with no output schema, the description should say what comes back — a numeric ratio, a pass/fail, and the suggested shade — and it does not. Input-side semantics are reasonably covered, so the omission of return-value shape is the main completeness gap.

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?

With schema description coverage at 0%, the description does some compensating work: 'two opaque sRGB hex colors' constrains foreground/background beyond the regex, and 'requested minimum' points at the threshold parameter. However, it never explains that the enum values 3, 4.5, and 7 correspond to WCAG large-text/AA/AAA minimums, nor what the default 4.5 means.

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?

States a specific verb pair (calculate contrast, suggest a foreground shade) and the exact inputs (two opaque sRGB hex colors), so the agent knows precisely what the tool computes. It does not reference the sibling generate_palette, so differentiation relies on the agent inferring from the name, which keeps it from a 5.

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 — you call it when you have a foreground/background pair and want WCAG contrast checked or a shade suggested at a given minimum. There is no explicit when-to-use statement, no mention of when to prefer generate_palette, and no note on prerequisites or limits.

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

Deploy Server

Other Tools