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",
    },
Behavior1/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. The description only states what the tool does ('Get the sortable attributes setting') without mentioning any behavioral traits such as whether it's a read-only operation, what permissions are required, how it handles errors, or what the output format looks like. For a tool with zero annotation coverage, this is inadequate.

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

Conciseness5/5

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

The description is extremely concise—a single sentence with no wasted words. It's front-loaded with the core action and resource, making it easy to parse quickly. While brevity can lead to under-specification, in terms of structure and efficiency, this description is optimal.

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 lack of annotations and output schema, the description is incomplete for effective tool use. It doesn't explain what 'sortable attributes' are in this context, what the returned data structure looks like, or any behavioral nuances. For a tool that likely returns configuration data, more context is needed to help the agent understand and utilize the output properly.

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 beyond this schema information, such as explaining where to find the indexUid or providing examples. Since the schema does the heavy lifting, the baseline score of 3 is appropriate.

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 sortable attributes setting' is essentially a tautology that restates the tool name with minimal elaboration. While it specifies the action ('Get') and resource ('sortable attributes setting'), it doesn't clarify what 'sortable attributes' are or how this differs from similar sibling tools like 'get-filterable-attributes' or 'get-searchable-attributes'. The purpose is stated but lacks meaningful differentiation.

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

Usage Guidelines1/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. There are multiple sibling tools for retrieving different index settings (e.g., 'get-filterable-attributes', 'get-searchable-attributes', 'get-settings'), but the description doesn't explain when this specific tool is appropriate, what prerequisites exist, or when other tools might be better suited. This leaves the agent without context for selection.

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