Skip to main content
Glama

animation_preview

Generate previews of animation sequences in GIF, MP4, or WebM formats to visualize and validate motion designs during UI/UX development workflows.

Instructions

Generate preview of animation sequence

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
timelineYes
formatNogif

Implementation Reference

  • The handler function that implements the core logic of the 'animation_preview' tool. It validates the input using AnimationPreviewSchema, simulates generating a preview video/GIF from the animation timeline, computes duration using helper, and returns structured JSON response with preview metadata.
    async preview(args: any) {
      const params = AnimationPreviewSchema.parse(args);
      
      try {
        // Simulate animation preview generation
        const previewData = {
          format: params.format,
          duration: this.getTimelineDuration(params.timeline),
          frames: params.format === 'gif' ? 30 : 60,
          size: {
            width: 800,
            height: 600
          },
          preview: {
            url: `preview_${Date.now()}.${params.format}`,
            message: 'Preview generated successfully (simulated)'
          }
        };
    
        return {
          content: [
            {
              type: 'text',
              text: JSON.stringify(previewData, null, 2)
            }
          ]
        };
      } catch (error: any) {
        return {
          content: [
            {
              type: 'text',
              text: `Error generating preview: ${error.message}`
            }
          ],
          isError: true
        };
      }
    }
  • Zod schema defining the input structure for the animation_preview tool: requires a timeline object and optional format (gif/mp4/webm). Used for validation in the handler.
    const AnimationPreviewSchema = z.object({
      timeline: z.any(),
      format: z.enum(['gif', 'mp4', 'webm']).default('gif')
    });
  • src/index.ts:316-317 (registration)
    Switch case in tool execution handler that routes calls to 'animation_preview' to the AnimationTools.preview method.
    case 'animation_preview':
      return await this.animationTools.preview(args);
  • src/index.ts:148-163 (registration)
    Static registration of the 'animation_preview' tool in the listTools response, including name, description, and input schema matching the Zod schema.
    {
      name: 'animation_preview',
      description: 'Generate preview of animation sequence',
      inputSchema: {
        type: 'object',
        properties: {
          timeline: { type: 'object' },
          format: { 
            type: 'string',
            enum: ['gif', 'mp4', 'webm'],
            default: 'gif'
          }
        },
        required: ['timeline']
      }
    },
  • Helper method used by the preview handler to calculate the total duration of the animation timeline based on library type.
    private getTimelineDuration(timeline: any): number {
      if (timeline?.type === 'framer-motion') {
        return Object.keys(timeline.variants || {}).length * 0.3;
      } else if (timeline?.type === 'gsap') {
        return (timeline.timeline || []).length * 0.3;
      }
      return 1;
    }
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 'generate preview' but doesn't specify whether this is a read-only operation, if it requires specific permissions, what the output looks like (e.g., file format, size), or any side effects like resource consumption. This is inadequate for a tool with no annotation coverage.

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 extremely concise with a single sentence ('Generate preview of animation sequence'), front-loaded and without any wasted words. Every part of the sentence contributes directly to the tool's purpose, making it efficient and easy to parse.

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 (2 parameters including a nested object), no annotations, no output schema, and 0% schema description coverage, the description is incomplete. It doesn't address key aspects like parameter usage, output format, or behavioral traits, leaving significant gaps for the agent to understand how to invoke the tool 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?

The description adds no meaning beyond the input schema, which has 0% description coverage. It doesn't explain what 'timeline' or 'format' parameters represent, their expected structure, or how they affect the preview generation. With two parameters and no schema descriptions, the description fails to compensate for the coverage gap.

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 preview') and the resource ('animation sequence'), providing a specific verb+resource combination. However, it doesn't differentiate from sibling tools like 'animation_create_timeline' or 'playwright_capture_screenshots', which might also involve animation or preview generation in different contexts.

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. There are no explicit instructions on prerequisites, context, or comparisons to sibling tools such as 'animation_create_timeline' or 'playwright_capture_screenshots', leaving the agent to infer usage based on the name 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/willem4130/ui-ux-mcp-server'

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