approve_task_completion
Approve completed tasks in the MCP TaskManager workflow to verify genuine completion before proceeding to the next task in the queue.
Instructions
Once the assistant has marked a task as done using 'mark_task_done', the user must call this tool to approve that the task is genuinely completed. Only after this approval can you proceed to 'get_next_task' to move on.
A progress table will be displayed before requesting approval, showing the current status of all tasks.
If the user does not approve, do not call 'get_next_task'. Instead, the user may request changes, or even re-plan tasks by using 'request_planning' again.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| requestId | Yes | ||
| taskId | Yes |
Implementation Reference
- index.ts:428-447 (handler)The core handler function that locates the request and task by ID, sets the task's approved flag to true, persists the change, and returns a progress table.public async approveTaskCompletion(requestId: string, taskId: 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.approved = true; await this.saveTasks(); return { message: "Task completion approved.\n" + this.formatTaskProgressTable(requestId), }; }
- index.ts:53-56 (schema)Zod schema defining the input parameters: requestId and taskId as strings.const ApproveTaskCompletionSchema = z.object({ requestId: z.string(), taskId: z.string(), });
- index.ts:160-164 (registration)Tool registration object returned by listTools(), specifying name, description, and input schema.{ name: "approve_task_completion", description: "Approve a completed task.", inputSchema: ApproveTaskCompletionSchema, },
- index.ts:230-239 (helper)Dispatcher case in callTool method that validates input using the schema and invokes the handler.case "approve_task_completion": { const parsed = ApproveTaskCompletionSchema.safeParse(parameters); if (!parsed.success) { throw new Error(`Invalid parameters: ${parsed.error}`); } return this.approveTaskCompletion( parsed.data.requestId, parsed.data.taskId ); }