get-index
Retrieve detailed information about a specific Meilisearch index, including its configuration, statistics, and status, to manage and monitor search functionality.
Instructions
Get information about a specific Meilisearch index
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| indexUid | Yes | Unique identifier of the index |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"indexUid": {
"description": "Unique identifier of the index",
"type": "string"
}
},
"required": [
"indexUid"
],
"type": "object"
}
Implementation Reference
- src/tools/index-tools.ts:79-88 (handler)The asynchronous handler function for the 'get-index' tool. It fetches information about a specific Meilisearch index using the apiClient and returns the JSON response or an error.async ({ indexUid }: GetIndexParams) => { try { const response = await apiClient.get(`/indexes/${indexUid}`); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }], }; } catch (error) { return createErrorResponse(error); } }
- src/tools/index-tools.ts:76-78 (schema)Input schema for the 'get-index' tool, defining the required 'indexUid' parameter using Zod.{ indexUid: z.string().describe('Unique identifier of the index'), },
- src/tools/index-tools.ts:73-89 (registration)Registers the 'get-index' tool with the MCP server using server.tool(), specifying name, description, schema, and handler.server.tool( 'get-index', 'Get information about a specific Meilisearch index', { indexUid: z.string().describe('Unique identifier of the index'), }, async ({ indexUid }: GetIndexParams) => { try { const response = await apiClient.get(`/indexes/${indexUid}`); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }], }; } catch (error) { return createErrorResponse(error); } } );
- src/tools/index-tools.ts:19-21 (schema)TypeScript interface used to type the parameters in the handler function.interface GetIndexParams { indexUid: string; }
- src/index.ts:64-64 (registration)Top-level registration call that invokes registerIndexTools to add index tools (including 'get-index') to the main MCP server instance.registerIndexTools(server);