list-indexes
Retrieve all indexes from a Meilisearch instance to manage and organize searchable data collections. Use limit and offset parameters to control result pagination.
Instructions
List all indexes in the Meilisearch instance
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "list-indexes"
}
}Input 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:48-70 (registration)Registers the 'list-indexes' MCP tool with server, including description, input schema, and inline 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:55-69 (handler)Handler function for list-indexes tool: fetches indexes from Meilisearch /indexes endpoint with pagination params and returns formatted JSON response or 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 input schema defining optional limit (1-100) and offset (>=0) parameters for listing indexes.
{ 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/index.ts:64-64 (registration)Top-level registration call that invokes registerIndexTools to add the list-indexes tool (among others) to the MCP server instance.
registerIndexTools(server); - src/tools/index-tools.ts:14-17 (helper)TypeScript interface defining parameters for the list-indexes handler.
interface ListIndexesParams { limit?: number; offset?: number; }