Skip to main content
Glama
devlimelabs

Meilisearch MCP Server

by devlimelabs

delete-tasks

Remove tasks from Meilisearch MCP Server by filtering based on status, type, index UID, task UID, or date range to manage task history and optimize server performance.

Instructions

Delete tasks based on provided filters

Input Schema

NameRequiredDescriptionDefault
beforeFinishedAtNoDelete tasks that finished processing before this date (ISO 8601 format)
beforeStartedAtNoDelete tasks that started processing before this date (ISO 8601 format)
beforeUidNoDelete tasks whose uid is before this value
canceledByNoUIDs of the tasks that canceled tasks to delete
indexUidsNoUIDs of the indexes on which tasks to delete were performed
statusesNoStatuses of tasks to delete
typesNoTypes of tasks to delete
uidsNoUIDs of the tasks to delete

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "beforeFinishedAt": { "description": "Delete tasks that finished processing before this date (ISO 8601 format)", "type": "string" }, "beforeStartedAt": { "description": "Delete tasks that started processing before this date (ISO 8601 format)", "type": "string" }, "beforeUid": { "description": "Delete tasks whose uid is before this value", "type": "number" }, "canceledBy": { "description": "UIDs of the tasks that canceled tasks to delete", "items": { "type": "number" }, "type": "array" }, "indexUids": { "description": "UIDs of the indexes on which tasks to delete were performed", "items": { "type": "string" }, "type": "array" }, "statuses": { "description": "Statuses of tasks to delete", "items": { "enum": [ "succeeded", "failed", "canceled" ], "type": "string" }, "type": "array" }, "types": { "description": "Types of tasks to delete", "items": { "enum": [ "indexCreation", "indexUpdate", "indexDeletion", "documentAddition", "documentUpdate", "documentDeletion", "settingsUpdate", "dumpCreation", "taskCancelation" ], "type": "string" }, "type": "array" }, "uids": { "description": "UIDs of the tasks to delete", "items": { "type": "number" }, "type": "array" } }, "type": "object" }

Implementation Reference

  • The handler function for the 'delete-tasks' tool. It builds a request body from the input parameters and sends a POST request to '/tasks/delete' using apiClient, returning the response or error.
    async ({ statuses, types, indexUids, uids, canceledBy, beforeUid, beforeStartedAt, beforeFinishedAt }) => { 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; if (canceledBy && canceledBy.length > 0) body.canceledBy = canceledBy; if (beforeUid !== undefined) body.beforeUid = beforeUid; if (beforeStartedAt) body.beforeStartedAt = beforeStartedAt; if (beforeFinishedAt) body.beforeFinishedAt = beforeFinishedAt; const response = await apiClient.post('/tasks/delete', body); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }], }; } catch (error) { return createErrorResponse(error); } }
  • Input schema using Zod for the parameters accepted by the 'delete-tasks' tool.
    { statuses: z.array(z.enum(['succeeded', 'failed', 'canceled'])).optional().describe('Statuses of tasks to delete'), types: z.array(z.enum(['indexCreation', 'indexUpdate', 'indexDeletion', 'documentAddition', 'documentUpdate', 'documentDeletion', 'settingsUpdate', 'dumpCreation', 'taskCancelation'])).optional().describe('Types of tasks to delete'), indexUids: z.array(z.string()).optional().describe('UIDs of the indexes on which tasks to delete were performed'), uids: z.array(z.number()).optional().describe('UIDs of the tasks to delete'), canceledBy: z.array(z.number()).optional().describe('UIDs of the tasks that canceled tasks to delete'), beforeUid: z.number().optional().describe('Delete tasks whose uid is before this value'), beforeStartedAt: z.string().optional().describe('Delete tasks that started processing before this date (ISO 8601 format)'), beforeFinishedAt: z.string().optional().describe('Delete tasks that finished processing before this date (ISO 8601 format)'), },
  • The MCP server.tool call that registers the 'delete-tasks' tool, including name, description, input schema, and handler function.
    // Delete tasks server.tool( 'delete-tasks', 'Delete tasks based on provided filters', { statuses: z.array(z.enum(['succeeded', 'failed', 'canceled'])).optional().describe('Statuses of tasks to delete'), types: z.array(z.enum(['indexCreation', 'indexUpdate', 'indexDeletion', 'documentAddition', 'documentUpdate', 'documentDeletion', 'settingsUpdate', 'dumpCreation', 'taskCancelation'])).optional().describe('Types of tasks to delete'), indexUids: z.array(z.string()).optional().describe('UIDs of the indexes on which tasks to delete were performed'), uids: z.array(z.number()).optional().describe('UIDs of the tasks to delete'), canceledBy: z.array(z.number()).optional().describe('UIDs of the tasks that canceled tasks to delete'), beforeUid: z.number().optional().describe('Delete tasks whose uid is before this value'), beforeStartedAt: z.string().optional().describe('Delete tasks that started processing before this date (ISO 8601 format)'), beforeFinishedAt: z.string().optional().describe('Delete tasks that finished processing before this date (ISO 8601 format)'), }, async ({ statuses, types, indexUids, uids, canceledBy, beforeUid, beforeStartedAt, beforeFinishedAt }) => { 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; if (canceledBy && canceledBy.length > 0) body.canceledBy = canceledBy; if (beforeUid !== undefined) body.beforeUid = beforeUid; if (beforeStartedAt) body.beforeStartedAt = beforeStartedAt; if (beforeFinishedAt) body.beforeFinishedAt = beforeFinishedAt; const response = await apiClient.post('/tasks/delete', body); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }], }; } catch (error) { return createErrorResponse(error); } } );

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