get-sortable-attributes
Retrieve the list of sortable attributes for a specific index in Meilisearch to manage and optimize search results effectively. Supports structured data handling via the MCP interface.
Instructions
Get the sortable attributes setting
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| indexUid | Yes | Unique identifier of the index |
Implementation Reference
- src/tools/settings-tools.ts:155-164 (handler)Handler function that implements the core logic for the 'get-sortable-attributes' tool by calling the Meilisearch API to fetch the sortable-attributes setting for the given index.async ({ indexUid }) => { try { const response = await apiClient.get(`/indexes/${indexUid}/settings/${endpoint}`); return { content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }], }; } catch (error) { return createErrorResponse(error); } }
- src/tools/settings-tools.ts:152-154 (schema)Input schema using Zod to validate the indexUid parameter.{ indexUid: z.string().describe("Unique identifier of the index"), },
- src/tools/settings-tools.ts:105-109 (registration)Configuration object defining the tool's name, endpoint, and description within the specificSettingsTools array.{ name: "get-sortable-attributes", endpoint: "sortable-attributes", description: "Get the sortable attributes setting", },
- src/index.ts:67-67 (registration)Top-level registration call that invokes the settings tools registration, including 'get-sortable-attributes'.registerSettingsTools(server);