delete_task
Remove a specific task from a project by providing the project ID and task ID in the taskqueue-mcp server.
Instructions
Remove a task from a project.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | Yes | The ID of the project containing the task (e.g., proj-1). | |
| taskId | Yes | The ID of the task to delete (e.g., task-1). |
Implementation Reference
- src/server/toolExecutors.ts:472-486 (handler)The ToolExecutor implementation for 'delete_task', which validates input parameters projectId and taskId, then delegates execution to TaskManager.deleteTask.const deleteTaskToolExecutor: ToolExecutor = { name: "delete_task", async execute(taskManager, args) { // 1. Argument Validation const projectId = validateProjectId(args.projectId); const taskId = validateTaskId(args.taskId); // 2. Core Logic Execution const resultData = await taskManager.deleteTask(projectId, taskId); // 3. Return raw success data return resultData; }, }; toolExecutorMap.set(deleteTaskToolExecutor.name, deleteTaskToolExecutor);
- src/server/tools.ts:363-385 (schema)The Tool object definition for 'delete_task' including name, description, and input schema requiring projectId and taskId./** * Delete Task Tool * @param {object} args - A JSON object containing the arguments * @see {deleteTaskToolExecutor} */ const deleteTaskTool: Tool = { name: "delete_task", description: "Remove a task from a project.", inputSchema: { type: "object", properties: { projectId: { type: "string", description: "The ID of the project containing the task (e.g., proj-1).", }, taskId: { type: "string", description: "The ID of the task to delete (e.g., task-1).", }, }, required: ["projectId", "taskId"], }, };
- src/server/TaskManager.ts:558-587 (helper)The core TaskManager.deleteTask method that locates the task in the project, checks preconditions (not completed project, not approved task), removes it from the array, and persists to disk.public async deleteTask(projectId: string, taskId: string): Promise<DeleteTaskSuccessData> { await this.ensureInitialized(); await this.reloadFromDisk(); const proj = this.data.projects.find((p) => p.projectId === projectId); if (!proj) { throw new AppError(`Project ${projectId} not found`, AppErrorCode.ProjectNotFound); } if (proj.completed) { throw new AppError('Project is already completed', AppErrorCode.ProjectAlreadyCompleted); } const taskIndex = proj.tasks.findIndex((t) => t.id === taskId); if (taskIndex === -1) { throw new AppError(`Task ${taskId} not found`, AppErrorCode.TaskNotFound); } const task = proj.tasks[taskIndex]; if (task.approved) { throw new AppError('Cannot delete an approved task', AppErrorCode.CannotModifyApprovedTask); } proj.tasks.splice(taskIndex, 1); await this.saveTasks(); return { message: `Task ${taskId} deleted from project ${projectId}`, }; }
- src/server/tools.ts:432-448 (registration)Registration of the deleteTaskTool in the exported ALL_TOOLS array used for MCP tool listing.export const ALL_TOOLS: Tool[] = [ listProjectsTool, readProjectTool, createProjectTool, deleteProjectTool, addTasksToProjectTool, finalizeProjectTool, generateProjectPlanTool, listTasksTool, readTaskTool, createTaskTool, updateTaskTool, deleteTaskTool, approveTaskTool, getNextTaskTool, ];
- src/server/toolExecutors.ts:486-486 (registration)Registration of the deleteTaskToolExecutor in the toolExecutorMap used by executeToolAndHandleErrors.toolExecutorMap.set(deleteTaskToolExecutor.name, deleteTaskToolExecutor);