delete_subtask
Remove an uncompleted subtask from a task to update progress and manage workflow effectively.
Instructions
Delete a subtask from a task. Provide 'requestId', 'taskId', and 'subtaskId'.
Only uncompleted subtasks can be deleted.
A progress table will be displayed showing the updated task with its remaining subtasks.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| requestId | Yes | ||
| taskId | Yes | ||
| subtaskId | Yes |
Implementation Reference
- src/tools/TaskFlowTools.ts:615-618 (handler)MCP tool handler function that parses arguments and delegates to the TaskFlowService.deleteSubtask method.async delete_subtask(args: any) { const { requestId, taskId, subtaskId } = args ?? {}; return service.deleteSubtask(String(requestId), String(taskId), String(subtaskId)); },
- Core implementation of subtask deletion in TaskFlowService: loads tasks, validates existence and incompletion, removes subtask, saves, and returns progress table.public async deleteSubtask(requestId: string, taskId: string, subtaskId: string) { await this.loadTasks(); const req = this.getRequest(requestId); if (!req) return { status: "error", message: "Request not found" }; const task = req.tasks.find((t) => t.id === taskId); if (!task) return { status: "error", message: "Task not found" }; const subtaskIndex = task.subtasks.findIndex((s) => s.id === subtaskId); if (subtaskIndex === -1) return { status: "error", message: "Subtask not found" }; if (task.subtasks[subtaskIndex].done) return { status: "error", message: "Cannot delete completed subtask" }; task.subtasks.splice(subtaskIndex, 1); await this.saveTasks(); const progressTable = formatTaskProgressTableForRequest(req); return { status: "subtask_deleted", message: `Subtask ${subtaskId} has been deleted.\n${progressTable}` }; }
- Input schema definition for the delete_subtask tool parameters.delete_subtask: { type: "object", properties: { requestId: { type: "string" }, taskId: { type: "string" }, subtaskId: { type: "string" }, }, required: ["requestId", "taskId", "subtaskId"], },
- src/tools/TaskFlowTools.ts:299-314 (registration)Tool registration: exports the DELETE_SUBTASK_TOOL object with name, description, and inputSchema used by the MCP server.export const DELETE_SUBTASK_TOOL: Tool = { name: "delete_subtask", description: "Delete a subtask from a task. Provide 'requestId', 'taskId', and 'subtaskId'.\n\n" + "Only uncompleted subtasks can be deleted.\n\n" + "A progress table will be displayed showing the updated task with its remaining subtasks.", inputSchema: { type: "object", properties: { requestId: { type: "string" }, taskId: { type: "string" }, subtaskId: { type: "string" }, }, required: ["requestId", "taskId", "subtaskId"], }, };
- src/server/TaskFlowServer.ts:76-76 (registration)Tool registration in the MCP server's listTools response, including DELETE_SUBTASK_TOOL in the available tools array.DELETE_SUBTASK_TOOL,