complete_task
Mark tasks as completed in TickTick/Dida365 by providing task and project IDs. Updates task status and records completion timestamp to track progress.
Instructions
Mark a task as completed. Requires both task ID and project ID. Updates the task's status to completed and sets completion timestamp.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| taskId | Yes | The ID of the task to mark as complete (required) | |
| projectId | Yes | The ID of the project containing the task (required) |
Implementation Reference
- src/index.ts:513-528 (handler)Handler for complete_task tool: validates projectId and taskId, POSTs to Dida365 API /project/{projectId}/task/{taskId}/complete to mark task as completed, returns the response as text content.case "complete_task":{ const taskId = args.taskId as string; const projectId = args.projectId as string; throwValidError(projectId,taskId); const response: AxiosResponse = await dida365Api.post(`/project/${projectId}/task/${taskId}/complete`) return { content:[ { type:"text", text: `任务更新: ${JSON.stringify(response.data, null, 2)}` } ] } }
- src/index.ts:222-239 (schema)Schema definition for complete_task tool in ListTools response, specifying input parameters taskId and projectId as required strings.{ name: "complete_task", description: "Mark a task as completed. Requires both task ID and project ID. Updates the task's status to completed and sets completion timestamp.", inputSchema: { type: "object", properties: { taskId: { type: "string", description: "The ID of the task to mark as complete (required)", }, projectId: { type: "string", description: "The ID of the project containing the task (required)" } }, required: ["taskId","projectId"], }, },
- src/index.ts:638-642 (helper)Helper function throwValidError used in complete_task handler to validate that projectId and taskId are provided.function throwValidError(projectId : string,taskId : string){ if(!projectId&&!taskId) throw new McpError(ErrorCode.InvalidRequest,"projectId 和 taskId 为空") if(!projectId) throw new McpError(ErrorCode.InvalidRequest,"projectId 为空") if(!taskId) throw new McpError(ErrorCode.InvalidRequest,"taskId 为空") }