Skip to main content
Glama
Colors MCP Server

Colors MCP Server

by HtetOoWaiYan

Smallest overlay for legible text on an image

colors_scrim
Read-onlyIdempotent

Finds the smallest overlay opacity that makes text reach a target contrast ratio on every worst-case region of a photo, returning the opacity and per-region ratios.

Instructions

Text over a photo: find the smallest overlay (scrim) opacity at which the text reaches a contrast ratio on every worst-case region of the image. Painted like CSS, on 8-bit channels. Returns the opacity and the ratio on each region.

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": {
      "text": "<text>",
      "overlay": "<overlay>",
      "regions": "<regions>"
    },
    "name": "colors_scrim"
  }
}

Input Schema

NameRequiredDescriptionDefault
stepNoOpacity grid, for example 0.05. Default 0.05.
textYesText color that sits on the image. Any CSS color: "#3b82f6", "rgb(59 130 246)", "oklch(0.62 0.19 260)", "tomato".
targetNoContrast ratio the text must reach on every region. Default 4.5.
overlayYesOverlay (scrim) color, usually black, white or a brand color. Any CSS color: "#3b82f6", "rgb(59 130 246)", "oklch(0.62 0.19 260)", "tomato".
regionsYesColors of the busiest or worst-case parts of the image behind the text. A list, even for a single color. Any CSS color strings.

Output Schema

NameRequiredDescriptionDefault
foundYes
ratiosNo
opacityNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv2.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover read-only, idempotent, non-destructive and closed-world, so the bar is lower, and the description adds real context beyond them: blending is 'painted like CSS, on 8-bit channels', which signals quantized results, and it declares the return payload (opacity plus per-region ratio). It omits the important edge case of what happens when the target ratio is unreachable even at full opacity, which keeps it from a 5.

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: the task and optimization goal first, the rendering model second, the return shape last. No filler, no restatement of the title, and the most decision-relevant information is front-loaded.

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?

With a full input schema and an output schema, the description only needs to frame the task and any non-obvious behavior, which it does. The one meaningful gap is the failure/fallback behavior when no opacity in the grid reaches the target ratio, which an agent would want to know before calling.

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 description coverage is 100%, so every parameter including step, target and regions is already documented in detail, making 3 the baseline. The description reinforces that regions represent worst-case areas and that the search walks an opacity grid, but adds no format or constraint detail the schema lacks.

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: find the smallest scrim opacity that makes text hit a contrast ratio across worst-case regions. That is clearly distinct from the auditing siblings (colors_check, colors_audit), since this is an optimization search rather than a measurement. It stops short of naming a sibling to contrast against, so it lands at 4 rather than 5.

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 opening 'Text over a photo' implies the scenario, and 'on every worst-case region' implies you must supply region colors. However, there is no explicit when-to-use versus colors_check or colors_fix, and no statement of when this tool is unnecessary (e.g., solid backgrounds). Usage is inferable but not guided.

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