Skip to main content
Glama
OrionPotter

Meilisearch MCP Server

by OrionPotter

delete-tasks

Remove completed or filtered tasks from the Meilisearch MCP Server to manage task history and optimize system performance.

Instructions

Delete tasks based on provided filters

Input Schema

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

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

  • Handler function that builds a filter body from input parameters and POSTs it to the Meilisearch '/tasks/delete' endpoint, 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); } }
  • Zod schema defining the optional input parameters for filtering which tasks to delete.
    { 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)'), },
  • MCP server.tool registration for 'delete-tasks', specifying name, description, input schema, and inline handler function.
    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); } } );
  • src/index.ts:69-69 (registration)
    Invocation of registerSystemTools which includes registration of the 'delete-tasks' tool among system tools.
    registerSystemTools(server);

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