Skip to main content

create_pattern

Create a UI pattern directly in the design system.

Reference

Parameters

  • Name
    design_system_id
    Type
    string · required
    Description

    Design system UUID (uuid)

  • Name
    name
    Type
    string · required
    Description

    Pattern name (min 1)

  • Name
    description
    Type
    string · required
    Description

    Pattern description (min 10)

  • Name
    category
    Type
    enum · required
    Description

    Pattern category (layout · form · feedback · navigation · interaction · action · data · content)

  • Name
    guidelines
    Type
    object · optional
    Description

    Usage guidelines

  • Name
    accessibility
    Type
    object · optional
    Description

    Accessibility requirements

  • Name
    examples
    Type
    object · optional
    Description

    Usage examples

  • Name
    idempotency_key
    Type
    string · optional
    Description

    Unique key to prevent duplicate patterns on retry

  • Name
    session_id
    Type
    string · optional
    Description

    Agent review session to add this proposal to. Omit on your first proposal; the response returns sessionId, and passing it on later proposals in the same task puts them all on one review page for the person. (uuid)

Returns

{
  success     Whether the pattern was created
  pattern_id  UUID of the created pattern
  url         URL to view the pattern in the app
  dry_run     True if no database connection
}

Description

Create a UI pattern directly in the design system.

Use this when the user explicitly asks to document or create a pattern. For AI-discovered patterns that need human review, use suggest_pattern instead.

Flow Comparison:

  • suggest_pattern: AI → Review Queue → Approve → Create
  • create_pattern: User directs AI → Direct create (this tool)

Parameters:

  • design_system_id (required): UUID of the design system
  • name (required): Pattern name (e.g., "Toggle Group")
  • description (required): What this pattern is and when to use it
  • category (required): Pattern category (layout, form, feedback, navigation, interaction, action, data, content)
  • guidelines (optional): Usage rules with must/must_not/should arrays
  • accessibility (optional): Accessibility requirements (keyboard, aria, focus, screenReader)
  • examples (optional): Usage examples (basic, advanced, code snippets)

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