Skip to main content
Glama

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.

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": {
      "slug": "<slug>",
      "code": "<code>"
    },
    "name": "stylekit_lint_code"
  }
}

Input 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

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / $schema
      Previous value: -"https://json-schema.org/draft/2020-12/schema"New value: +"http://json-schema.org/draft-07/schema#"
    • addedInput schema / additionalProperties
      Added value: +false
    • changedOutput schema / $schema
      Previous value: -"https://json-schema.org/draft/2020-12/schema"New value: +"http://json-schema.org/draft-07/schema#"
  2. First observed

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive, and openWorld, so the safety profile is covered. The description nonetheless adds real context beyond that: variant-prefix resolution (dark:, md:, hover:), JSX/cn()/clsx/template-literal parsing, a five-minute rule cache with bundled fallback reported separately, and the pass/fail/inconclusive status semantics where ok is true only for a conclusive static pass. That is substantive behavioral disclosure, but it is delivered in a disorganized tail rather than as an integrated statement.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The opening two sentences are well front-loaded, but the body drifts: the strict bullet and the status/ok sentences are appended under an "Examples" heading where they do not belong, and the Args block largely duplicates the schema. The information is valuable but the ordering makes it harder to scan than it should be.

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?

For a four-parameter linter with an output schema, the description covers the crucial edge cases: runtime class expressions cannot be fully verified, required checks span the whole input rather than each element, and fallback/cache provenance is surfaced. It repeats the return shape already in the output schema and says nothing about invalid-slug failure behavior, so it is strong but not airtight.

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; the description earns extra by clarifying that code accepts JSX/TSX, HTML, or a bare class string, and by adding the important constraint that checkRequired should only list components the code is supposed to contain. The strict parameter is only explained indirectly through a stray bullet, so it is not fully clarified.

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?

Opens with a specific verb and object: "Check whether code actually follows a style's rules." That is immediately distinguishable from the read-oriented siblings (get_style, search_styles, list_assets), and the tool's role as a post-generation verifier is unmistakable.

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 guidance ("Use this AFTER generating or editing UI code... instead of assuming it does") and warns that visual quality still needs human review. It does not name a sibling tool as the alternative for any case, nor state a when-not condition, which keeps it below a 5.

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.