search_animations
Find Lottie animations by keywords, tags, or descriptions with pagination support on the LottieFiles MCP Server.
Instructions
Search for Lottie animations by keywords, tags, and other criteria. Supports pagination.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of items per page | |
| page | No | Page number, starting from 1 | |
| query | No | Search keywords that match animation names, descriptions, tags, etc. |
Implementation Reference
- src/handlers/ToolHandler.ts:87-108 (handler)Executes the search_animations tool by calling LottieApiClient.searchAnimations with query, page, and limit parameters, then formats and returns the results as JSON text content.case "search_animations": const list = await this.apiClient.searchAnimations( args?.query as string, args?.page as number, args?.limit as number ); return { content: [ { type: "text", text: JSON.stringify( { count: list.length, animations: list, }, null, 2 ), }, ], };
- src/handlers/ToolHandler.ts:14-41 (registration)Registers the search_animations tool in the listTools method, including name, description, and detailed input schema.{ name: "search_animations", description: "Search for Lottie animations by keywords, tags, and other criteria. Supports pagination.", inputSchema: { type: "object", properties: { query: { type: "string", description: "Search keywords that match animation names, descriptions, tags, etc.", }, 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, }, }, }, },
- src/api/LottieApiClient.ts:17-35 (helper)Core helper method that performs the HTTP request to the LottieFiles API to search for animations based on query, page, and limit.async searchAnimations(query: string, page: number = 1, limit: number = 20) { try { const response = await this.axiosInstance.get( `${this.baseUrl}/search/get-animations`, { params: { query, page, limit, }, } ); return response.data.data.data; } catch (error) { if (error instanceof Error) { throw new Error(`Failed to search animations: ${error.message}`); } throw new Error("Failed to search animations: Unknown error"); }
- src/types.ts:12-16 (schema)TypeScript interface defining the input parameters for search_animations.export interface SearchAnimationsParams { query: string; page?: number; limit?: number; }
- src/handlers/PromptHandler.ts:9-21 (registration)Registers search_animations as a prompt in listPrompts, with a basic input schema.{ name: "search_animations", description: "Search for Lottie animations", inputSchema: { type: "object", properties: { query: { type: "string", description: "Search keywords" } } } },