update_subtask
Modify the title or description of an uncompleted subtask within TaskFlow MCP's task management system to reflect changes or corrections.
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 |
|---|---|---|---|
| requestId | Yes | ||
| taskId | Yes | ||
| subtaskId | Yes | ||
| title | No | ||
| description | No |
Implementation Reference
- src/tools/TaskFlowTools.ts:610-613 (handler)MCP tool handler function that parses input arguments and delegates execution 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 the update logic: loads data, validates request/task/subtask existence and incompletion status, sanitizes and applies updates to title/description, persists changes to file, generates progress table, and returns structured response.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 and validation rules 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/server/TaskFlowServer.ts:63-90 (registration)Server registration of the UPDATE_SUBTASK_TOOL in the listTools handler response, making it discoverable to MCP clients.this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ PLAN_TASK_TOOL, GET_NEXT_TASK_TOOL, MARK_TASK_DONE_TOOL, OPEN_TASK_DETAILS_TOOL, LIST_REQUESTS_TOOL, ADD_TASKS_TO_REQUEST_TOOL, UPDATE_TASK_TOOL, DELETE_TASK_TOOL, ADD_SUBTASKS_TOOL, MARK_SUBTASK_DONE_TOOL, 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, ], }));
- src/tools/TaskFlowTools.ts:280-297 (registration)Tool object definition exported for registration, including name, description, and inline inputSchema.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"], }, };