complete_task
Mark tasks as completed in TickTick by providing task and project IDs to update task status and track progress.
Instructions
Mark a task as completed
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| taskId | Yes | Task ID to complete (required) | |
| projectId | Yes | Project ID containing the task (required) |
Implementation Reference
- src/index.ts:312-324 (handler)MCP tool handler for 'complete_task': validates taskId and projectId, delegates to TickTickClient.completeTask, returns formatted response with task details.case 'complete_task': if (!args?.taskId || !args?.projectId) { throw new McpError(ErrorCode.InvalidParams, 'Task ID and Project ID are required'); } const completedTask = await this.ticktickClient!.completeTask(args.taskId as string, args.projectId as string); return { content: [ { type: 'text', text: `Task completed successfully: ${JSON.stringify(completedTask, null, 2)}`, }, ], };
- src/index.ts:178-195 (registration)Tool registration in ListTools handler: defines name, description, and input schema requiring taskId and projectId.{ name: 'complete_task', description: 'Mark a task as completed', inputSchema: { type: 'object', properties: { taskId: { type: 'string', description: 'Task ID to complete (required)', }, projectId: { type: 'string', description: 'Project ID containing the task (required)', }, }, required: ['taskId', 'projectId'], }, },
- src/ticktick-client.ts:331-340 (helper)TickTickClient helper method: ensures authentication and makes POST request to TickTick API to mark task as complete.async completeTask(taskId: string, projectId: string): Promise<TickTickTask> { await this.ensureAuthenticated(); try { const response = await this.client.post(`/project/${projectId}/task/${taskId}/complete`); return response.data; } catch (error) { throw new Error(`Failed to complete task: ${error instanceof Error ? error.message : 'Unknown error'}`); } }