Skip to main content

suggest_fixes

Returns actionable fix suggestions for design system violations.

Reference

Parameters

  • Name
    code
    Type
    string · required
    Description

    The code containing violations

  • Name
    violations
    Type
    array · optional
    Description

    Specific violation IDs to fix (optional)

  • Name
    autoApply
    Type
    boolean · optional
    Description

    Return code with fixes applied

Returns

{
  fixes      Array of suggested fixes with:
    violationId  which violation this fixes
    description  what's wrong
    original     the problematic code
    suggested    the corrected code
    confidence   0-1 (higher = more reliable fix)
    breaking     boolean (could this change behavior?)
    diff         unified diff format
    line/column  location in code
  fixedCode  code with all auto-fixes applied (if autoApply=true)
  unfixable  violations requiring manual intervention with:
    violationId  which violation
    reason       why it can't be auto-fixed
    manualSteps  array of steps to fix manually
  stats      totalViolations, autoFixable, requiresManual, appliedFixes
}

Description

Returns actionable fix suggestions for design system violations.

Completes the validation → correction loop. Use after validate_generated_code finds violations to get specific fixes with diffs.

Parameters:

  • code (required): The code containing violations
  • violations (optional): Array of violation IDs to fix (if not provided, fixes all)
  • autoApply (optional): boolean - return code with fixes applied (default: false)

Use this to complete the validation → correction workflow for AI code generation.

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