approve_request_completion
Confirm final completion of tasks in MCP TaskManager by approving the request. Displays task status for review; allows adding new tasks if necessary.
Instructions
After all tasks are done and approved, this tool finalizes the entire request. The user must call this to confirm that the request is fully completed.
A progress table showing the final status of all tasks will be displayed before requesting final approval.
If not approved, the user can add new tasks using 'request_planning' and continue the process.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| requestId | Yes |
Implementation Reference
- index.ts:449-468 (handler)The core handler function that executes the logic for approving the completion of a request. It checks if all tasks are approved, marks the request as completed, saves the data, and returns a success message with the task progress table.public async approveRequestCompletion(requestId: string) { const request = this.data.requests.find((r) => r.requestId === requestId); if (!request) { throw new Error("Request not found"); } if (!request.tasks.every((t) => t.approved)) { throw new Error("Not all tasks are approved yet"); } request.completed = true; await this.saveTasks(); return { message: "Request completion approved. All done!\n" + this.formatTaskProgressTable(requestId), }; }
- index.ts:58-60 (schema)Zod input schema for the approve_request_completion tool, defining the required requestId parameter.const ApproveRequestCompletionSchema = z.object({ requestId: z.string(), });
- index.ts:165-169 (registration)Tool registration in the listTools method, specifying the name, description, and input schema for approve_request_completion.{ name: "approve_request_completion", description: "Approve the completion of an entire request.", inputSchema: ApproveRequestCompletionSchema, },
- index.ts:240-246 (handler)Dispatcher case in the callTool method that validates input using the schema and delegates to the approveRequestCompletion handler.case "approve_request_completion": { const parsed = ApproveRequestCompletionSchema.safeParse(parameters); if (!parsed.success) { throw new Error(`Invalid parameters: ${parsed.error}`); } return this.approveRequestCompletion(parsed.data.requestId); }