Skip to main content
Glama

Convert color

convert
Read-onlyIdempotent

Translate colors between any of 221 color spaces from CSS strings or channel values, including batch input and out-of-range channel flags.

Instructions

Convert a color between any two of the 221 color spaces, identity included, in each space's conventional ranges (rgb 0-255, oklch L 0-1 / C 0-0.4 / H 0-360, lab L 0-100 …). The color goes in as a CSS string (color) or as channel values (from + values); a batch as colors – tuples in from, CSS strings, or both. Out-of-range in, unclamped out: inRange flags each channel against the target's conventional range (rgb below 0 means outside sRGB); null = undefined at that coordinate.

Input Schema

NameRequiredDescriptionDefault
toYestarget space id, e.g. 'rgb', 'oklch', 'lab', 'slog3', 'rec709' (the 'spaces' tool lists all 221)
fromNosource space id, e.g. 'rgb', 'oklch', 'lab', 'slog3', 'rec709' (the 'spaces' tool lists all 221)
colorNoa CSS color instead of `from` + `values`: '#ff8000', 'rebeccapurple', 'oklch(0.7 0.1 50)', 'lab(54% 80 67)', 'color(display-p3 1 0.5 0)'
colorsNoa batch: one tuple (in `from`) or CSS string per color, e.g. [[255, 128, 0], '#00ff80', 'oklch(0.7 0.1 50)']
valuesNoone color in the source space, e.g. [255, 128, 0] for rgb

Output Schema

NameRequiredDescriptionDefault
toYes
fromNo
colorsYes
channelsYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv3.5.0
    • changedInput schema / properties / from / description
      Previous value: -"source space id, e.g. 'rgb', 'oklch', 'lab', 'slog3', 'rec709' (the 'spaces' tool lists all 205)"New value: +"source space id, e.g. 'rgb', 'oklch', 'lab', 'slog3', 'rec709' (the 'spaces' tool lists all 221)"
    • changedInput schema / properties / to / description
      Previous value: -"target space id, e.g. 'rgb', 'oklch', 'lab', 'slog3', 'rec709' (the 'spaces' tool lists all 205)"New value: +"target space id, e.g. 'rgb', 'oklch', 'lab', 'slog3', 'rec709' (the 'spaces' tool lists all 221)"
  2. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, non-open-world, so the safety profile is covered. The description adds genuinely new behavior: conversion is unclamped ('out-of-range in, unclamped out'), `inRange` flags each channel against the target's conventional range, and null means undefined at that coordinate. That is meaningful output-semantics disclosure 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Dense but front-loaded: the conversion scope and range convention come first, then the input forms, then out-of-range behavior. Every clause earns its place, though the parenthetical range list and ellipsis make it slightly harder to scan than it could be.

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?

With an output schema present, the description need not explain return shape, and it correctly spends its budget on the things the schema cannot convey: conventional ranges per space, unclamped behavior, `inRange` semantics, and null-as-undefined. Nothing an agent needs to call this conversion correctly is missing.

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 100%, so the baseline is 3, but the description goes further by explaining the conventional ranges each space uses (rgb 0-255, oklch L 0-1/C 0-0.4/H 0-360, lab L 0-100), what `color` vs `from`+`values` vs `colors` are for, and that batch entries can mix tuples and CSS strings. It adds real semantic meaning over the schema text.

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 (convert) and resource (a color), and bounds the scope precisely: 'between any two of the 221 color spaces, identity included.' The mention of conventional per-space ranges and the CSS/array input forms makes it distinguishable from siblings like 'spaces' (enumeration), 'css' (parsing), and 'gamut' (checking).

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?

The description explains the input modes (CSS string vs `from`+`values` vs batch `colors`), which implies how to call it, but never states when this tool is preferred over siblings such as `gamut`, `css`, or `space`. No exclusions or alternative-routing guidance is given; usage is inferred rather than stated.

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