list-indexes
Retrieve all indexes from a Meilisearch instance to manage search data. Use limit and offset parameters to control result pagination.
Instructions
List all indexes in the Meilisearch instance
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of indexes to return | |
| offset | No | Number of indexes to skip |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"limit": {
"description": "Maximum number of indexes to return",
"maximum": 100,
"minimum": 1,
"type": "number"
},
"offset": {
"description": "Number of indexes to skip",
"minimum": 0,
"type": "number"
}
},
"type": "object"
}
Implementation Reference
- src/tools/index-tools.ts:55-69 (handler)Handler function that fetches the list of indexes from the Meilisearch API using apiClient.get('/indexes') with optional limit and offset parameters, formats the response as JSON, and handles errors using createErrorResponse.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 input schema defining optional 'limit' (1-100) and 'offset' (>=0) parameters for pagination.{ 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:48-70 (registration)Registration of the 'list-indexes' tool on the MCP server, including description, input schema, and handler function.server.tool( '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/tools/index-tools.ts:14-17 (schema)TypeScript interface defining the parameters for the list-indexes tool.interface ListIndexesParams { limit?: number; offset?: number; }