Skip to main content
Glama
junmer

LottieFiles MCP Server

get_popular_animations

Retrieve trending Lottie animations to discover popular motion graphics for your projects.

Instructions

Get a list of currently popular Lottie animations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number, starting from 1
limitNoNumber of items per page

Implementation Reference

  • Executes the 'get_popular_animations' MCP tool by calling the API client to fetch popular animations and returning a formatted JSON response.
    case "get_popular_animations":
      const popular = await this.apiClient.getPopularAnimations(
        args?.page as number,
        args?.limit as number
      );
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(
              {
                count: popular.length,
                popular: popular,
              },
              null,
              2
            ),
          },
        ],
      };
  • Performs the actual HTTP API call to the LottieFiles endpoint to retrieve popular animations data.
    async getPopularAnimations(page: number = 1, limit: number = 20) {
      try {
        const response = await this.axiosInstance.get(
          `${this.baseUrl}/iconscout/popular-animations-weekly?api=%26sort%3Dpopular`,
          {
            params: {
              page,
              limit,
            },
          }
        );
    
        return response.data.popularWeeklyData.data;
      } catch (error) {
        if (error instanceof Error) {
          throw new Error(`Failed to get popular animations: ${error.message}`);
        }
        throw new Error("Failed to get popular animations: Unknown error");
      }
    }
  • Registers the 'get_popular_animations' tool in the MCP listTools method, defining its name, description, and input JSON schema.
    {
      name: "get_popular_animations",
      description: "Get a list of currently popular Lottie animations.",
      inputSchema: {
        type: "object",
        properties: {
          page: {
            type: "integer",
            description: "Page number, starting from 1",
            minimum: 1,
            default: 1,
          },
          limit: {
            type: "integer",
            description: "Number of items per page",
            minimum: 1,
            maximum: 100,
            default: 20,
          },
        },
      },
    },
  • TypeScript interface defining the input parameters for getPopularAnimations.
    export interface GetPopularAnimationsParams {
      page?: number;
      limit?: number;
    }
  • TypeScript interface defining the response structure for getPopularAnimations.
    export interface GetPopularAnimationsResponse {
      animations: LottieAnimation[];
      total: number;
      page: number;
      limit: number;
    }

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/junmer/mcp-server-lottiefiles'

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