Skip to main content
Glama
dgesteves
by dgesteves

Check UI code against the design system

check_ui
Read-onlyIdempotent

Check TSX/JSX for design system compliance, reporting hardcoded styles, unknown components/props, and missing accessible names with fixes.

Instructions

Lint TSX/JSX against the design system. Reports hardcoded colors, spacing and radius (with the nearest token), native elements that have a design-system component, unknown components, props and variant values, and icon-only buttons without an accessible name. Each diagnostic has line/column, a rule id, a message and a suggested fix. Run it on every snippet or file you write and fix all errors. Pass code for unsaved code, or path for a file in the project.

Input Schema

NameRequiredDescriptionDefault
codeNoTSX/JSX source to check (up to 1,000,000 characters).
pathNoPath of a file to check, relative to the project root (the monorepo root, when served from there).
limitNoMost diagnostics to return, errors first (default 50). The counts and byRule cover all of them.
filenameNoName to report `code` under; a .jsx extension parses it as JSX. At a monorepo root, the path the code will be saved under, which picks the project whose design system checks it.

Output Schema

NameRequiredDescriptionDefault
okYesTrue when there are no errors.
fileYes
byRuleYesEvery finding per rule, shown or not.
noticeNoSet when no components or no color tokens were found, so rules did not run, or when components came from modules the model does not include.
omittedYesDiagnostics left out by `limit`.
skippedNoWhy the file was not checked: it renders an image (next/og) or an email.
uncheckedNoComponents imported from modules the model does not include, not checked.
errorCountYes
diagnosticsYesUp to `limit` diagnostics, errors first; `omitted` says how many more there are.
warningCountYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations declare a safe read (readOnlyHint=true, idempotentHint=true, destructiveHint=false), and the description is consistent with that. It adds real behavioral context beyond the annotations: the diagnostic payload shape (line/column, rule id, message, suggested fix) and the expectation that the agent act on findings. It does not discuss severity semantics or failure modes, so not a 5.

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?

Front-loaded with the one-line purpose, then audience-facing detail and input routing. Four sentences with essentially no filler, though the long enumeration of diagnostic categories is denser than strictly needed.

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?

With an output schema present, the description need not document return values, and it still summarizes them usefully. Inputs, the action expected after a run, and the diagnostic content are all covered, leaving nothing an agent needs in order to invoke it correctly.

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, but the description contributes meaning the schema lacks: the mutual-exclusivity/intent distinction between `code` (unsaved buffer) and `path` (project file), which shapes how an agent picks between the two. That is genuine added semantics.

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 precise verb+resource ('Lint TSX/JSX against the design system') and then enumerates the exact classes of problem it detects (hardcoded colors/spacing/radius, native elements, unknown components/props/variants, inaccessible icon-only buttons). The sibling tools (list/get/search_components, get_tokens) are all lookup operations, so this diagnostic tool is unambiguously distinguishable.

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 an explicit call-to-action ('Run it on every snippet or file you write and fix all errors') and a routing rule for inputs ('Pass `code` for unsaved code, or `path` for a file in the project'). It does not name a when-not condition or a sibling alternative, but the usage context is clear.

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