Skip to main content
Glama
design-system-mcp
by dgesteves

Check UI code against the design system

check_ui
Read-onlyIdempotent

Lint TSX/JSX against your design system to catch hardcoded colors, spacing and radius, wrong or unknown components and props, and icon-only buttons without accessible names, with suggested 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 path for a file in the project, or code for unsaved code, with path (or filename) naming the file it is for or its project folder.

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

Input Schema

NameRequiredDescriptionDefault
codeNoTSX/JSX source to check (up to 1,000,000 characters).
pathNoPath of a .tsx, .jsx, .ts or .js file, relative to the project root (the monorepo root, when served from there) or absolute: the file to check, or, with `code`, the file the code is for, as `filename`. With `code`, a project folder only picks the project.
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. When the server was started outside your project, pass it as an absolute path: the project is found from 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, when components came from modules the model does not include, when the project depends on a component library onsystem does not read yet, or when its dependencies are not installed.
omittedYesDiagnostics left out by `limit`.
skippedNoWhy the file was not checked: it renders an image (next/og) or an email, or the config's `exclude` leaves it out.
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. Changed4 schema fields changedv0.12.1
    • changedInput schema / properties / filename / description
      Previous value: -"Name 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."New value: +"Name 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. When the server was started outside your project, pass it as an absolute path: the project is found from it."
    • changedInput schema / properties / path / description
      Previous value: -"Path of a file to check, relative to the project root (the monorepo root, when served from there)."New value: +"Path of a .tsx, .jsx, .ts or .js file, relative to the project root (the monorepo root, when served from there) or absolute: the file to check, or, with `code`, the file the code is for, as `filename`. With `code`, a project folder only picks the project."
    • changedOutput schema / properties / notice / description
      Previous value: -"Set 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."New value: +"Set when no components or no color tokens were found, so rules did not run, when components came from modules the model does not include, when the project depends on a component library onsystem does not read yet, or when its dependencies are not installed."
    • changedOutput schema / properties / skipped / description
      Previous value: -"Why the file was not checked: it renders an image (next/og) or an email."New value: +"Why the file was not checked: it renders an image (next/og) or an email, or the config's `exclude` leaves it out."
  2. First observedv0.6.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already establish this is a safe, idempotent, local read, so the bar is lower; the description goes further by listing the diagnostic categories (hardcoded colors/spacing/radius with nearest token, native elements, unknown props/variants, missing accessible names) and the shape of each diagnostic (line/column, rule id, message, suggested fix).

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?

What it reports is front-loaded before usage instructions, and the final sentence cleanly resolves the path/code pairing. It is dense rather than bloated, though a few clauses duplicate schema wording.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists so return values need not be explained, and the description still covers rule coverage and when to run it. The only mild gap is that truncation via `limit` and error-first ordering are left to the schema.

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 adds relationship-level meaning the schema only implies: that `path` and `code` are alternatives, that `path` doubles as the report filename when `code` is given, and that a folder-only path just picks the project.

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 first sentence gives a specific verb and resource ('Lint TSX/JSX against the design system') and the second enumerates the exact rule categories detected, so it is instantly distinguishable from the sibling component/token lookup tools.

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?

It explicitly instructs 'Run it on every snippet or file you write and fix all errors' and gives a clear selection rule between `path` (file in project) and `code` (unsaved code). There is no when-not-to-use or alternative-tool guidance, but no sibling overlaps enough to need it.

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