Skip to main content
Glama
Nwabukin

MCP UI/UX Prompt Refiner

by Nwabukin

analyze_interface

Analyze interface descriptions to detect types, suggest styles, identify components, and understand scope before refining UI/UX designs.

Instructions

Analyze an interface request to detect the type, suggest styles, identify components, and understand the scope. Use this before refining to understand what you're working with.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rawPromptYesInterface description to analyze
interfaceTypeNoOverride detected interface type

Implementation Reference

  • Core handler function implementing the analysis logic: detects interface type, design styles, key components, user personas, design patterns, and complexity level from the raw prompt.
    export function analyzeInterface(rawPrompt: string, providedType?: InterfaceType): AnalysisResult {
      const interfaceType = providedType || detectInterfaceType(rawPrompt);
      const suggestedStyles = detectStyles(rawPrompt);
      const keyComponents = extractKeyComponents(rawPrompt, interfaceType);
      const userPersonas = inferUserPersonas(rawPrompt, interfaceType);
      const designPatterns = suggestDesignPatterns(interfaceType, suggestedStyles);
      const complexity = determineComplexity(rawPrompt, keyComponents);
    
      return {
        interfaceType,
        suggestedStyles,
        keyComponents,
        userPersonas,
        designPatterns,
        complexity
      };
    }
  • Zod schema defining the input validation for the analyze_interface tool: rawPrompt (required) and optional interfaceType.
    const AnalyzeInterfaceSchema = z.object({
      rawPrompt: z.string().describe('Interface description to analyze'),
      interfaceType: z.enum([
        'website-landing', 'website-saas', 'website-portfolio', 'website-ecommerce',
        'dashboard', 'mobile-app', 'desktop-app', 'cli-terminal', 'presentation',
        'admin-panel', 'social-platform', 'custom'
      ]).optional().describe('Override detected interface type'),
    });
  • src/server.ts:152-167 (registration)
    Tool registration in the ListToolsRequestHandler, defining name, description, and inputSchema for MCP discovery.
    {
      name: 'analyze_interface',
      description: 'Analyze an interface request to detect the type, suggest styles, identify components, and understand the scope. Use this before refining to understand what you\'re working with.',
      inputSchema: {
        type: 'object',
        properties: {
          rawPrompt: { type: 'string', description: 'Interface description to analyze' },
          interfaceType: {
            type: 'string',
            enum: ['website-landing', 'website-saas', 'website-portfolio', 'website-ecommerce', 'dashboard', 'mobile-app', 'desktop-app', 'cli-terminal', 'presentation', 'admin-panel', 'social-platform', 'custom'],
            description: 'Override detected interface type'
          }
        },
        required: ['rawPrompt']
      }
    },
  • MCP tool dispatch handler: parses arguments with schema, calls analyzeInterface core function, formats output with generateAnalysisOutput, and returns text content.
    case 'analyze_interface': {
      const parsed = AnalyzeInterfaceSchema.parse(args);
      const analysis = analyzeInterface(parsed.rawPrompt, parsed.interfaceType as InterfaceType | undefined);
      const result = generateAnalysisOutput(analysis, parsed.rawPrompt);
      return { content: [{ type: 'text', text: result }] };
    }
  • Helper function that formats the AnalysisResult into a markdown report used by the tool handler.
    export function generateAnalysisOutput(analysis: AnalysisResult, rawPrompt: string): string {
      return `# Interface Analysis
    
    ## Original Request
    "${rawPrompt}"
    
    ## Detected Interface Type
    **${analysis.interfaceType.replace(/-/g, ' ').replace(/\b\w/g, c => c.toUpperCase())}**
    
    ## Complexity Level
    **${analysis.complexity.charAt(0).toUpperCase() + analysis.complexity.slice(1)}**
    
    ## Suggested Design Styles
    ${analysis.suggestedStyles.map(s => `- ${s.replace(/-/g, ' ').replace(/\b\w/g, c => c.toUpperCase())}`).join('\n')}
    
    ## Key Components Identified
    ${analysis.keyComponents.map(c => `- ${c}`).join('\n')}
    
    ## Target User Personas
    ${analysis.userPersonas.map(p => `- ${p}`).join('\n')}
    
    ## Recommended Design Patterns
    ${analysis.designPatterns.map(p => `- ${p}`).join('\n')}
    
    ---
    *This analysis forms the foundation for the refined design prompt.*
    `;
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions the tool's function but lacks details on behavioral traits such as whether it's read-only, if it requires specific permissions, rate limits, or what the output format looks like. For a tool with no annotations, this is a significant gap, as it doesn't provide enough context for safe and effective use.

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 appropriately sized and front-loaded, consisting of two concise sentences. The first sentence clearly states the purpose, and the second provides usage guidance. There is no wasted text, and every sentence earns its place by adding value, making it efficient and well-structured.

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 of analyzing an interface with 2 parameters and no output schema, the description is incomplete. It lacks details on behavioral aspects (e.g., read-only status, permissions) and doesn't explain the return values or output format, which is critical since there's no output schema. For a tool with no annotations and no output schema, the description should provide more context to be fully helpful.

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

Parameters3/5

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

The input schema has 100% description coverage, with clear documentation for both parameters: 'rawPrompt' and 'interfaceType' (including an enum). The description doesn't add any additional meaning beyond what the schema provides, such as explaining the 'rawPrompt' format or when to use the 'interfaceType' override. Given the high schema coverage, a baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

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 tool's purpose: 'Analyze an interface request to detect the type, suggest styles, identify components, and understand the scope.' It specifies the verb ('analyze') and resource ('interface request') with concrete outcomes. However, it doesn't explicitly differentiate from sibling tools like 'refine_ui_prompt' or 'generate_ux_flow' beyond the temporal suggestion 'Use this before refining,' which is somewhat implied but not fully distinct.

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?

The description provides clear context for when to use the tool: 'Use this before refining to understand what you're working with.' This implies it's a preparatory step, likely preceding tools like 'refine_ui_prompt.' However, it doesn't explicitly state when not to use it or name specific alternatives among the siblings, such as 'suggest_tech_stack' or 'compose_animations,' leaving some ambiguity.

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/Nwabukin/mcp-ui-prompt-refiner'

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