Skip to main content
Glama

Verificar contraste de cores

check_color_contrast
Read-onlyIdempotent

Calculates WCAG contrast ratio between two colors and reports whether it passes AA/AAA for normal text, large text, and non-text components.

Instructions

Calcula a razão de contraste WCAG entre duas cores e diz se passa AA/AAA para texto normal, texto grande e componentes não textuais (1.4.3, 1.4.6, 1.4.11).

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_color_contrast"
  }
}

Input Schema

NameRequiredDescriptionDefault
boldNoTexto em negrito (peso >= 700)
backgroundYesCor de fundo
fontSizePxNoTamanho da fonte em CSS px (opcional, para decidir texto grande)
foregroundYesCor do texto/ícone: #rrggbb, #rgb ou rgb(r,g,b)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare this as a read-only, idempotent, closed-world, non-destructive computation, so the safety profile needs no elaboration. The description adds value by naming the three verdict categories and the WCAG criteria they map to, which is real behavioral context beyond the annotations, but it stops short of describing the return shape or how the tool treats missing optional inputs like fontSizePx.

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?

A single sentence that front-loads the core computation and then enumerates the outputs and the standards invoked. No filler, no redundant restatement of the title.

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 no output schema, the description responsibly names what comes back: a ratio and pass/fail results for three conformance categories. What is missing is only the response format and how the optional bold/fontSizePx parameters alter the large-text verdict, which keeps it from being fully complete for a pure-computation tool.

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 the four parameters and the accepted color formats are already documented in the schema. The description adds the framing that results are broken out by text size and component type, but does not explain that bold/fontSizePx drive the large-text determination, which would have been meaningful added guidance.

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 and resource ('Calcula a razão de contraste WCAG entre duas cores') plus the concrete verdicts it returns (AA/AAA for normal text, large text, non-text components). This clearly separates it from the sibling reference tools like get_wcag_criterion and search_wcag, which look up guidance rather than compute a ratio.

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 phrasing implies the tool is a calculator to be used when a contrast ratio or pass/fail verdict is needed, and the cited criteria (1.4.3, 1.4.6, 1.4.11) anchor its scope. However, there is no explicit statement of when to prefer it over get_wcag_criterion or get_accessibility_checklist, and no exclusions or prerequisites are given.

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