Skip to main content
Glama

check_design_drift

Read-onlyIdempotent

Checks candidate UI code against a reference design-token set and returns a compact, structured list of drift violations. For each: the token axis (color / radius / spacing / font / type), the value found, the expected token and its value, and the location. It reads DECLARED styles and tokens, not pixels. It is stateless (the tokens and code are passed in the call; nothing is stored) and read-only (it reports drift; it does not modify your code). Inputs: reference_tokens — the user's design system as {color:{name:hex}, radius:{name:val}, space:{name:val}, font:{name:stack}, type:{role:{size}}}; code — the CSS/markup to check (declarations such as color: #fff or padding: 12px); optional source (a short label for usage counts; it does not change the check). Recommended use: after you generate UI code against a design system the user has agreed to (they pasted tokens, or approved one you proposed, or described one you composed), call this before presenting the result; if violations come back, fix them and re-check until clean. The build-and-fix loop is yours; swatchdog is the instrument.

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": {
      "reference_tokens": "<reference_tokens>",
      "code": "<code>"
    },
    "name": "check_design_drift"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYes
sourceNo
reference_tokensYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare readOnly, idempotent, and closed-world, and the description adds context those do not cover: it is stateless (nothing is stored), it only inspects declared styles rather than rendered pixels, and it reports rather than modifies code. The per-axis return shape (axis, found value, expected token and value, location) is also disclosed.

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 — what it does, what it returns, its execution model, then inputs and recommended use. Slightly padded by rhetorical flourishes ('swatchdog is the instrument', 'the build-and-fix loop is yours') that add tone rather than information.

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?

Despite nested-object inputs and an output schema, the description still gives an agent everything needed: input shapes, statelessness, the check semantics (declared vs. pixels), and the fix-and-recheck workflow. Nothing required for correct invocation is missing.

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

Parameters5/5

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

With 0% schema description coverage, the description carries the full burden and does so: it spells out the nested shape of reference_tokens across five token axes, gives examples of the code input (color: #fff, padding: 12px), and clarifies that source is only a label for usage counts and does not affect the check.

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: 'Checks candidate UI code against a reference design-token set' and names the output (a structured list of drift violations). The scope is further pinned down by 'reads DECLARED styles and tokens, not pixels', so an agent knows exactly what class of comparison this performs.

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 'Recommended use' section gives explicit trigger conditions (after generating UI code against a design system the user has agreed to — pasted, approved, or composed) and an explicit loop policy: call before presenting, fix violations, re-check until clean. No sibling alternatives exist to route between, so nothing material is left to inference.

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