Skip to main content
Glama

StyleKit

Lint code against a StyleKit style

stylekit_lint_code
Read-onlyIdempotent

Check whether code actually follows a style's rules. Use this AFTER generating or editing UI code to verify it matches the style, instead of assuming it does.

Reports forbidden classes with the reason they are banned and a concrete replacement. Understands JSX/HTML class attributes, cn()/clsx() calls, and template literals; variant prefixes (dark:, md:, hover:) are resolved before matching.

Args:

  • slug (string): style identifier, e.g. "glassmorphism".

  • code (string): the source to check. JSX/TSX, HTML, or a bare class string.

  • checkRequired (array of 'button'|'card'|'input', optional): also report required classes the code is missing. Only pass components the code is supposed to contain.

Returns JSON: { slug, ok, violations: [{ className, baseClassName, line, severity, source, rule, reason, fix }], missingRequired, checkedClasses, ruleSources, origin, contentSource, fallbackReason? }. Lint rules come from the same live implementation brief used for generation; its five-minute cache and any bundled fallback are reported separately from content provenance.

Examples:

  • "does this button match neo-brutalist?" -> slug: "neo-brutalist", code: "", checkRequired: ["button"]

  • strict (boolean, default false): fail missing required classes in a static component snippet. Required checks cover the whole input, not each element.

  • status is pass, fail, or inconclusive. Runtime class expressions cannot be fully verified. ok is true only for a conclusive static pass; visual quality still needs review.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesSource code or class string to lint
slugYesStyle slug, e.g. 'glassmorphism'
strictNoFail missing required classes in a static snippet
checkRequiredNoComponents to also check for missing required classes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
slugYes
originYes
statusYes
coverageYes
warningsYes
violationsYes
ruleSourcesYes
contentSourceYes
checkedClassesYes
fallbackReasonNo
missingRequiredYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive), and the description adds substantial context on top: what parsing it understands (JSX/HTML class attributes, cn()/clsx(), template literals, variant prefix resolution), that rule sources come from a live brief with a five-minute cache and bundled fallback, and that ok is only true for a conclusive static pass while runtime expressions may be inconclusive.

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?

Purpose and usage are front-loaded in the first two sentences, and the args/returns blocks are compact. The structure slips in the 'Examples' block, where two of three bullets are actually parameter notes (strict) and status semantics rather than examples, which is a minor organizational flaw.

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 multi-param linting tool, the description covers parsing scope, rule provenance, caching/fallback reporting, strict semantics, and the pass/fail/inconclusive status model. An output schema exists, so restating the return shape is redundant but harmless, and nothing needed to invoke the tool 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, but the description adds real meaning beyond the schema: it explains that code may be JSX/TSX, HTML, or a bare class string, and clarifies non-obvious semantics such as 'Required checks cover the whole input, not each element' and that strict only applies to static snippets.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The opening sentence gives a specific verb and resource: 'Check whether code actually follows a style's rules.' It implicitly separates itself from generation/repair siblings by framing the tool as a verifier, but it never names an alternative sibling (e.g., stylekit_repair_code), so it stops short of full explicit differentiation.

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?

'Use this AFTER generating or editing UI code to verify it matches the style, instead of assuming it does' gives clear workflow context for when to reach for this tool. It also warns 'Only pass components the code is supposed to contain' for checkRequired, but it never names the repair sibling as the follow-up alternative, so there are no explicit exclusions or alternatives.

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.