Skip to main content
Glama
OrionPotter

Meilisearch MCP Server

by OrionPotter

get-displayed-attributes

Retrieve the displayed attributes configuration for a Meilisearch index to understand which fields are visible in search results.

Instructions

Get the displayed attributes setting

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
indexUidYesUnique identifier of the index

Implementation Reference

  • Handler function that implements the core logic of the 'get-displayed-attributes' tool. It fetches the setting from Meilisearch API endpoint `/indexes/${indexUid}/settings/displayed-attributes` (endpoint resolved from config) and returns formatted JSON response or error.
    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 validation using Zod for the tool's parameter: indexUid (string).
    {
      indexUid: z.string().describe("Unique identifier of the index"),
    },
  • Configuration object used in the dynamic registration loop to define the tool name, API endpoint, and description for 'get-displayed-attributes'.
    {
      name: "get-displayed-attributes",
      endpoint: "displayed-attributes",
      description: "Get the displayed attributes setting",
    },
  • Dynamic registration code that creates and registers the 'get-displayed-attributes' tool (and other get-* tools) with the MCP server using server.tool().
    // 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 call to register all settings tools, including 'get-displayed-attributes', with the main MCP server instance.
    registerSettingsTools(server);
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states 'Get', implying a read-only operation, but doesn't confirm if it's safe or has side effects. It lacks details on permissions, rate limits, error conditions, or what the return value looks like (e.g., a list of attributes). For a tool with no annotation coverage, this minimal description is insufficient to inform the agent about key behavioral traits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, concise sentence with no wasted words, making it front-loaded and easy to parse. However, it's overly terse to the point of under-specification, lacking necessary context. While efficient, it sacrifices clarity for brevity, which slightly reduces its effectiveness as a standalone description for an AI agent.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (retrieving a specific index setting) and the absence of annotations and output schema, the description is incomplete. It doesn't explain what 'displayed attributes' are, how they differ from other settings like 'searchable attributes', or what the output entails. With no structured fields to compensate, the description fails to provide enough context for the agent to use the tool confidently.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with the single parameter 'indexUid' clearly documented as 'Unique identifier of the index'. The description adds no additional meaning about parameters beyond what the schema provides, such as format examples or constraints. Since schema coverage is high, the baseline score of 3 is appropriate, as the schema does the heavy lifting for parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get the displayed attributes setting' is a tautology that essentially restates the tool name 'get-displayed-attributes'. It doesn't specify what 'displayed attributes' are or what resource they belong to (index settings). While it uses the verb 'Get', it lacks specificity about what exactly is being retrieved, making it vague compared to more descriptive sibling tools like 'get-settings' or 'get-searchable-attributes'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get-settings' (which might include displayed attributes) or 'update-displayed-attributes' and 'reset-displayed-attributes' (for modifying them). There's no context about prerequisites, such as needing an existing index, or when this operation is appropriate, leaving the agent to infer usage from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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