Skip to main content
Glama

workflow_build_design_system

Generate a complete design system from existing components by extracting tokens, components, and documentation from Storybook or code sources to establish consistent UI foundations.

Instructions

Generate complete design system from components

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sourceYes
sourceIdYes
includeTokensNo
includeComponentsNo
includeDocumentationNo

Implementation Reference

  • Main handler implementation for workflow_build_design_system tool. Parses input with Zod, builds design system from Storybook or code source, generates tokens/components/docs, returns structured output.
    async buildDesignSystem(args: any) {
      const params = BuildDesignSystemSchema.parse(args);
      
      try {
        const designSystem: any = {
          name: 'Design System',
          version: '1.0.0',
          source: params.source,
          created: new Date().toISOString(),
          tokens: {},
          components: [],
          documentation: {}
        };
    
        switch (params.source) {
          case 'storybook':
            // Build from Storybook
            if (params.includeComponents) {
              const stories = await this.storybookTools.getStories({ url: params.sourceId });
              designSystem.components = this.extractStorybookComponents(stories);
            }
            break;
            
          case 'code':
            // Build from code analysis
            designSystem.components = await this.analyzeCodeComponents(params.sourceId);
            break;
        }
    
        if (params.includeDocumentation) {
          designSystem.documentation = this.generateSystemDocumentation(designSystem);
        }
    
        // Generate output files
        const outputs = {
          tokens: params.includeTokens ? this.generateTokenFiles(designSystem.tokens) : null,
          components: params.includeComponents ? this.generateComponentFiles(designSystem.components) : null,
          documentation: params.includeDocumentation ? this.generateDocFiles(designSystem.documentation) : null
        };
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify({
                designSystem,
                outputs,
                summary: {
                  tokenCategories: Object.keys(designSystem.tokens).length,
                  componentCount: designSystem.components.length,
                  documentationPages: Object.keys(designSystem.documentation).length
                }
              }, null, 2)
            }
          ]
        };
      } catch (error: any) {
        return {
          content: [
            {
              type: 'text',
              text: `Error building design system: ${error.message}`
            }
          ],
          isError: true
        };
      }
    }
  • Zod input schema definition used for validating tool arguments in the handler.
    const BuildDesignSystemSchema = z.object({
      source: z.enum(['storybook', 'code']),
      sourceId: z.string(),
      includeTokens: z.boolean().default(true),
      includeComponents: z.boolean().default(true),
      includeDocumentation: z.boolean().default(true)
    });
  • src/index.ts:275-291 (registration)
    Tool registration entry in ListToolsRequestHandler providing name, description, and inputSchema.
      name: 'workflow_build_design_system',
      description: 'Generate complete design system from components',
      inputSchema: {
        type: 'object',
        properties: {
          source: {
            type: 'string',
            enum: ['storybook', 'code']
          },
          sourceId: { type: 'string' },
          includeTokens: { type: 'boolean', default: true },
          includeComponents: { type: 'boolean', default: true },
          includeDocumentation: { type: 'boolean', default: true }
        },
        required: ['source', 'sourceId']
      }
    }
  • src/index.ts:334-335 (registration)
    Dispatch case in CallToolRequestHandler that routes execution to WorkflowTools.buildDesignSystem method.
    case 'workflow_build_design_system':
      return await this.workflowTools.buildDesignSystem(args);
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states 'Generate' which implies a creation/mutation operation, but doesn't specify if this is a read-only analysis, a destructive overwrite, requires authentication, has rate limits, or what the output entails (e.g., file creation, API response). This is inadequate for a tool with potential side effects.

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

Conciseness5/5

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

The description is a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's appropriately sized and front-loaded, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (5 parameters, no annotations, no output schema), the description is incomplete. It doesn't cover parameter meanings, behavioral traits, or output details, leaving significant gaps for the agent to understand how to invoke and interpret results effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, meaning none of the 5 parameters are documented in the schema. The description adds no parameter semantics—it doesn't explain what 'source', 'sourceId', or the boolean flags mean, nor their impact on the generation process. This fails to compensate for the lack of schema documentation.

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 description clearly states the action ('Generate') and the target resource ('complete design system from components'), providing a specific purpose. However, it doesn't differentiate from sibling tools like 'component_analyze' or 'storybook_get_stories' which might also relate to design systems or components, so it doesn't reach the highest score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. For example, it doesn't explain if this is for initial setup versus updates, or how it differs from sibling tools like 'component_create' or 'tailwind_generate_config' that might overlap in design system creation. This leaves the agent without context for selection.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/willem4130/ui-ux-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server