Skip to main content
Glama

x402 Toolbox

Colour conversion (hex, RGB, HSL) and WCAG contrast ratio between two colours

color
Read-onlyIdempotent

Colour conversion (hex, RGB, HSL) and WCAG contrast ratio between two colours. Parses hex, rgb(), hsl() or CSS names and returns hex, RGB, HSL and relative luminance. With a second colour, returns the WCAG 2.x contrast ratio and AA / AAA pass/fail for normal and large text. Price: $0.003 USDC per call via x402 (eip155:8453).

Input Schema

NameRequiredDescriptionDefault
colorYes
againstNoOptional second colour for a contrast check

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, so the safety profile is covered. The description adds substantive context beyond that: it lists the parsing inputs, the exact returned fields (hex, RGB, HSL, relative luminance, contrast ratio, AA/AAA verdicts), and — unusually and valuable — the per-call price and payment rail (x402, $0.003 USDC on eip155:8453), which an agent must know before invoking a paid endpoint.

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?

Three sentences, front-loaded with the core capability, then the return shape, then the conditional contrast mode, then pricing. Nothing is redundant and no sentence merely restates the title.

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?

Only two simple non-nested parameters and no output schema, so the description carries the return-value burden and does so completely: it enumerates the returned fields and the conditional WCAG verdicts. Combined with annotations, an agent has everything needed to call it correctly and understand the cost.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is only 50% (`color` has no schema description), so the description must compensate — and it does, explicitly naming the accepted formats (hex, rgb(), hsl(), CSS names) that `color` parses. The optional `against` semantics are covered both by the schema field description and by the 'second colour' clause in the description.

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 set and resource: colour conversion across hex/RGB/HSL plus a WCAG contrast computation. It enumerates the accepted input syntaxes and the returned fields, which immediately distinguishes it from any other sibling (currency_convert, unit_convert operate on different domains).

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

Usage Guidelines4/5

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

The description gives clear conditional usage: 'With a second colour, returns the WCAG 2.x contrast ratio and AA / AAA pass/fail', which tells the agent exactly when to supply the optional `against` parameter rather than the single-colour conversion mode. It does not name a when-not case or sibling alternative, but none of the other 50+ siblings overlap this domain.

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.