delete_task
Remove a task from a TickTick/Dida365 project using its task ID and project ID. This action permanently deletes the specified task and returns a confirmation upon successful completion.
Instructions
Permanently delete a task from a project. Requires both task ID and project ID for confirmation. Returns success message upon deletion.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| taskId | Yes | The ID of the task to delete (required) | |
| projectId | Yes | The ID of the project containing the task (required) |
Implementation Reference
- src/index.ts:429-443 (handler)Handler for the 'delete_task' tool: extracts taskId and projectId from arguments, validates them using throwValidError, deletes the task via dida365Api.delete, and returns a success message.case "delete_task": { const taskId = args.taskId as string; const projectId = args.projectId as string; throwValidError(projectId,taskId); await dida365Api.delete(`/project/${projectId}/task/${taskId}`); return { content: [ { type: "text", text: `任务 ${taskId} 删除成功`, }, ], }; }
- src/index.ts:204-221 (registration)Registration of the 'delete_task' tool including its name, description, and input schema definition in the tools array passed to the MCP server.{ name: "delete_task", description: "Permanently delete a task from a project. Requires both task ID and project ID for confirmation. Returns success message upon deletion.", inputSchema: { type: "object", properties: { taskId: { type: "string", description: "The ID of the task to delete (required)", }, projectId: { type: "string", description: "The ID of the project containing the task (required)" } }, required: ["taskId","projectId"], }, },
- src/index.ts:638-642 (helper)Helper validation function used in delete_task (and others) to ensure 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 为空") }