Skip to main content
Glama

diagram_contrast

Read-onlyIdempotent

Diagram quality QA. Catch and fix the things that ruin diagrams: (1) unreadable label contrast - POST a mermaid/SVG or HTML diagram, get every WCAG-AA failure (incl. mermaid -block label colors, with unresolvable fills flagged honestly, not false-passed) + auto-corrected colors; (2) harden a mermaid SOURCE before it renders - rewrites every fill/label pair and remaps fills no label color can rescue, which scanning cannot do because a per-node style line overrides the theme block; (3) HTML-looks-fine-but-prints-broken - checks for the print-color-adjust/page-break gotchas and returns the fix CSS; (4) arrows crossing objects - returns the ELK-renderer config + layout rules that minimize crossings. Pure deterministic - no AI, no rate limit.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "diagram_contrast"
  }
}

Input Schema

NameRequiredDescriptionDefault
bgNocontrast/readable: background/fill hex (#rrggbb).
fgNocontrast: foreground hex (#rrggbb).
modeNoDefault "scan". scan=check rendered output; harden=fix a mermaid source before rendering; print=print-safety check; layout=arrow-crossing reduction.
brandNobrand palette to use (e.g. appstango). Default from config.
largeNocontrast/harden: use the 3:1 large-text threshold.
formatNoscan: content format (default svg).
sourceNoharden: the mermaid SOURCE text (not rendered SVG).
autofixNoscan: include suggested corrected colors.
contentNoscan/print: the SVG or HTML diagram/document source.
add_initNoharden: prepend the %%{init}%% theme block (default true).
rendererNolayout: mermaid renderer (default "elk").

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), so the description's job is to add context, and it does: 'pure deterministic - no AI, no rate limit' and 'unresolvable fills flagged honestly, not false-passed.' The return shape is described only loosely ('get every WCAG-AA failure ... + auto-corrected colors', 'returns the fix CSS', 'returns the ELK-renderer config'), with no output schema to fall back on.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

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

It is a single front-loaded block with a useful numbered structure, and the harden-vs-scan rationale earns its space. But parenthetical asides such as 'flagged honestly, not false-passed' and the embedded justification clause add rhetorical weight rather than operational information, making it denser than needed for eleven mostly optional parameters.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 11-parameter, zero-required, mode-dispatching tool with no output schema, the description covers most modes but never mentions the 'palette' mode, the contrast/readable modes' use of bg/fg, or the brand and large-threshold options. An agent can pick a mode but has to read the schema to know which parameters each mode requires.

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 mode, bg/fg, source, and renderer is already documented in the schema; the description merely reinforces a few of them (harden takes source not rendered SVG). It adds no meaning for bg/fg or for the unmentioned palette mode beyond what the schema states, so the baseline 3 applies.

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 opening 'Diagram quality QA' plus four numbered capabilities gives a concrete verb+resource: contrast scanning, mermaid source hardening, print CSS checking, and arrow-crossing layout. It clearly separates itself from siblings like convert_diagram and describe_diagram. It loses a point because the prose capabilities don't map cleanly onto the seven-value mode enum (palette and the contrast/readable split are never named in prose).

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?

Each capability carries its own trigger condition: 'post a mermaid/SVG or HTML diagram' for scanning, 'harden a mermaid SOURCE before it renders' for pre-render fixing, 'HTML-looks-fine-but-prints-broken' for print checking. The scan-vs-harden distinction is explicitly justified ('scanning cannot do because a per-node style line overrides the theme block'). No explicit exclusions or named alternatives among siblings, which keeps it at 4.

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.