Skip to main content
Glama
glorynguyen

Ultimate GSAP Master MCP Server

by glorynguyen

understand_and_create_animation

Generate production-ready GSAP animation code from natural language descriptions for web development projects. Supports multiple frameworks and complexity levels.

Instructions

The main AI engine - understands any animation request and generates perfect GSAP code with surgical precision

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestYesNatural language description of the animation you want (e.g., "fade in cards one by one when scrolling", "create a hero entrance with staggered text")
contextNoDevelopment context and requirementsreact
complexityNoAnimation complexity levelintermediate

Implementation Reference

  • index.ts:1339-1363 (registration)
    Tool registration in ListToolsRequestSchema handler - defines the tool name, description, and input schema with properties for request, context, and complexity
      name: 'understand_and_create_animation',
      description: 'The main AI engine - understands any animation request and generates perfect GSAP code with surgical precision',
      inputSchema: {
        type: 'object',
        properties: {
          request: {
            type: 'string',
            description: 'Natural language description of the animation you want (e.g., "fade in cards one by one when scrolling", "create a hero entrance with staggered text")'
          },
          context: {
            type: 'string',
            description: 'Development context and requirements',
            enum: ['react', 'vanilla', 'nextjs', 'vue', 'performance-critical', 'mobile-optimized'],
            default: 'react'
          },
          complexity: {
            type: 'string',
            description: 'Animation complexity level',
            enum: ['simple', 'intermediate', 'advanced', 'expert'],
            default: 'intermediate'
          }
        },
        required: ['request']
      }
    },
  • Input schema definition for the tool - defines the required 'request' parameter and optional 'context' and 'complexity' parameters with their types and enums
    inputSchema: {
      type: 'object',
      properties: {
        request: {
          type: 'string',
          description: 'Natural language description of the animation you want (e.g., "fade in cards one by one when scrolling", "create a hero entrance with staggered text")'
        },
        context: {
          type: 'string',
          description: 'Development context and requirements',
          enum: ['react', 'vanilla', 'nextjs', 'vue', 'performance-critical', 'mobile-optimized'],
          default: 'react'
        },
        complexity: {
          type: 'string',
          description: 'Animation complexity level',
          enum: ['simple', 'intermediate', 'advanced', 'expert'],
          default: 'intermediate'
        }
      },
      required: ['request']
    }
  • Main handler function that executes the tool - performs intent analysis, generates appropriate GSAP code based on detected patterns (scroll, text, interactive), and returns formatted response with AI-generated animation code
          case 'understand_and_create_animation': {
            const userRequest = args?.request as string;
            const context = args?.context as string || 'react';
            const complexity = args?.complexity as string || 'intermediate';
            
            if (!userRequest) {
              throw new Error('Animation request is required');
            }
    
            // Advanced intent analysis
            const analysis = INTENT_ANALYZER.analyze(userRequest);
            
            if (analysis.length === 0) {
              return {
                content: [{
                  type: 'text',
                  text: `# Animation Request Analysis
    
    I need more specific details to create the perfect animation. Could you describe:
    
    **What elements should animate?** (buttons, cards, text, images, etc.)
    **When should it trigger?** (page load, scroll, hover, click, etc.)  
    **What kind of movement?** (fade, slide, scale, rotate, etc.)
    
    ## Examples of clear requests:
    - *"Fade in portfolio cards one by one when scrolling into view"*
    - *"Create a hero title that reveals character by character on page load"*
    - *"Build a smooth hover effect for navigation buttons"*
    - *"Make an interactive drag system for image gallery"*
    
    ## I can create animations for:
    ✨ **Scroll-based effects** - Parallax, reveals, pins, scrubbing
    šŸŽ­ **Text animations** - Character reveals, typewriter, morphing  
    šŸŽÆ **Interactive elements** - Hover, click, drag, touch gestures
    šŸŽ¬ **Complex sequences** - Timelines, choreographed animations
    ⚔ **Performance critical** - 60fps, mobile-optimized, efficient
    
    Just describe what you want in natural language and I'll generate production-ready code!`
                }]
              };
            }
    
            const primaryIntent = analysis[0];
            let generatedCode = '';
    
            // Generate appropriate code based on detected intent
            if (primaryIntent.pattern === 'scroll_based') {
              generatedCode = CODE_GENERATORS.generateScrollAnimation(userRequest, context);
            } else if (primaryIntent.pattern === 'text_animations') {
              generatedCode = CODE_GENERATORS.generateTextAnimation(userRequest, context);
            } else if (primaryIntent.pattern === 'interactive') {
              generatedCode = CODE_GENERATORS.generateInteractiveAnimation(userRequest, context);
            } else {
              // Default to entrance animation with detected techniques
              generatedCode = CODE_GENERATORS.generateScrollAnimation(userRequest, context);
            }
    
            let result = `# šŸŽÆ AI-Generated GSAP Animation\n\n`;
            result += `**Your Request**: "${userRequest}"\n\n`;
            result += `**🧠 AI Analysis**:\n`;
            result += `- **Primary Intent**: ${primaryIntent.pattern} (${(primaryIntent.confidence * 100).toFixed(1)}% confidence)\n`;
            result += `- **Detected Keywords**: ${primaryIntent.matches.join(', ')}\n`;
            result += `- **Recommended Techniques**: ${primaryIntent.techniques.join(', ')}\n`;
            result += `- **Best Practices Applied**: ${primaryIntent.best_practices.join(', ')}\n\n`;
            
            result += `**āš™ļø Configuration**:\n`;
            result += `- **Framework**: ${context}\n`;
            result += `- **Complexity**: ${complexity}\n`;
            result += `- **Performance**: 60fps optimized\n`;
            result += `- **Responsive**: Mobile-friendly\n\n`;
            
            result += generatedCode;
            
            result += `\n\n## šŸš€ Production Features Included:\n`;
            result += `- āœ… **Performance**: GPU acceleration, memory cleanup\n`;
            result += `- āœ… **Responsive**: Adapts to all screen sizes\n`;
            result += `- āœ… **Accessibility**: Respects user motion preferences\n`;
            result += `- āœ… **Browser Support**: Modern browsers + IE11 with polyfills\n`;
            result += `- āœ… **Framework Ready**: ${context} integration included\n`;
            result += `- āœ… **Production Tested**: Battle-tested patterns and techniques\n\n`;
            
            result += `## šŸŽØ Customization Options:\n`;
            result += `- **Timing**: Adjust \`duration\` and \`stagger\` values\n`;
            result += `- **Easing**: Try \`"power3.out"\`, \`"elastic.out(1, 0.3)"\`, \`"back.out(1.7)"\`\n`;
            result += `- **Triggers**: Modify \`start\` and \`end\` positions for ScrollTrigger\n`;
            result += `- **Effects**: Combine multiple properties for unique animations\n\n`;
            
            result += `*Generated with surgical precision by GSAP Master AI* ⚔`;
    
            return {
              content: [{ type: 'text', text: result }]
            };
          }
  • Core logic within handler that analyzes user intent using INTENT_ANALYZER.analyze() and routes to appropriate code generators (generateScrollAnimation, generateTextAnimation, or generateInteractiveAnimation) based on detected patterns
            // Advanced intent analysis
            const analysis = INTENT_ANALYZER.analyze(userRequest);
            
            if (analysis.length === 0) {
              return {
                content: [{
                  type: 'text',
                  text: `# Animation Request Analysis
    
    I need more specific details to create the perfect animation. Could you describe:
    
    **What elements should animate?** (buttons, cards, text, images, etc.)
    **When should it trigger?** (page load, scroll, hover, click, etc.)  
    **What kind of movement?** (fade, slide, scale, rotate, etc.)
    
    ## Examples of clear requests:
    - *"Fade in portfolio cards one by one when scrolling into view"*
    - *"Create a hero title that reveals character by character on page load"*
    - *"Build a smooth hover effect for navigation buttons"*
    - *"Make an interactive drag system for image gallery"*
    
    ## I can create animations for:
    ✨ **Scroll-based effects** - Parallax, reveals, pins, scrubbing
    šŸŽ­ **Text animations** - Character reveals, typewriter, morphing  
    šŸŽÆ **Interactive elements** - Hover, click, drag, touch gestures
    šŸŽ¬ **Complex sequences** - Timelines, choreographed animations
    ⚔ **Performance critical** - 60fps, mobile-optimized, efficient
    
    Just describe what you want in natural language and I'll generate production-ready code!`
                }]
              };
            }
    
            const primaryIntent = analysis[0];
            let generatedCode = '';
    
            // Generate appropriate code based on detected intent
            if (primaryIntent.pattern === 'scroll_based') {
              generatedCode = CODE_GENERATORS.generateScrollAnimation(userRequest, context);
            } else if (primaryIntent.pattern === 'text_animations') {
              generatedCode = CODE_GENERATORS.generateTextAnimation(userRequest, context);
            } else if (primaryIntent.pattern === 'interactive') {
              generatedCode = CODE_GENERATORS.generateInteractiveAnimation(userRequest, context);
            } else {
              // Default to entrance animation with detected techniques
              generatedCode = CODE_GENERATORS.generateScrollAnimation(userRequest, context);
            }
  • Response formatting logic that constructs the final AI-generated output with analysis results, configuration details, generated code, and production features
    let result = `# šŸŽÆ AI-Generated GSAP Animation\n\n`;
    result += `**Your Request**: "${userRequest}"\n\n`;
    result += `**🧠 AI Analysis**:\n`;
    result += `- **Primary Intent**: ${primaryIntent.pattern} (${(primaryIntent.confidence * 100).toFixed(1)}% confidence)\n`;
    result += `- **Detected Keywords**: ${primaryIntent.matches.join(', ')}\n`;
    result += `- **Recommended Techniques**: ${primaryIntent.techniques.join(', ')}\n`;
    result += `- **Best Practices Applied**: ${primaryIntent.best_practices.join(', ')}\n\n`;
    
    result += `**āš™ļø Configuration**:\n`;
    result += `- **Framework**: ${context}\n`;
    result += `- **Complexity**: ${complexity}\n`;
    result += `- **Performance**: 60fps optimized\n`;
    result += `- **Responsive**: Mobile-friendly\n\n`;
    
    result += generatedCode;
    
    result += `\n\n## šŸš€ Production Features Included:\n`;
    result += `- āœ… **Performance**: GPU acceleration, memory cleanup\n`;
    result += `- āœ… **Responsive**: Adapts to all screen sizes\n`;
    result += `- āœ… **Accessibility**: Respects user motion preferences\n`;
    result += `- āœ… **Browser Support**: Modern browsers + IE11 with polyfills\n`;
    result += `- āœ… **Framework Ready**: ${context} integration included\n`;
    result += `- āœ… **Production Tested**: Battle-tested patterns and techniques\n\n`;
    
    result += `## šŸŽØ Customization Options:\n`;
    result += `- **Timing**: Adjust \`duration\` and \`stagger\` values\n`;
    result += `- **Easing**: Try \`"power3.out"\`, \`"elastic.out(1, 0.3)"\`, \`"back.out(1.7)"\`\n`;
    result += `- **Triggers**: Modify \`start\` and \`end\` positions for ScrollTrigger\n`;
    result += `- **Effects**: Combine multiple properties for unique animations\n\n`;
    
    result += `*Generated with surgical precision by GSAP Master AI* ⚔`;
    
    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 'generates perfect GSAP code' but doesn't clarify output format, error handling, rate limits, or authentication needs. For a tool with no annotations and no output schema, 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. It avoids unnecessary words and gets straight to the point. However, it could be slightly more structured by explicitly mentioning key parameters or output, but it's appropriately concise for its content.

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 (a code-generation tool with no annotations and no output schema), the description is incomplete. It doesn't explain what the output looks like (e.g., code snippets, files), error cases, or integration details. For a tool that 'generates' something, more context on the result is needed 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?

Schema description coverage is 100%, so the schema already documents all three parameters thoroughly. The description adds no additional meaning about parameters beyond implying they relate to animation requests. Since the schema does the heavy lifting, the baseline score of 3 is appropriate, as the description doesn't compensate with extra insights.

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: 'understands any animation request and generates perfect GSAP code with surgical precision.' It specifies the verb ('understands and generates'), resource ('GSAP code'), and quality ('with surgical precision'). However, it doesn't explicitly differentiate from siblings like 'create_production_pattern' or 'generate_complete_setup,' which might have overlapping functions.

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 'debug_animation_issue' or 'optimize_for_performance,' nor does it specify contexts or prerequisites for usage. The agent must infer usage from the tool name and description alone.

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/glorynguyen/gsap-mcp'

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