Skip to main content
Glama
OrionPotter

Meilisearch MCP Server

by OrionPotter

get-sortable-attributes

Retrieve the sortable attributes configuration for a Meilisearch index to understand which fields can be used for sorting search results.

Instructions

Get the sortable attributes setting

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexUidYesUnique identifier of the index

Implementation Reference

  • The handler function that executes the tool logic: fetches the sortable-attributes setting from Meilisearch API for the given index using the specific endpoint.
    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); } }
  • Input schema defining the required indexUid parameter for the tool.
    { indexUid: z.string().describe("Unique identifier of the index"), },
  • The server.tool registration call that registers the 'get-sortable-attributes' tool dynamically via the loop using its name, description, schema, and handler.
    server.tool( name, description, { indexUid: z.string().describe("Unique identifier of the 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); } } );
  • Helper configuration object in the specificSettingsTools array that provides the name, endpoint, and description for the get-sortable-attributes tool, used in the registration loop.
    { name: "get-sortable-attributes", endpoint: "sortable-attributes", description: "Get the sortable attributes setting", },

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/OrionPotter/iflow-mcp_meilisearch-ts-mcp'

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