delete_task
Remove a task from TickTick task management by specifying its task ID and project ID to maintain organized workflows.
Instructions
Delete a task
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| taskId | Yes | Task ID to delete (required) | |
| projectId | Yes | Project ID containing the task (required) |
Implementation Reference
- src/ticktick-client.ts:321-329 (handler)Core handler function that authenticates and makes the API DELETE request to remove the task from the specified project.async deleteTask(taskId: string, projectId: string): Promise<void> { await this.ensureAuthenticated(); try { await this.client.delete(`/project/${projectId}/task/${taskId}`); } catch (error) { throw new Error(`Failed to delete task: ${error instanceof Error ? error.message : 'Unknown error'}`); } }
- src/index.ts:298-310 (handler)MCP server handler for the delete_task tool, which validates input parameters and calls the TickTickClient's deleteTask method.case 'delete_task': if (!args?.taskId || !args?.projectId) { throw new McpError(ErrorCode.InvalidParams, 'Task ID and Project ID are required'); } await this.ticktickClient!.deleteTask(args.taskId as string, args.projectId as string); return { content: [ { type: 'text', text: 'Task deleted successfully', }, ], };
- src/index.ts:161-177 (registration)Registration of the delete_task tool in the ListTools handler, defining name, description, and input schema.name: 'delete_task', description: 'Delete a task', inputSchema: { type: 'object', properties: { taskId: { type: 'string', description: 'Task ID to delete (required)', }, projectId: { type: 'string', description: 'Project ID containing the task (required)', }, }, required: ['taskId', 'projectId'], }, },
- src/index.ts:163-176 (schema)Input schema definition for the delete_task tool, specifying required taskId and projectId parameters.inputSchema: { type: 'object', properties: { taskId: { type: 'string', description: 'Task ID to delete (required)', }, projectId: { type: 'string', description: 'Project ID containing the task (required)', }, }, required: ['taskId', 'projectId'], },