Skip to main content
Glama
devlimelabs

Meilisearch MCP Server

by devlimelabs

get-displayed-attributes

Retrieve the displayed attributes setting for a specific index in Meilisearch using the Model Context Protocol, enabling precise control over search result visibility and management.

Instructions

Get the displayed attributes setting

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexUidYesUnique identifier of the index

Implementation Reference

  • Configuration object that defines the 'get-displayed-attributes' tool, specifying its name, the Meilisearch endpoint 'displayed-attributes', and description. This is used in the dynamic registration loop.
    { name: "get-displayed-attributes", endpoint: "displayed-attributes", description: "Get the displayed attributes setting",
  • Handler function for 'get-displayed-attributes' (shared with other specific settings getters). Fetches the displayed attributes from Meilisearch API endpoint `/indexes/${indexUid}/settings/displayed-attributes` and returns JSON stringified response.
    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 for 'get-displayed-attributes' tool using Zod: requires 'indexUid' string.
    { indexUid: z.string().describe("Unique identifier of the index"), },
  • forEach loop that registers the 'get-displayed-attributes' tool (and others) on the MCP server using the configuration from specificSettingsTools array.
    // Create a tool for each specific setting specificSettingsTools.forEach(({ name, endpoint, description }) => { 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); } } ); });
  • src/index.ts:67-67 (registration)
    Top-level registration call in main server setup that invokes registerSettingsTools, thereby registering 'get-displayed-attributes' among other settings tools.
    registerSettingsTools(server);

Other Tools

Related Tools

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