Skip to main content
Glama

Convert a color between hex, rgb, hsl and oklch

swatch_convert_color
Read-onlyIdempotent

Use when the user asks to convert a color between hex, RGB, HSL and OKLCH, or asks what a color is called or how light it is. Returns all formats, the relative luminance and the nearest CSS color name. Example: {"color": "#ff5a1f"}. Exact math, so prefer it to converting by hand.

Input Schema

NameRequiredDescriptionDefault
colorYesAny CSS color.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint and non-destructive, so the safety profile is covered. The description adds genuinely useful context — that all formats plus relative luminance and nearest CSS name come back, and that the math is exact. With no output schema, it could say more about the shape of the result, but it goes beyond the annotations.

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 short sentences: trigger, return contents, and a concrete example, all front-loaded with zero filler. Every clause contributes something an agent would use.

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?

For a one-parameter, read-only conversion tool with full schema coverage and no output schema, the description covers input, output contents and the exactness guarantee. Minor gap: it does not describe error behavior for malformed color strings.

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% and the single parameter is documented as "Any CSS color." The inline example {"color": "#ff5a1f"} illustrates an accepted input form, which is a small addition, but most of the meaning is carried by the schema, so the baseline 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?

Uses a specific verb (convert) on a specific resource (a color) and enumerates the formats involved, plus the extra outputs (name, luminance). An agent can distinguish it from siblings like swatch_check_contrast or swatch_make_scale without opening any schema.

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?

Opens with an explicit trigger ("Use when the user asks to convert a color...") and covers a second use case (what a color is called, how light it is). It also says to prefer it over manual conversion. It stops short of naming exclusions or pointing at sibling tools for contrast/scale tasks.

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