Skip to main content
Glama

Validate Design Craft & Contrast Compliance

ink_validate_design
Read-onlyIdempotent

Evaluate HTML and CSS for anti-AI-slop design, WCAG AAA contrast, and RTL/LTR compliance. Get a letter grade, score, and prioritized remediation advice to improve web layout quality before committing.

Instructions

PURPOSE: Evaluate HTML and CSS code against anti-AI-slop design heuristics (detecting generic AI purple gradients, hardcoded pixel font sizes, missing semantic tags), verify WCAG AAA color contrast ratios, and audit Arabic RTL/LTR logical properties.

BEHAVIOR: Executes in-memory static AST and regex analysis on the supplied code strings. Completely read-only with zero filesystem writes, no network requests, and deterministic score computation. Emits a letter grade (S, A, B, C, F), numerical score (0-100), and specific remediation diff advice.

USAGE GUIDELINES:

  • When to use: Call after creating or modifying web layouts, components, or stylesheets to verify craft quality, contrast compliance, and bidi readiness before committing.

  • When NOT to use: Do NOT use for JavaScript security vulnerability scanning (use ink_audit_security instead) or for capturing real-browser screenshots (use ink_capture_viewport instead).

  • Alternatives: Use ink_audit_security for security/XSS checks; use ink_capture_viewport for visual multi-viewport screenshot verification.

RETURNS: ResultEnvelope containing 'craftScore', 'craftGrade', 'isHighCraft' boolean, 'antiSlopChecks' results, computed 'contrast' analysis, 'bidiAndAlignment' report, and prioritized 'remediationAdvice'.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesHTML and CSS code string to evaluate for anti-slop rules, typography scaling, and alignment
checkBidiNoWhen true, audits CSS logical property compliance (e.g. flagging margin-left instead of margin-inline-start)
backgroundHexNoSurface background color in 6-digit hex (#RRGGBB) to verify contrast ratio against text#0b0f19
foregroundHexNoPrimary foreground text color in 6-digit hex (#RRGGBB) to verify against surface#f8fafc
checkCenteringNoWhen true, verifies optical centering balance and checks for horizontal overflow risks (e.g. 100vw, fixed large widths)

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataYesDomain-specific typed payload returned by the tool
statusYesExecution outcome status
summaryYesConcise, human-readable executive summary of the tool outcome
evidenceNoAudit trail, source references, and generated artifact locations
warningsYesOperational cautions, craft advice, or non-blocking warnings
nextActionsNoActionable sequential recommendations or subsequent tool suggestions

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv1.2.0
    • changedInput schema / properties / backgroundHex / description
      Previous value: -"Background surface color to test contrast"New value: +"Surface background color in 6-digit hex (#RRGGBB) to verify contrast ratio against text"
    • changedInput schema / properties / checkBidi / description
      Previous value: -"Audit CSS logical properties and Arabic RTL/LTR balance"New value: +"When true, audits CSS logical property compliance (e.g. flagging margin-left instead of margin-inline-start)"
    • changedInput schema / properties / checkCentering / description
      Previous value: -"Detect optical centering abuse and horizontal overflow risks"New value: +"When true, verifies optical centering balance and checks for horizontal overflow risks (e.g. 100vw, fixed large widths)"
    • changedInput schema / properties / code / description
      Previous value: -"HTML and CSS code to evaluate for anti-slop rules, fluid scaling, and craft quality"New value: +"HTML and CSS code string to evaluate for anti-slop rules, typography scaling, and alignment"
    • changedInput schema / properties / foregroundHex / description
      Previous value: -"Primary text color to test contrast"New value: +"Primary foreground text color in 6-digit hex (#RRGGBB) to verify against surface"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "data": {
      +      "additionalProperties": true,
      +      "description": "Domain-specific typed payload returned by the tool",
      +      "properties": {
      +        "antiSlopChecks": {
      +          "description": "Results for anti-slop rules (generic AI gradients, fluid clamp, semantic markup)",
      +          "items": {
      +            "additionalProperties": {},
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "bidiAndAlignment": {
      +          "anyOf": [
      +            {
      +              "additionalProperties": {},
      +              "type": "object"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "description": "CSS logical property and optical alignment audit details"
      +        },
      +        "contrast": {
      +          "additionalProperties": false,
      +          "description": "Mathematical WCAG contrast calculation results",
      +          "properties": {
      +            "background": {
      +              "type": "string"
      +            },
      +            "foreground": {
      +              "type": "string"
      +            },
      +            "grade": {
      +              "type": "string"
      +            },
      +            "ratio": {
      +              "type": "number"
      +            },
      +            "wcagAA": {
      +              "type": "boolean"
      +            },
      +            "wcagAAA": {
      +              "type": "boolean"
      +            }
      +          },
      +          "required": [
      +            "foreground",
      +            "background",
      +            "ratio",
      +            "grade",
      +            "wcagAAA",
      +            "wcagAA"
      +          ],
      +          "type": "object"
      +        },
      +        "craftGrade": {
      +          "description": "Letter grade (S, A, B, C, F)",
      +          "type": "string"
      +        },
      +        "craftScore": {
      +          "description": "Overall design craftsmanship rating (0-100)",
      +          "maximum": 100,
      +          "minimum": 0,
      +          "type": "number"
      +        },
      +        "isHighCraft": {
      +          "description": "True if craftScore >= 75 and contrast passes WCAG AA",
      +          "type": "boolean"
      +        },
      +        "remediationAdvice": {
      +          "description": "Specific, actionable code edits to reach Grade A/S craft",
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        "strengths": {
      +          "description": "Design elements adhering to high-craft principles",
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        }
      +      },
      +      "required": [
      +        "craftScore",
      +        "craftGrade",
      +        "isHighCraft",
      +        "antiSlopChecks",
      +        "contrast",
      +        "bidiAndAlignment",
      +        "strengths",
      +        "remediationAdvice"
      +      ],
      +      "type": "object"
      +    },
      +    "evidence": {
      +      "additionalProperties": false,
      +      "description": "Audit trail, source references, and generated artifact locations",
      +      "properties": {
      +        "artifacts": {
      +          "items": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "label": {
      +                "type": "string"
      +              },
      +              "sha256": {
      +                "type": "string"
      +              },
      +              "uri": {
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "label"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        },
      +        "inputsDigest": {
      +          "type": "string"
      +        },
      +        "sources": {
      +          "items": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "label": {
      +                "type": "string"
      +              },
      +              "retrievedAt": {
      +                "type": "string"
      +              },
      +              "uri": {
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "label"
      +            ],
      +            "type": "object"
      +          },
      +          "type": "array"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "nextActions": {
      +      "description": "Actionable sequential recommendations or subsequent tool suggestions",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "status": {
      +      "description": "Execution outcome status",
      +      "enum": [
      +        "success",
      +        "partial",
      +        "blocked",
      +        "failed"
      +      ],
      +      "type": "string"
      +    },
      +    "summary": {
      +      "description": "Concise, human-readable executive summary of the tool outcome",
      +      "type": "string"
      +    },
      +    "warnings": {
      +      "description": "Operational cautions, craft advice, or non-blocking warnings",
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "status",
      +    "summary",
      +    "data",
      +    "warnings"
      +  ],
      +  "type": "object"
      +}
  2. First observedv1.1.0

TDQS

A4.7/5.0
Behavior5/5

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

The description adds substantial behavioral detail beyond the annotations: in-memory static AST/regex analysis, zero filesystem writes, no network requests, deterministic scoring, and a clear output format. It fully aligns with readOnlyHint, idempotentHint, and destructiveHint, and enriches them with operational specifics.

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 well-structured with PURPOSE, BEHAVIOR, USAGE GUIDELINES, and RETURNS sections. It is information-dense but every sentence contributes meaningful guidance, with the core purpose front-loaded.

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?

For a tool of this complexity, the description is complete: it covers purpose, behavior, usage, exclusions, alternatives, and a summary of return values. The output schema exists, so detailed return documentation is not required in the description. The annotations and schema cover safety and parameters, leaving no critical gap.

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 schema fully documents all five parameters. The description does not need to repeat parameter details; it adds only high-level context about evaluating code, contrast, and bidi, which is consistent with the schema.

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 states a specific action ('Evaluate HTML and CSS code') against distinct criteria: anti-AI-slop heuristics, WCAG AAA contrast ratios, and bidi logical properties. This is far more specific than the tool name and clearly differentiates the tool from security auditing and screenshot-capture siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives explicit when-to-use context ('Call after creating or modifying web layouts... before committing'), explicit when-not-to-use cases, and names the correct alternatives (ink_audit_security, ink_capture_viewport). This leaves no ambiguity about tool selection.

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