Skip to main content
Glama
OrionPotter

Meilisearch MCP Server

by OrionPotter

update-distinct-attribute

Modify the distinct attribute setting in a Meilisearch index to control how duplicate results are handled during search operations.

Instructions

Update the distinct attribute setting

Input Schema

NameRequiredDescriptionDefault
indexUidYesUnique identifier of the index
valueYesJSON value for the setting

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "indexUid": { "description": "Unique identifier of the index", "type": "string" }, "value": { "description": "JSON value for the setting", "type": "string" } }, "required": [ "indexUid", "value" ], "type": "object" }

Implementation Reference

  • Handler function that executes the tool logic for 'update-distinct-attribute' (shared with other update settings tools). Parses the JSON value input, sends a PUT request to the Meilisearch API endpoint for distinct-attribute settings, and returns the response or handles errors.
    async ({ indexUid, value }) => { try { // Parse the value string to ensure it's valid JSON const parsedValue = JSON.parse(value); const response = await apiClient.put(`/indexes/${indexUid}/settings/${endpoint}`, parsedValue); return { content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }], }; } catch (error) { return createErrorResponse(error); } } );
  • Input schema definition using Zod for the tool, specifying indexUid and value parameters (shared with other update tools).
    { indexUid: z.string().describe("Unique identifier of the index"), value: z.string().describe("JSON value for the setting"), },
  • Configuration object within the updateSettingsTools array used to dynamically register the 'update-distinct-attribute' tool via a forEach loop calling server.tool() with shared schema and handler.
    { name: "update-distinct-attribute", endpoint: "distinct-attribute", description: "Update the distinct attribute setting", },
  • src/index.ts:67-67 (registration)
    Top-level call to registerSettingsTools which includes the registration of 'update-distinct-attribute' among other settings tools.
    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/OrionPotter/iflow-mcp_meilisearch-ts-mcp'

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