Skip to main content
Glama
OrionPotter

Meilisearch MCP Server

by OrionPotter

cancel-tasks

Cancel queued or processing tasks in Meilisearch by filtering by status, type, index, or task ID to manage task execution.

Instructions

Cancel tasks based on provided filters

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
statusesNoStatuses of tasks to cancel
typesNoTypes of tasks to cancel
indexUidsNoUIDs of the indexes on which tasks to cancel were performed
uidsNoUIDs of the tasks to cancel

Implementation Reference

  • Handler function that constructs a request body from input parameters and sends a POST request to '/tasks/cancel' using apiClient, returning the response or error.
    async ({ statuses, types, indexUids, uids }: CancelTasksParams) => {
      try {
        const body: Record<string, any> = {};
        if (statuses && statuses.length > 0) body.statuses = statuses;
        if (types && types.length > 0) body.types = types;
        if (indexUids && indexUids.length > 0) body.indexUids = indexUids;
        if (uids && uids.length > 0) body.uids = uids;
        
        const response = await apiClient.post('/tasks/cancel', body);
        return {
          content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }],
        };
      } catch (error) {
        return createErrorResponse(error);
      }
    }
  • Zod input schema defining optional parameters for filtering tasks to cancel: statuses, types, indexUids, uids.
    {
      statuses: z.array(z.enum(["enqueued", "processing"])).optional().describe("Statuses of tasks to cancel"),
      types: z.array(z.enum(["indexCreation", "indexUpdate", "indexDeletion", "documentAddition", "documentUpdate", "documentDeletion", "settingsUpdate", "dumpCreation", "taskCancelation"])).optional().describe("Types of tasks to cancel"),
      indexUids: z.array(z.string()).optional().describe("UIDs of the indexes on which tasks to cancel were performed"),
      uids: z.array(z.number()).optional().describe("UIDs of the tasks to cancel"),
    },
  • Registration of the 'cancel-tasks' tool on the MCP server, including name, description, input schema, and handler function.
    server.tool(
      "cancel-tasks",
      "Cancel tasks based on provided filters",
      {
        statuses: z.array(z.enum(["enqueued", "processing"])).optional().describe("Statuses of tasks to cancel"),
        types: z.array(z.enum(["indexCreation", "indexUpdate", "indexDeletion", "documentAddition", "documentUpdate", "documentDeletion", "settingsUpdate", "dumpCreation", "taskCancelation"])).optional().describe("Types of tasks to cancel"),
        indexUids: z.array(z.string()).optional().describe("UIDs of the indexes on which tasks to cancel were performed"),
        uids: z.array(z.number()).optional().describe("UIDs of the tasks to cancel"),
      },
      async ({ statuses, types, indexUids, uids }: CancelTasksParams) => {
        try {
          const body: Record<string, any> = {};
          if (statuses && statuses.length > 0) body.statuses = statuses;
          if (types && types.length > 0) body.types = types;
          if (indexUids && indexUids.length > 0) body.indexUids = indexUids;
          if (uids && uids.length > 0) body.uids = uids;
          
          const response = await apiClient.post('/tasks/cancel', body);
          return {
            content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }],
          };
        } catch (error) {
          return createErrorResponse(error);
        }
      }
    );
  • TypeScript interface defining the parameters for the cancel-tasks tool.
    interface CancelTasksParams {
      statuses?: string[];
      types?: string[];
      indexUids?: string[];
      uids?: number[];
    }
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 mentions 'cancel' but doesn't clarify if this is reversible, what permissions are needed, how it affects system state, or error handling. For a mutation tool with zero annotation coverage, this is a significant gap in safety and operational context.

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 a single, efficient sentence with zero waste—'Cancel tasks based on provided filters'—making it appropriately sized and front-loaded. Every word contributes directly to the tool's purpose without unnecessary elaboration.

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 complexity of a mutation tool with 4 parameters, no annotations, and no output schema, the description is incomplete. It fails to address critical aspects like return values, error conditions, or behavioral nuances, leaving the agent with insufficient information for safe and effective use.

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?

Schema description coverage is 100%, with clear parameter descriptions in the schema (e.g., 'Statuses of tasks to cancel'). The description adds no additional meaning beyond implying filtering, but since the schema does the heavy lifting, the baseline score of 3 is appropriate as it doesn't compensate for or enhance the schema information.

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

Purpose3/5

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

The description 'Cancel tasks based on provided filters' states the action (cancel) and resource (tasks) but is vague about scope and impact. It doesn't specify whether this cancels all matching tasks globally or within a specific context, nor does it distinguish from sibling tools like 'delete-tasks' or 'wait-for-task', leaving ambiguity about its exact function.

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?

No guidance is provided on when to use this tool versus alternatives. The description lacks context about prerequisites (e.g., task status requirements), exclusions, or comparisons to siblings like 'delete-tasks' or 'wait-for-task', offering no help for an agent to decide when this tool is appropriate.

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