Skip to main content
Glama
Color Theory MCP Server

Color Theory MCP Server

calculate-luminance

Compute the relative luminance of a color to assess contrast and support accessibility decisions.

Instructions

Calculate the relative luminance of a color

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": {
      "color": "<color>"
    },
    "name": "calculate-luminance"
  }
}

Input Schema

NameRequiredDescriptionDefault
colorYesColor to calculate luminance for

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full burden of behavioral disclosure. It does not say whether this is a pure deterministic computation, what color formats are accepted (hex, named, rgb string), or what the return value looks like (a 0-1 relative luminance per WCAG). For a computation tool with zero annotation coverage, that leaves meaningful gaps.

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 or redundancy. It is appropriately sized, though the available brevity could have been spent on accepted input formats rather than left unused.

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 one-parameter, no-output-schema tool this is close to adequate, but the two things an agent actually needs—accepted color string formats and the numeric range/definition of the result—are absent. It is minimally viable rather than 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 coverage is 100%, so the single parameter is documented in the schema, and the rule sets a baseline of 3. However, the schema's own text ('Color to calculate luminance for') is tautological, and the description adds no format or validation detail, so nothing meaningful is gained beyond the structured field.

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 states a specific verb and resource ('Calculate the relative luminance of a color'), which is precise enough to distinguish it from siblings like calculate-contrast or calculate-delta-e by the quantity computed. It does not explicitly contrast itself with those siblings, though 'relative luminance' is a distinct enough term to avoid confusion.

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

Usage Guidelines2/5

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

There is no guidance on when to use this versus calculate-contrast, calculate-apca-contrast, or calculate-delta-e, which are the obvious adjacent tools. The agent must infer that luminance is the building-block metric rather than a contrast or difference calculation.

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