search_animations
Find Lottie animations using keywords or tags. Supports pagination to browse results efficiently.
Instructions
Search for Lottie animations by keywords, tags, and other criteria. Supports pagination.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | Search keywords that match animation names, descriptions, tags, etc. | |
| page | No | Page number, starting from 1 | |
| limit | No | Number of items per page |
Implementation Reference
- src/handlers/ToolHandler.ts:87-108 (handler)Executes the 'search_animations' tool by calling LottieApiClient.searchAnimations and returning the results as a JSON string in the MCP response format.
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/api/LottieApiClient.ts:17-35 (helper)Performs the actual API call to LottieFiles search endpoint to retrieve animations matching the query.
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/handlers/ToolHandler.ts:14-41 (registration)Registers the 'search_animations' tool in the MCP listTools response, defining its name, description, and 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/types.ts:12-16 (schema)TypeScript interface defining the input parameters for search_animations.
export interface SearchAnimationsParams { query: string; page?: number; limit?: number; } - src/types.ts:27-32 (schema)TypeScript interface defining the expected response structure for search_animations.
export interface SearchAnimationsResponse { animations: LottieAnimation[]; total: number; page: number; limit: number; }