get-task
Retrieve detailed information about a specific Meilisearch task using its unique identifier to monitor progress and check status.
Instructions
Get information about a specific task
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| taskUid | Yes | Unique identifier of the task |
Implementation Reference
- src/tools/task-tools.ts:79-95 (registration)Direct registration of the 'get-task' tool using server.tool(), including description, input schema, and handler function.server.tool( "get-task", "Get information about a specific task", { taskUid: z.number().describe("Unique identifier of the task"), }, async ({ taskUid }: GetTaskParams) => { try { const response = await apiClient.get(`/tasks/${taskUid}`); return { content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }], }; } catch (error) { return createErrorResponse(error); } } );
- src/tools/task-tools.ts:85-94 (handler)The handler function that executes the tool logic: fetches task details from Meilisearch API /tasks/{taskUid} and returns formatted JSON response or error.async ({ taskUid }: GetTaskParams) => { try { const response = await apiClient.get(`/tasks/${taskUid}`); return { content: [{ type: "text", text: JSON.stringify(response.data, null, 2) }], }; } catch (error) { return createErrorResponse(error); } }
- src/tools/task-tools.ts:23-25 (schema)TypeScript interface defining input parameters for the get-task tool.interface GetTaskParams { taskUid: number; }
- src/index.ts:70-70 (registration)Top-level call to registerTaskTools which includes the 'get-task' tool registration.registerTaskTools(server);