update_subtask
Modify uncompleted subtasks by updating their title or description. Input 'requestId', 'taskId', 'subtaskId', and optional fields. View progress with updated task details.
Instructions
Update a subtask's title or description. Provide 'requestId', 'taskId', 'subtaskId', and optionally 'title' and/or 'description'.
Only uncompleted subtasks can be updated.
A progress table will be displayed showing the updated task with its subtasks.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | ||
| requestId | Yes | ||
| subtaskId | Yes | ||
| taskId | Yes | ||
| title | No |
Implementation Reference
- src/tools/TaskFlowTools.ts:610-613 (handler)MCP tool handler function for 'update_subtask'. Extracts parameters from args and delegates to TaskFlowService.updateSubtask method.async update_subtask(args: any) { const { requestId, taskId, subtaskId, title, description } = args ?? {}; return service.updateSubtask(String(requestId), String(taskId), String(subtaskId), { title, description }); },
- Core service method implementing subtask update logic: loads data, validates request/task/subtask exist and subtask not done, sanitizes and applies updates, saves file, generates progress table.public async updateSubtask( requestId: string, taskId: string, subtaskId: string, updates: { title?: string; description?: 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 subtask = task.subtasks.find((s) => s.id === subtaskId); if (!subtask) return { status: "error", message: "Subtask not found" }; if (subtask.done) return { status: "error", message: "Cannot update completed subtask" }; if (updates.title) subtask.title = sanitizeString(updates.title); if (updates.description) subtask.description = sanitizeString(updates.description); await this.saveTasks(); const progressTable = formatTaskProgressTableForRequest(req); return { status: "subtask_updated", message: `Subtask ${subtaskId} has been updated.\n${progressTable}`, subtask: { id: subtask.id, title: subtask.title, description: subtask.description, done: subtask.done }, }; }
- JSON Schema defining the input parameters for the 'update_subtask' tool.update_subtask: { type: "object", properties: { requestId: { type: "string" }, taskId: { type: "string" }, subtaskId: { type: "string" }, title: { type: "string" }, description: { type: "string" }, }, required: ["requestId", "taskId", "subtaskId"], },
- src/tools/TaskFlowTools.ts:280-297 (registration)Tool object definition including name, description, and inputSchema for 'update_subtask', exported and used in server registration.export const UPDATE_SUBTASK_TOOL: Tool = { name: "update_subtask", description: "Update a subtask's title or description. Provide 'requestId', 'taskId', 'subtaskId', and optionally 'title' and/or 'description'.\n\n" + "Only uncompleted subtasks can be updated.\n\n" + "A progress table will be displayed showing the updated task with its subtasks.", inputSchema: { type: "object", properties: { requestId: { type: "string" }, taskId: { type: "string" }, subtaskId: { type: "string" }, title: { type: "string" }, description: { type: "string" }, }, required: ["requestId", "taskId", "subtaskId"], }, };
- src/server/TaskFlowServer.ts:75-89 (registration)Registration of UPDATE_SUBTASK_TOOL in the server's list of available tools returned by listTools.UPDATE_SUBTASK_TOOL, DELETE_SUBTASK_TOOL, EXPORT_TASK_STATUS_TOOL, ADD_NOTE_TOOL, UPDATE_NOTE_TOOL, DELETE_NOTE_TOOL, ADD_DEPENDENCY_TOOL, GET_PROMPTS_TOOL, SET_PROMPTS_TOOL, UPDATE_PROMPTS_TOOL, REMOVE_PROMPTS_TOOL, ARCHIVE_COMPLETED_REQUESTS_TOOL, LIST_ARCHIVED_REQUESTS_TOOL, RESTORE_ARCHIVED_REQUEST_TOOL, ],