get-tasks
Retrieve and filter task information from Meilisearch, including status, type, and index associations for monitoring operations.
Instructions
Get information about tasks with optional filtering
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum number of tasks to return | |
| from | No | Task uid from which to start fetching | |
| status | No | Status of tasks to return | |
| type | No | Type of tasks to return | |
| indexUids | No | UIDs of the indexes on which tasks were performed |
Implementation Reference
- src/tools/system-tools.ts:91-118 (registration)Complete registration of the 'get-tasks' MCP tool, including name, description, input schema, and handler function that queries the Meilisearch /tasks endpoint with optional filters.server.tool( '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); } } );