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
| 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 |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"from": {
"description": "Task uid from which to start fetching",
"minimum": 0,
"type": "number"
},
"indexUids": {
"description": "UIDs of the indexes on which tasks were performed",
"items": {
"type": "string"
},
"type": "array"
},
"limit": {
"description": "Maximum number of tasks to return",
"minimum": 0,
"type": "number"
},
"status": {
"description": "Status of tasks to return",
"enum": [
"enqueued",
"processing",
"succeeded",
"failed",
"canceled"
],
"type": "string"
},
"type": {
"description": "Type of tasks to return",
"enum": [
"indexCreation",
"indexUpdate",
"indexDeletion",
"documentAddition",
"documentUpdate",
"documentDeletion",
"settingsUpdate",
"dumpCreation",
"taskCancelation"
],
"type": "string"
}
},
"type": "object"
}
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 and calls the Meilisearch /tasks API 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)Zod input schema defining optional parameters for filtering tasks: 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)The server.tool call that registers the 'get-tasks' tool, including its 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); } } );