complete_task
Mark a specific task as completed by providing the task and project IDs. Integrates with TickTick for efficient task management and timezone handling.
Instructions
Mark a task as completed
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | Project ID containing the task (required) | |
| taskId | Yes | Task ID to complete (required) |
Implementation Reference
- src/ticktick-client.ts:331-340 (handler)The core handler function in TickTickClient that executes the tool logic: authenticates the session and makes a POST request to the TickTick API to mark the task as completed.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'}`); } }
- src/index.ts:178-195 (schema)The input schema and metadata for the 'complete_task' tool, defining required parameters 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/index.ts:312-324 (registration)MCP tool registration and dispatching logic in the CallToolRequestSchema handler, which validates arguments and calls the TickTickClient.completeTask method.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)}`, }, ], };