Skip to main content
Glama

check_contrast

算两个颜色之间的 WCAG 对比度,并同时给出正文级(4.5 / 7)与大字级(3 / 4.5)两套判定。适合在把配色写进代码前先验一遍。

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": {
      "foreground": "<foreground>",
      "background": "<background>"
    },
    "name": "check_contrast"
  }
}

Input Schema

NameRequiredDescriptionDefault
backgroundYes背景色,如 #ffffff
foregroundYes前景色(通常是文字),如 #111827

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4/5.0
Behavior4/5

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

With no annotations and no output schema, the description carries the disclosure burden well: it states that the tool computes the WCAG ratio and returns two sets of judgments with specific thresholds (4.5/7 and 3/4.5). It does not detail invalid-color behavior or return formatting, but it gives the core behavioral output an agent needs.

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?

The description is two tight sentences, front-loads the main purpose, and then adds the relevant threshold detail and usage context. Every sentence earns its place.

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 simple two-parameter calculation tool with no annotations or output schema, the description supplies enough context: purpose, output judgments, thresholds, and intended usage. It is nearly complete, though it could say more about return shape or edge cases such as 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 both parameters are already documented with types and examples in the schema. The description mentions 'two colors' but adds no extra semantics about foreground/background usage beyond what the schema provides, so baseline 3 is appropriate.

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 names a specific verb and resource: computing WCAG contrast between two colors, and it adds that it returns body-text and large-text pass/fail judgments. It is clear enough to distinguish this as a verification tool, but it does not explicitly contrast itself with sibling tools such as suggest_text_color.

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?

It gives a clear usage context: suitable for checking a color pairing before writing the palette into code. It does not state when not to use it or name a specific alternative tool, so it falls short of full routing guidance.

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.