approve_task_completion
Confirm task completion in the MCP TaskManager system to proceed to the next task. Review progress table, approve, or request changes before moving forward.
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)Core handler function that locates the request and task, sets the task as approved, persists the data, and returns an updated task 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:230-239 (handler)Tool dispatcher in the callTool method: validates parameters using the schema and invokes the specific approveTaskCompletion 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 ); }
- index.ts:53-56 (schema)Zod schema defining the input parameters: requestId (string) and taskId (string).const ApproveTaskCompletionSchema = z.object({ requestId: z.string(), taskId: z.string(), });
- index.ts:160-164 (registration)Tool registration object returned by listTools(), including name, description, and reference to the input schema.{ name: "approve_task_completion", description: "Approve a completed task.", inputSchema: ApproveTaskCompletionSchema, },