Skip to main content
Glama

Preflight brand check

brand_preflight
Idempotent

Validate HTML/CSS against brand rules to catch off-brand colors, wrong fonts, missing logos, and anti-patterns; optionally render pages to verify computed styles, contrast, and logo presence.

Instructions

Check HTML/CSS against brand rules — catches off-brand colors, wrong fonts, missing logo, and anti-pattern violations (drop shadows, gradients, etc.). Pass an HTML string or file path. Mode 'check' (default) runs static source checks. Add render=true to render the page in sandboxed headless Chrome (all network blocked) and verify the COMPUTED result: actual colors vs palette (CIEDE2000), the font face that really renders, WCAG AA text contrast, logo presence, optional screenshot to .brand/checks/. Use after building any page or component, or when the user asks 'does this look on-brand?', 'check my page', or 'verify the design'. Mode 'rules' lists active rules. Returns overall PASS/WARN/FAIL, a score, and per-finding details (locator, measured value, nearest brand value, severity). NOT for scoring content copy — use brand_audit_content. NOT for brand directory validation — use brand_audit.

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": {
      "html": "<html>"
    },
    "name": "brand_preflight"
  }
}

Input Schema

NameRequiredDescriptionDefault
htmlYesHTML to validate: either a full HTML string (with <style> blocks) or a file path ending in .html (e.g. 'output.html')
modeNo'check' (default): validates HTML against all brand rules. 'rules': lists all active rules without running checks.check
renderNotrue: render the HTML in sandboxed headless Chrome with ALL network blocked and check the computed result — actual colors vs the palette (CIEDE2000), the font face that really renders, WCAG AA text contrast, logo presence. Local CSS/JS/fonts/images inside the working directory are inlined first. Requires Chrome/Chromium. Default false (static source checks).
viewportNoViewport for render=true: 'desktop' 1280x800 (default), 'tablet' 768x1024, 'mobile' 390x844desktop
screenshotNoWith render=true: save a PNG of the rendered page under .brand/checks/ and return its path so you can show the user
max_findingsNoWith render=true: maximum findings returned, most severe first (default 12, max 50)

Output Schema

NameRequiredDescriptionDefault
_metadataYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.18.0
    • addedInput schema / properties / max_findings
      Added value: +{
      +  "default": 12,
      +  "description": "With render=true: maximum findings returned, most severe first (default 12, max 50)",
      +  "maximum": 50,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / render
      Added value: +{
      +  "default": false,
      +  "description": "true: render the HTML in sandboxed headless Chrome with ALL network blocked and check the computed result — actual colors vs the palette (CIEDE2000), the font face that really renders, WCAG AA text contrast, logo presence. Local CSS/JS/fonts/images inside the working directory are inlined first. Requires Chrome/Chromium. Default false (static source checks).",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / screenshot
      Added value: +{
      +  "default": false,
      +  "description": "With render=true: save a PNG of the rendered page under .brand/checks/ and return its path so you can show the user",
      +  "type": "boolean"
      +}
    • addedInput schema / properties / viewport
      Added value: +{
      +  "default": "desktop",
      +  "description": "Viewport for render=true: 'desktop' 1280x800 (default), 'tablet' 768x1024, 'mobile' 390x844",
      +  "enum": [
      +    "desktop",
      +    "tablet",
      +    "mobile"
      +  ],
      +  "type": "string"
      +}
  2. Addedv0.17.0
  3. Removedv0.13.4
  4. Changed1 schema field changedv0.11.0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": true,
      +  "properties": {
      +    "_metadata": {
      +      "additionalProperties": true,
      +      "properties": {
      +        "next_steps": {
      +          "items": {
      +            "type": "string"
      +          },
      +          "type": "array"
      +        },
      +        "what_happened": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "what_happened",
      +        "next_steps"
      +      ],
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "_metadata"
      +  ],
      +  "type": "object"
      +}
  5. First observedv0.5.0

TDQS

A4.8/5.0
Behavior5/5

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

Despite annotations only covering safety flags, the description discloses real operational traits: sandboxed headless Chrome with ALL network blocked, local assets inlined, a Chrome/Chromium dependency, an optional PNG written to .brand/checks/, and the CIEDE2000 / WCAG AA verification methods. This is exactly the extra context annotations cannot carry.

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

Conciseness4/5

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

Well front-loaded: capability, then mode/render mechanics, then usage triggers, then exclusions. The render sentence is a dense run-on with stacked parentheses, which costs a point on readability, but no sentence is filler.

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 6-parameter tool with an output schema, the definition covers the operational environment, the mode split, the escalation path, the side effects on disk, and a summary of the PASS/WARN/FAIL return. Nothing an agent needs to invoke it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3; the description still adds cross-parameter meaning the schema states only piecewise – that render=true is what unlocks computed-value checks, that it inlines local CSS/JS/fonts/images, and that screenshot and max_findings are subordinate to render. Viewport and max_findings semantics are left entirely to 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?

States a specific verb and resource ('Check HTML/CSS against brand rules') and enumerates the exact violations detected: off-brand colors, wrong fonts, missing logo, anti-patterns. It also draws hard boundaries against content scoring and directory validation, so an agent can tell it apart from the other brand_* tools immediately.

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?

Gives both the proactive trigger ('Use after building any page or component') and the user-phrasing triggers ('does this look on-brand?', 'check my page', 'verify the design'). It also names when NOT to use it and routes to brand_audit_content and brand_audit, plus explains when to escalate from static mode to render=true.

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