Skip to main content
Glama

Validate UI code against the design system

validate_snippet
Read-only

Runs the Brandrail Checker on UI code you wrote (TSX/JSX, Angular components and templates, Vue, Svelte, HTML, CSS, PHP, Twig, Mustache/Handlebars). Returns a brand score and each violation with the fix. Call once after writing UI with every file you changed in files, and fix every error and warning before finishing.

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": "validate_snippet"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeNoA single file or snippet (when not using files)
filesNoEvery file you changed, checked together as one result. Preferred over code/filename.
projectNoRepo or app name, e.g. customer-portal (shown in the dashboard)
filenameNoFile name for code; the extension decides how it's parsedsnippet.tsx

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so safety is covered; the description adds genuine context on top: it is a non-idempotent-feeling single batched call, returns a score plus per-violation fixes, and defines a remediation loop (fix every error and warning before finishing). It stops short of stating rate limits, latency, or whether warnings block a pass.

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?

Three tight sentences: what it does plus supported formats, what comes back, then the call protocol and completion bar. No filler, and the core action is 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?

There is no output schema, and the description compensates by describing the return value (brand score and each violation with its fix). Together with a fully documented 4-param schema and safety annotations, an agent has everything needed to call this correctly and interpret the result.

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 the schema already says `files` means 'every file you changed, checked together as one result' and is preferred over code/filename, so the description largely restates that. It usefully reinforces batching all changed files in one call, but adds no format or parsing detail beyond the schema's extension note.

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?

Names a concrete verb and resource: runs the Brandrail Checker on UI code, enumerating the supported languages (TSX/JSX, Angular, Vue, Svelte, HTML, CSS, PHP, Twig, Mustache/Handlebars). It also states the output shape (brand score plus violations with fixes), so the agent knows exactly what this does that the get_* siblings do not.

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?

Gives explicit timing and scope guidance: call once after writing UI, pass every changed file in `files`, and fix all errors and warnings before finishing. No when-not condition or named alternative is given, but the siblings are retrieval tools with evidently different roles, so the guidance is close to complete.

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.

Resources