list-indexes
Retrieve a paginated list of all indexes in a Meilisearch instance, enabling efficient management and oversight of search data structures.
Instructions
List all indexes in the Meilisearch instance
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of indexes to return | |
| offset | No | Number of indexes to skip |
Implementation Reference
- src/tools/index-tools.ts:55-69 (handler)Handler function that lists all indexes in the Meilisearch instance by calling the API endpoint '/indexes' with optional limit and offset parameters, returning the JSON response or an error.async ({ limit, offset }: ListIndexesParams) => { try { const response = await apiClient.get('/indexes', { params: { limit, offset, }, }); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }], }; } catch (error) { return createErrorResponse(error); } }
- src/tools/index-tools.ts:51-54 (schema)Zod schema defining the input parameters for the 'list-indexes' tool: optional limit (1-100) and offset (>=0).{ limit: z.number().min(1).max(100).optional().describe('Maximum number of indexes to return'), offset: z.number().min(0).optional().describe('Number of indexes to skip'), },
- src/tools/index-tools.ts:49-70 (registration)MCP server.tool registration for 'list-indexes', including name, description, input schema, and inline handler function.'list-indexes', 'List all indexes in the Meilisearch instance', { limit: z.number().min(1).max(100).optional().describe('Maximum number of indexes to return'), offset: z.number().min(0).optional().describe('Number of indexes to skip'), }, async ({ limit, offset }: ListIndexesParams) => { try { const response = await apiClient.get('/indexes', { params: { limit, offset, }, }); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }], }; } catch (error) { return createErrorResponse(error); } } );
- src/index.ts:64-64 (registration)Invocation of registerIndexTools on the MCP server instance, which registers the 'list-indexes' tool among others.registerIndexTools(server);
- src/tools/index-tools.ts:14-17 (schema)TypeScript type definition for the parameters used in the 'list-indexes' handler.interface ListIndexesParams { limit?: number; offset?: number; }