Skip to main content
Glama
aimsise

color-engine

by aimsise

gamut_map

Read-onlyIdempotent

Convert any CSS color to a displayable sRGB value by reducing OKLCH chroma, returning the nearest in-gamut hex with a flag for out-of-gamut inputs.

Instructions

Map any CSS color string into the sRGB gamut via perceptual OKLCH chroma reduction. Returns the nearest in-gamut hex, raw OKLCH components, and a clamped flag indicating whether the input was out-of-gamut.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYesAny CSS color string, e.g. "#ff0000", "oklch(0.6 0.4 30)" (max 256 chars)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
hexYesLowercase #rrggbb of the gamut-mapped (in-sRGB) color
oklchYesRaw (pre-rounding) OKLCH components of the mapped result
clampedYestrue when input was out-of-sRGB-gamut and was mapped
Behavior4/5

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

Annotations already signal read-only, idempotent, non-destructive behavior. The description adds meaningful behavioral context beyond these hints by explaining the transformation method (OKLCH chroma reduction), the return format (nearest hex, raw OKLCH, clamped flag), and what the clamped flag indicates. No contradictions with 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?

Two sentences, front-loaded with the action word 'Map', and no filler. Each sentence provides essential information: the operation and the output details. This is an exemplar of concise, structured documentation.

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?

The tool is simple with a single parameter and an output schema. The description fully covers the purpose, algorithm, and key output flag, making it self-sufficient for an agent to select and invoke the tool correctly without further clarifications.

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?

The input schema already provides 100% coverage for the only parameter, including a description and example. The tool description does not add additional semantic meaning about the parameter beyond what the schema states, so the baseline of 3 is appropriate.

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?

The description uses a specific verb ('Map') and clearly identifies the resource ('any CSS color string') and the target ('the sRGB gamut'). It also distinguishes itself from sibling tools by naming the algorithm ('perceptual OKLCH chroma reduction') and the unique output components (hex, OKLCH, clamped flag).

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 implies when to use the tool: whenever a CSS color string needs to be mapped to the sRGB gamut. However, it does not explicitly mention when not to use it or suggest alternatives like convert_color or parse_color, leaving the usage context somewhat implicit.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aimsise/color-engine-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server