Skip to main content

validate_generated_code

Validates generated code for design system violations.

Reference

Parameters

  • Name
    code
    Type
    string · required
    Description

    The generated code to validate

  • Name
    autoCorrect
    Type
    boolean · optional
    Description

    Return auto-corrected code

  • Name
    intent
    Type
    string · optional
    Description

    What the code was meant to do

Returns

{
  valid          boolean - whether the code passes validation
  violations     array of issues found with line/column info
  suggestions    how to fix each violation
  correctedCode  auto-fixed code (if autoCorrect=true)
  stats          count of errors, warnings, and auto-fixes
}

Description

Validates generated code for design system violations.

Parameters:

  • code: The generated code to validate
  • autoCorrect: Whether to return auto-corrected code (default: false)
  • intent: What the code was meant to do (optional, for better suggestions)

Source

Defined in packages/mcp/src/tools.ts. The request handler lives alongside its registration in packages/mcp/src/tools/.

Was this page helpful?

Last reviewed by @jschuyler