mark_subtask_done
Update task progress by marking a subtask as completed. Input 'requestId', 'taskId', and 'subtaskId' to display an updated status table. Ensures all subtasks are finished before a task is marked complete.
Instructions
Mark a subtask as done. Provide 'requestId', 'taskId', and 'subtaskId'.
A progress table will be displayed showing the updated status of all tasks and subtasks.
All subtasks must be completed before a task can be marked as done.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| requestId | Yes | ||
| subtaskId | Yes | ||
| taskId | Yes |
Input Schema (JSON Schema)
{
"properties": {
"requestId": {
"type": "string"
},
"subtaskId": {
"type": "string"
},
"taskId": {
"type": "string"
}
},
"required": [
"requestId",
"taskId",
"subtaskId"
],
"type": "object"
}
Implementation Reference
- src/tools/TaskFlowTools.ts:605-608 (handler)The MCP tool handler function for 'mark_subtask_done'. Extracts arguments and delegates to TaskFlowService.markSubtaskDone method.async mark_subtask_done(args: any) { const { requestId, taskId, subtaskId } = args ?? {}; return service.markSubtaskDone(String(requestId), String(taskId), String(subtaskId)); },
- Core service method implementing the logic to mark a subtask as done: loads data, validates, updates subtask.done, saves to file, generates progress table and returns status.public async markSubtaskDone(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 subtask = task.subtasks.find((s) => s.id === subtaskId); if (!subtask) return { status: "error", message: "Subtask not found" }; if (subtask.done) return { status: "already_done", message: "Subtask is already marked done" }; subtask.done = true; await this.saveTasks(); const progressTable = formatTaskProgressTableForRequest(req); return { status: "subtask_marked_done", message: `Subtask ${subtaskId} has been marked as done.\n${progressTable}`, subtask: { id: subtask.id, title: subtask.title, description: subtask.description, done: subtask.done }, allSubtasksDone: task.subtasks.every((s) => s.done), }; }
- JSON Schema defining the input parameters for the 'mark_subtask_done' tool.mark_subtask_done: { type: "object", properties: { requestId: { type: "string" }, taskId: { type: "string" }, subtaskId: { type: "string" }, }, required: ["requestId", "taskId", "subtaskId"], },
- src/tools/TaskFlowTools.ts:263-278 (registration)Tool constant definition exported for registration, including name, description, and inputSchema. Used in server tool list.export const MARK_SUBTASK_DONE_TOOL: Tool = { name: "mark_subtask_done", description: "Mark a subtask as done. Provide 'requestId', 'taskId', and 'subtaskId'.\n\n" + "A progress table will be displayed showing the updated status of all tasks and subtasks.\n\n" + "All subtasks must be completed before a task can be marked as done.", inputSchema: { type: "object", properties: { requestId: { type: "string" }, taskId: { type: "string" }, subtaskId: { type: "string" }, }, required: ["requestId", "taskId", "subtaskId"], }, };
- src/server/TaskFlowServer.ts:74-89 (registration)Inclusion of MARK_SUBTASK_DONE_TOOL in the server's list of available tools returned by ListToolsRequestSchema handler.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, ],