Skip to main content
Glama
Nwabukin

MCP UI/UX Prompt Refiner

by Nwabukin

compose_animations

Generate detailed animation specifications with CSS code examples for interfaces, including entry animations, scroll effects, hover states, and transitions.

Instructions

Generate detailed animation specifications including entry animations, scroll effects, hover states, loading animations, and transition choreography with CSS code examples.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
interfaceTypeYesType of interface
intensityYesAnimation intensity level
sectionsNoSpecific sections to animate
customRequirementsNoAdditional animation requirements

Implementation Reference

  • The primary handler function for the 'compose_animations' tool. It takes AnimationCompositionInput and returns a detailed Markdown string specifying animations, philosophy, recommendations for entry/hover/scroll effects, section choreography, CSS variables, keyframes, performance tips, and accessibility guidelines. Uses helper functions to select and generate content based on intensity.
    export function composeAnimations(input: AnimationCompositionInput): string {
      const { interfaceType, intensity, sections, customRequirements } = input;
      const multiplier = getIntensityMultiplier(intensity);
      
      const entryAnims = selectEntryAnimations(intensity);
      const hoverAnims = selectHoverAnimations(intensity);
      const scrollAnims = selectScrollAnimations(intensity);
      const sectionSpecs = generateSectionAnimations(interfaceType, intensity);
    
      return `# Animation Specification
    
    ## Overview
    **Interface Type**: ${interfaceType.replace(/-/g, ' ').replace(/\b\w/g, c => c.toUpperCase())}
    **Animation Intensity**: ${intensity.toUpperCase()}
    **Complexity Level**: ${multiplier.complexity}/4
    
    ${customRequirements ? `**Custom Requirements**: ${customRequirements}` : ''}
    
    ---
    
    ## Animation Philosophy
    
    For ${intensity} intensity, animations should feel:
    ${intensity === 'subtle' ? '- Barely noticeable but present\n- Quick and efficient\n- Professional and understated' : ''}
    ${intensity === 'moderate' ? '- Noticeable but not distracting\n- Purposeful and meaningful\n- Enhancing without overwhelming' : ''}
    ${intensity === 'dramatic' ? '- Eye-catching and impressive\n- Bold and expressive\n- Statement-making' : ''}
    ${intensity === 'cinematic' ? '- Theatrical and immersive\n- Story-telling through motion\n- Memorable and unique' : ''}
    
    ---
    
    ## Entry Animations
    
    ### Recommended Types
    ${entryAnims.map(name => {
      const anim = ENTRY_ANIMATIONS[name as keyof typeof ENTRY_ANIMATIONS];
      return `
    #### ${anim.name}
    - **Initial State**: \`${anim.initial}\`
    - **Final State**: \`${anim.final}\`
    - **Duration**: ${anim.duration}
    - **Easing**: ${anim.easing}
    - **Stagger**: ${anim.stagger}
    - **Description**: ${anim.description}
    `;
    }).join('')}
    
    ---
    
    ## Scroll Animations
    
    ### Active Effects
    ${scrollAnims.map(name => {
      const anim = SCROLL_ANIMATIONS[name as keyof typeof SCROLL_ANIMATIONS];
      return `
    #### ${anim.name}
    - **Description**: ${anim.description}
    - **Use Case**: ${anim.useCase}
    `;
    }).join('')}
    
    ### Implementation Notes
    - Use Intersection Observer for scroll-triggered animations
    - Trigger animations when element is 20-30% in viewport
    - Consider scroll velocity for parallax effects
    - Debounce scroll handlers for performance
    
    ---
    
    ## Hover & Interaction Effects
    
    ### Active Effects
    ${hoverAnims.map(name => {
      const anim = HOVER_ANIMATIONS[name as keyof typeof HOVER_ANIMATIONS];
      return `
    #### ${anim.name}
    - **Effect**: \`${anim.effect}\`
    - **Duration**: ${anim.duration}
    - **Description**: ${anim.description}
    - **Use Case**: ${anim.useCase}
    `;
    }).join('')}
    
    ---
    
    ## Loading States
    
    ### Recommended Loaders
    ${Object.entries(LOADING_ANIMATIONS).slice(0, 4).map(([key, anim]) => `
    #### ${anim.name}
    - **Effect**: ${anim.effect}
    - **Implementation**: ${anim.implementation}
    - **Use Case**: ${anim.useCase}
    `).join('')}
    
    ---
    
    ## Section-by-Section Choreography
    
    ${sectionSpecs.map(spec => `
    ### ${spec.element}
    - **Trigger**: ${spec.trigger}
    - **Animation**: ${spec.type}
    - **Duration**: ${spec.duration}
    - **Delay**: ${spec.delay}
    - **Purpose**: ${spec.description}
    `).join('')}
    
    ---
    
    ## Transition Choreography
    
    ### Staggered Reveals
    ${TRANSITION_CHOREOGRAPHY.staggeredFade.description}
    - Timing: ${TRANSITION_CHOREOGRAPHY.staggeredFade.timing}
    - Direction: ${TRANSITION_CHOREOGRAPHY.staggeredFade.direction}
    
    ### Page/View Transitions
    ${TRANSITION_CHOREOGRAPHY.exitThenEnter.description}
    - Timing: ${TRANSITION_CHOREOGRAPHY.exitThenEnter.timing}
    - Direction: ${TRANSITION_CHOREOGRAPHY.exitThenEnter.direction}
    
    ---
    
    ## Easing Reference
    
    ${Object.entries(EASING_FUNCTIONS).map(([key, easing]) => `
    ### ${easing.name}
    - **CSS**: \`${easing.css}\`
    - **Feel**: ${easing.description}
    - **Use For**: ${easing.useCase}
    `).join('')}
    
    ---
    
    ${generateCSSVariables(intensity)}
    
    ${generateKeyframeExamples(intensity)}
    
    ---
    
    ## Performance Guidelines
    
    ### GPU-Accelerated Properties
    Only animate these for 60fps performance:
    - \`transform\` (translate, scale, rotate)
    - \`opacity\`
    - \`filter\` (blur, brightness)
    
    ### Avoid Animating
    - \`width\`, \`height\` (use transform: scale instead)
    - \`top\`, \`left\`, \`right\`, \`bottom\` (use transform: translate)
    - \`margin\`, \`padding\` (causes layout recalculation)
    - \`border-width\` (use box-shadow or pseudo-elements)
    
    ### Optimization Tips
    1. Use \`will-change\` sparingly for complex animations
    2. Use \`transform: translateZ(0)\` to force GPU layer
    3. Debounce scroll-based animations
    4. Use Intersection Observer, not scroll events
    5. Prefer CSS animations over JavaScript when possible
    
    ---
    
    ## Accessibility: Reduced Motion
    
    Always provide reduced motion alternatives:
    
    \`\`\`css
    @media (prefers-reduced-motion: reduce) {
      /* Replace motion with instant/fade transitions */
      .animated-element {
        animation: none;
        transition: opacity 0.2s ease;
      }
      
      /* Disable parallax and scroll-jacking */
      .parallax {
        transform: none !important;
      }
    }
    \`\`\`
    
    ---
    
    *These animation specifications are designed to create a cohesive, polished feel that elevates the interface beyond typical AI-generated designs.*
    `;
    }
  • Zod validation schema (ComposeAnimationsSchema) used for parsing tool arguments in the server dispatch handler.
    const ComposeAnimationsSchema = z.object({
      interfaceType: z.enum([
        'website-landing', 'website-saas', 'website-portfolio', 'website-ecommerce',
        'dashboard', 'mobile-app', 'desktop-app', 'cli-terminal', 'presentation',
        'admin-panel', 'social-platform', 'custom'
      ]).describe('Type of interface'),
      intensity: z.enum(['subtle', 'moderate', 'dramatic', 'cinematic'])
        .describe('Animation intensity level'),
      sections: z.array(z.string()).optional().describe('Specific sections to animate'),
      customRequirements: z.string().optional().describe('Additional animation requirements'),
    });
  • TypeScript interface definition for AnimationCompositionInput, defining the expected input structure for the handler function.
    interface AnimationCompositionInput {
      interfaceType: InterfaceType;
      intensity: AnimationIntensity;
      sections?: string[];
      customRequirements?: string;
    }
  • src/server.ts:168-193 (registration)
    Tool registration in the ListToolsRequestSchema handler, defining the name 'compose_animations', description, and inputSchema for MCP tool listing.
    {
      name: 'compose_animations',
      description: 'Generate detailed animation specifications including entry animations, scroll effects, hover states, loading animations, and transition choreography with CSS code examples.',
      inputSchema: {
        type: 'object',
        properties: {
          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: 'Type of interface'
          },
          intensity: {
            type: 'string',
            enum: ['subtle', 'moderate', 'dramatic', 'cinematic'],
            description: 'Animation intensity level'
          },
          sections: {
            type: 'array',
            items: { type: 'string' },
            description: 'Specific sections to animate'
          },
          customRequirements: { type: 'string', description: 'Additional animation requirements' }
        },
        required: ['interfaceType', 'intensity']
      }
    },
  • src/server.ts:286-295 (registration)
    Dispatch logic in the CallToolRequestSchema handler's switch statement, where tool calls to 'compose_animations' are parsed with the schema and delegated to the composeAnimations function.
    case 'compose_animations': {
      const parsed = ComposeAnimationsSchema.parse(args);
      const result = composeAnimations({
        interfaceType: parsed.interfaceType as InterfaceType,
        intensity: parsed.intensity as AnimationIntensity,
        sections: parsed.sections,
        customRequirements: parsed.customRequirements,
      });
      return { content: [{ type: 'text', text: result }] };
    }
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 generating 'CSS code examples' but doesn't cover critical aspects like output format, whether this is a read-only generation tool or if it modifies data, potential rate limits, authentication needs, or error handling. For a tool with no annotation coverage, this leaves significant gaps in understanding its behavior.

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

Conciseness4/5

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

The description is a single, efficient sentence that front-loads the core purpose ('Generate detailed animation specifications') and lists key components. It avoids redundancy and wastes no words, though it could be slightly more structured by separating usage context from output details.

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 tool's complexity (generating animation specs with CSS examples), lack of annotations, and no output schema, the description is incomplete. It doesn't explain what the output looks like (e.g., structured specs, code snippets), how comprehensive the generation is, or any limitations. This leaves the agent guessing about critical behavioral aspects.

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?

Schema description coverage is 100%, so the schema already documents all 4 parameters with descriptions and enums. The description adds no additional meaning beyond what's in the schema—it doesn't explain how parameters like 'interfaceType' or 'intensity' affect the output, nor does it provide examples or constraints. Baseline 3 is appropriate when the schema does the heavy lifting.

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: 'Generate detailed animation specifications' with specific components listed (entry animations, scroll effects, hover states, etc.). It uses a specific verb ('Generate') and identifies the resource ('animation specifications'), but doesn't explicitly differentiate from sibling tools like 'analyze_interface' or 'generate_ux_flow' which might overlap in UI/UX domains.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'analyze_interface' or 'generate_ux_flow', nor does it specify prerequisites, exclusions, or appropriate contexts for animation generation versus other UI/UX tasks.

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