mark_task_done
Mark a task as completed in MCP TaskManager by providing requestId and taskId, optionally adding completedDetails. Updates task progress and waits for approval before proceeding to the next task.
Instructions
Mark a given task as done after you've completed it. Provide 'requestId' and 'taskId', and optionally 'completedDetails'.
After marking a task as done, a progress table will be displayed showing the updated status of all tasks.
After this, DO NOT proceed to 'get_next_task' again until the user has explicitly approved this completed task using 'approve_task_completion'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| completedDetails | No | ||
| requestId | Yes | ||
| taskId | Yes |
Implementation Reference
- index.ts:399-426 (handler)The core handler function that locates the task by requestId and taskId, sets it as done, optionally updates completion details, persists the data, and returns a progress table message.public async markTaskDone( requestId: string, taskId: string, completedDetails?: string ) { const request = this.data.requests.find((r) => r.requestId === requestId); if (!request) { throw new Error("Request not found"); } const task = request.tasks.find((t) => t.id === taskId); if (!task) { throw new Error("Task not found"); } task.done = true; if (completedDetails) { task.completedDetails = completedDetails; } await this.saveTasks(); return { message: "Task marked as done. Awaiting approval.\n" + this.formatTaskProgressTable(requestId), }; }
- index.ts:47-51 (schema)Zod schema defining the input parameters for the mark_task_done tool: requestId, taskId, and optional completedDetails.const MarkTaskDoneSchema = z.object({ requestId: z.string(), taskId: z.string(), completedDetails: z.string().optional(), });
- index.ts:155-159 (registration)Tool registration in the listTools method, providing name, description, and input schema.{ name: "mark_task_done", description: "Mark a task as completed.", inputSchema: MarkTaskDoneSchema, },
- index.ts:219-228 (handler)Dispatch handler in callTool method that validates input using the schema and delegates to the markTaskDone method.case "mark_task_done": { const parsed = MarkTaskDoneSchema.safeParse(parameters); if (!parsed.success) { throw new Error(`Invalid parameters: ${parsed.error}`); } return this.markTaskDone( parsed.data.requestId, parsed.data.taskId, parsed.data.completedDetails );