Skip to main content
Glama
devlimelabs

Meilisearch MCP Server

by devlimelabs

get-sortable-attributes

Retrieve sortable attributes from a Meilisearch index to configure search result ordering options.

Instructions

Get the sortable attributes setting

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexUidYesUnique identifier of the index

Implementation Reference

  • The handler function that executes the get-sortable-attributes tool. It retrieves the sortable attributes setting from the Meilisearch API for the specified index using the 'sortable-attributes' endpoint and returns the result as formatted JSON.
    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); } }
  • The input schema for the get-sortable-attributes tool, defining the required 'indexUid' parameter.
    { indexUid: z.string().describe("Unique identifier of the index"), },
  • The configuration object used to dynamically register the get-sortable-attributes tool in the specificSettingsTools array, which is processed by a forEach loop to call server.tool for each tool.
    { name: "get-sortable-attributes", endpoint: "sortable-attributes", description: "Get the sortable attributes setting", },
  • src/index.ts:67-67 (registration)
    Top-level call to registerSettingsTools, which in turn registers the get-sortable-attributes tool (among others) with the MCP server.
    registerSettingsTools(server);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/devlimelabs/meilisearch-ts-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server