Skip to main content
Glama
devlimelabs

Meilisearch MCP Server

by devlimelabs

cancel-tasks

Cancel pending tasks in Meilisearch by filtering tasks based on status, type, index UID, or task UID. Manage task queues effectively using the MCP Server interface.

Instructions

Cancel tasks based on provided filters

Input Schema

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

Implementation Reference

  • Handler function that builds a filter body from input params and POSTs to '/tasks/cancel' API endpoint via apiClient, returning JSON 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 filter parameters for canceling tasks: statuses (enqueued/processing), 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"), },
  • MCP server.tool() registration for 'cancel-tasks' tool, specifying name, description, input schema, and handler.
    // Cancel tasks 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 input parameter types for the cancel-tasks handler.
    interface CancelTasksParams { statuses?: string[]; types?: string[]; indexUids?: string[]; uids?: number[]; }

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