get-tasks
Retrieve task details from Meilisearch MCP Server with options to filter by status, type, index UIDs, limit, and starting task UID.
Instructions
Get information about tasks with optional filtering
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| from | No | Task uid from which to start fetching | |
| indexUids | No | UIDs of the indexes on which tasks were performed | |
| limit | No | Maximum number of tasks to return | |
| status | No | Status of tasks to return | |
| type | No | Type of tasks to return |
Implementation Reference
- src/tools/system-tools.ts:101-117 (handler)The handler function for the 'get-tasks' tool. It constructs query parameters from the input arguments and makes a GET request to the Meilisearch '/tasks' endpoint, returning the JSON response or an error.async ({ limit, from, status, type, indexUids }) => { try { const params: Record<string, any> = {}; if (limit !== undefined) params.limit = limit; if (from !== undefined) params.from = from; if (status) params.status = status; if (type) params.type = type; if (indexUids && indexUids.length > 0) params.indexUids = indexUids.join(','); const response = await apiClient.get('/tasks', { params }); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }], }; } catch (error) { return createErrorResponse(error); } }
- src/tools/system-tools.ts:94-100 (schema)Input schema using Zod for validating optional parameters: limit, from, status, type, and indexUids.{ limit: z.number().min(0).optional().describe('Maximum number of tasks to return'), from: z.number().min(0).optional().describe('Task uid from which to start fetching'), status: z.enum(['enqueued', 'processing', 'succeeded', 'failed', 'canceled']).optional().describe('Status of tasks to return'), type: z.enum(['indexCreation', 'indexUpdate', 'indexDeletion', 'documentAddition', 'documentUpdate', 'documentDeletion', 'settingsUpdate', 'dumpCreation', 'taskCancelation']).optional().describe('Type of tasks to return'), indexUids: z.array(z.string()).optional().describe('UIDs of the indexes on which tasks were performed'), },
- src/tools/system-tools.ts:92-118 (registration)Registration of the 'get-tasks' MCP tool using server.tool(), including name, description, input schema, and handler function.'get-tasks', 'Get information about tasks with optional filtering', { limit: z.number().min(0).optional().describe('Maximum number of tasks to return'), from: z.number().min(0).optional().describe('Task uid from which to start fetching'), status: z.enum(['enqueued', 'processing', 'succeeded', 'failed', 'canceled']).optional().describe('Status of tasks to return'), type: z.enum(['indexCreation', 'indexUpdate', 'indexDeletion', 'documentAddition', 'documentUpdate', 'documentDeletion', 'settingsUpdate', 'dumpCreation', 'taskCancelation']).optional().describe('Type of tasks to return'), indexUids: z.array(z.string()).optional().describe('UIDs of the indexes on which tasks were performed'), }, async ({ limit, from, status, type, indexUids }) => { try { const params: Record<string, any> = {}; if (limit !== undefined) params.limit = limit; if (from !== undefined) params.from = from; if (status) params.status = status; if (type) params.type = type; if (indexUids && indexUids.length > 0) params.indexUids = indexUids.join(','); const response = await apiClient.get('/tasks', { params }); return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }], }; } catch (error) { return createErrorResponse(error); } } );
- src/index.ts:69-69 (registration)Top-level call to registerSystemTools on the MCP server instance, which registers the 'get-tasks' tool among others.registerSystemTools(server);