Skip to main content
Glama
glorynguyen

Ultimate GSAP Master MCP Server

by glorynguyen

get_gsap_api_expert

Retrieve expert-level knowledge on any GSAP API element, from basic to expert detail.

Instructions

Deep dive into any GSAP method, plugin, or property with expert-level knowledge

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
api_elementYesGSAP API element (e.g., "gsap.to", "ScrollTrigger", "SplitText", "drawSVG", "morphSVG")
levelNoDetail level neededadvanced

Implementation Reference

  • The 'get_gsap_api_expert' tool handler - processes requests to look up GSAP API elements (core methods or plugins) from the GSAP_COMPLETE_API database and returns detailed expert-level information including descriptions, syntax, parameters, examples, and performance tips.
    case 'get_gsap_api_expert': {
      const apiElement = args?.api_element as string;
      const level = args?.level as string || 'advanced';
      
      if (!apiElement) {
        throw new Error('API element is required');
      }
    
      const api = apiElement.toLowerCase();
      let result = `# 🎯 GSAP API Expert: ${apiElement}\n\n`;
    
      // Search through comprehensive API database
      if (GSAP_COMPLETE_API.CORE_METHODS[api as keyof typeof GSAP_COMPLETE_API.CORE_METHODS]) {
        const method = GSAP_COMPLETE_API.CORE_METHODS[api as keyof typeof GSAP_COMPLETE_API.CORE_METHODS];
        result += `**Type**: Core Animation Method\n`;
        result += `**Description**: ${method.description}\n`;
        result += `**Syntax**: \`${method.syntax}\`\n\n`;
        
        if ('parameters' in method && method.parameters) {
          result += `## Parameters\n`;
          for (const [param, desc] of Object.entries(method.parameters)) {
            result += `- **${param}**: ${desc}\n`;
          }
          result += '\n';
        }
        
        result += `## Examples\n\n`;
        for (const [type, example] of Object.entries(method.examples)) {
          result += `### ${type.charAt(0).toUpperCase() + type.slice(1)}\n`;
          result += `\`\`\`javascript\n${example}\n\`\`\`\n\n`;
        }
        
        if ('properties' in method && method.properties) {
          result += `## Animatable Properties\n`;
          result += `${method.properties.join(', ')}\n\n`;
        }
        
        if ('performance_tips' in method && method.performance_tips) {
          result += `## Performance Tips\n`;
          method.performance_tips.forEach((tip: string) => {
            result += `- ${tip}\n`;
          });
        }
      } else if (GSAP_COMPLETE_API.PLUGINS[apiElement as keyof typeof GSAP_COMPLETE_API.PLUGINS] || GSAP_COMPLETE_API.PLUGINS[apiElement.replace('Plugin', '') as keyof typeof GSAP_COMPLETE_API.PLUGINS]) {
        const pluginKey = GSAP_COMPLETE_API.PLUGINS[apiElement as keyof typeof GSAP_COMPLETE_API.PLUGINS] ? apiElement : apiElement.replace('Plugin', '');
        const plugin = GSAP_COMPLETE_API.PLUGINS[pluginKey as keyof typeof GSAP_COMPLETE_API.PLUGINS];
        
        result += `**Type**: Plugin (${plugin.category})\n`;
        result += `**Description**: ${plugin.description}\n\n`;
        
        if ('methods' in plugin && plugin.methods) {
          result += `## Methods\n`;
          if (typeof plugin.methods === 'object') {
            for (const [method, desc] of Object.entries(plugin.methods)) {
              result += `- **${method}**: ${desc}\n`;
            }
          } else if (Array.isArray(plugin.methods)) {
            (plugin.methods as string[]).forEach((method: string) => {
              result += `- ${method}\n`;
            });
          }
          result += '\n';
        }
        
        if ('properties' in plugin && plugin.properties) {
          result += `## Properties\n`;
          if (typeof plugin.properties === 'object' && !Array.isArray(plugin.properties)) {
            for (const [prop, desc] of Object.entries(plugin.properties)) {
              result += `- **${prop}**: ${desc}\n`;
            }
          } else if (Array.isArray(plugin.properties)) {
            (plugin.properties as string[]).forEach((prop: string) => {
              result += `- ${prop}\n`;
            });
          }
          result += '\n';
        }
        
        if ('examples' in plugin && plugin.examples) {
          result += `## Examples\n\n`;
          for (const [name, code] of Object.entries(plugin.examples)) {
            result += `### ${name.replace(/_/g, ' ').replace(/\b\w/g, l => l.toUpperCase())}\n`;
            result += `\`\`\`javascript\n${code}\n\`\`\`\n\n`;
          }
        }
        
        if ('performance_optimization' in plugin && plugin.performance_optimization) {
          result += `## Performance Optimization\n`;
          (plugin.performance_optimization as string[]).forEach((tip: string) => {
            result += `- ${tip}\n`;
          });
        }
      } else {
        result += `API element "${apiElement}" not found in the comprehensive database.\n\n`;
        result += `## Available Core Methods:\n`;
        result += Object.keys(GSAP_COMPLETE_API.CORE_METHODS).join(', ') + '\n\n';
        result += `## Available Plugins:\n`;
        result += Object.keys(GSAP_COMPLETE_API.PLUGINS).join(', ') + '\n\n';
        result += `## Did you mean?\n`;
        
        // Simple fuzzy matching
        const allApis = [...Object.keys(GSAP_COMPLETE_API.CORE_METHODS), ...Object.keys(GSAP_COMPLETE_API.PLUGINS)];
        const suggestions = allApis.filter(api => 
          api.toLowerCase().includes(apiElement.toLowerCase()) || 
          apiElement.toLowerCase().includes(api.toLowerCase())
        );
        
        if (suggestions.length > 0) {
          result += `Possible matches: ${suggestions.join(', ')}`;
        }
      }
    
      return {
        content: [{ type: 'text', text: result }]
      };
    }
  • Input schema definition for the 'get_gsap_api_expert' tool, specifying 'api_element' (required string) and 'level' (optional enum: basic/intermediate/advanced/expert) parameters.
    {
      name: 'get_gsap_api_expert',
      description: 'Deep dive into any GSAP method, plugin, or property with expert-level knowledge',
      inputSchema: {
        type: 'object',
        properties: {
          api_element: {
            type: 'string',
            description: 'GSAP API element (e.g., "gsap.to", "ScrollTrigger", "SplitText", "drawSVG", "morphSVG")'
          },
          level: {
            type: 'string',
            description: 'Detail level needed',
            enum: ['basic', 'intermediate', 'advanced', 'expert'],
            default: 'advanced'
          }
        },
        required: ['api_element']
      }
    },
  • index.ts:1335-1479 (registration)
    Tool registration in the ListToolsRequestSchema handler, where 'get_gsap_api_expert' is listed among the tools with its name, description, and inputSchema.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          {
            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']
            }
          },
          {
            name: 'get_gsap_api_expert',
            description: 'Deep dive into any GSAP method, plugin, or property with expert-level knowledge',
            inputSchema: {
              type: 'object',
              properties: {
                api_element: {
                  type: 'string',
                  description: 'GSAP API element (e.g., "gsap.to", "ScrollTrigger", "SplitText", "drawSVG", "morphSVG")'
                },
                level: {
                  type: 'string',
                  description: 'Detail level needed',
                  enum: ['basic', 'intermediate', 'advanced', 'expert'],
                  default: 'advanced'
                }
              },
              required: ['api_element']
            }
          },
          {
            name: 'generate_complete_setup',
            description: 'Generate complete GSAP environment setup with all plugins and optimizations',
            inputSchema: {
              type: 'object',
              properties: {
                framework: {
                  type: 'string',
                  description: 'Target framework',
                  enum: ['react', 'nextjs', 'vue', 'nuxt', 'svelte', 'vanilla'],
                  default: 'react'
                },
                plugins: {
                  type: 'array',
                  description: 'Specific plugins needed',
                  items: {
                    type: 'string',
                    enum: ['ScrollTrigger', 'SplitText', 'DrawSVGPlugin', 'MorphSVGPlugin', 'MotionPathPlugin', 'Draggable', 'InertiaPlugin', 'Flip', 'Observer', 'CustomEase', 'GSDevTools', 'Lenis']
                  }
                },
                performance_level: {
                  type: 'string',
                  description: 'Performance optimization level',
                  enum: ['basic', 'optimized', '60fps-guaranteed', 'mobile-first'],
                  default: 'optimized'
                }
              },
              required: ['framework']
            }
          },
          {
            name: 'debug_animation_issue',
            description: 'Expert debugging for GSAP animation problems with solutions',
            inputSchema: {
              type: 'object',
              properties: {
                issue: {
                  type: 'string',
                  description: 'Description of the animation problem or unexpected behavior'
                },
                code: {
                  type: 'string',
                  description: 'Problematic animation code (optional but helpful)'
                },
                expected_behavior: {
                  type: 'string',
                  description: 'What should happen vs what is happening'
                }
              },
              required: ['issue']
            }
          },
          {
            name: 'optimize_for_performance',
            description: 'Transform any animation into 60fps smoothness with expert optimizations',
            inputSchema: {
              type: 'object',
              properties: {
                animation_code: {
                  type: 'string',
                  description: 'Existing GSAP animation code to optimize'
                },
                target: {
                  type: 'string',
                  description: 'Optimization target',
                  enum: ['60fps-desktop', 'mobile-smooth', 'battery-efficient', 'memory-optimized'],
                  default: '60fps-desktop'
                }
              },
              required: ['animation_code']
            }
          },
          {
            name: 'create_production_pattern',
            description: 'Generate battle-tested, production-ready animation patterns',
            inputSchema: {
              type: 'object',
              properties: {
                pattern_type: {
                  type: 'string',
                  description: 'Type of production pattern needed',
                  enum: ['hero-section', 'scroll-system', 'text-effects', 'interactive-ui', 'loading-sequence', 'page-transitions', 'micro-interactions', 'data-visualization']
                },
                industry: {
                  type: 'string',
                  description: 'Industry or use case',
                  enum: ['portfolio', 'ecommerce', 'saas', 'agency', 'blog', 'app', 'game'],
                  default: 'portfolio'
                }
              },
              required: ['pattern_type']
            }
          }
        ]
      };
    });
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. It only says 'deep dive' but does not disclose the output format (e.g., text, structured data), whether it is read-only, or any side effects, auth requirements, or rate limits. The agent has little transparency into the tool's behavior.

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 concise sentence that front-loads the purpose. No filler or redundant information.

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 that there is no output schema and the tool is about expert-level knowledge, the description is too short. It does not explain what 'expert-level knowledge' entails or the format of the response. The agent lacks context on the depth and structure of the information returned.

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 covers 100% of parameters with descriptions: 'api_element' is described with examples (e.g., 'gsap.to', 'ScrollTrigger') and 'level' has an enum. The description adds no additional meaning beyond the schema, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Deep dive into any GSAP method, plugin, or property with expert-level knowledge' clearly states the tool's purpose: providing expert information on GSAP APIs. It distinguishes well from sibling tools like debug_animation_issue or create_production_pattern, which focus on debugging or creating animations.

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

Usage Guidelines3/5

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

The description implies use when expert-level knowledge on a specific GSAP API element is needed, but it does not explicitly state when to use or not use this tool compared to siblings. No alternative tools or exclusions are mentioned.

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