Skip to main content
Glama

mark_subtask_done

Mark a subtask as completed to update task progress. Requires requestId, taskId, and subtaskId to track completion status across all tasks.

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

TableJSON Schema
NameRequiredDescriptionDefault
requestIdYes
taskIdYes
subtaskIdYes

Implementation Reference

  • MCP tool handler: extracts arguments (requestId, taskId, subtaskId) from input and delegates execution to TaskFlowService.markSubtaskDone
    async mark_subtask_done(args: any) {
      const { requestId, taskId, subtaskId } = args ?? {};
      return service.markSubtaskDone(String(requestId), String(taskId), String(subtaskId));
    },
  • Core implementation: loads task data, validates request/task/subtask existence, marks subtask as done, persists changes to file, generates and returns progress table with 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 for tool input validation: requires requestId, taskId, subtaskId as strings
    mark_subtask_done: {
      type: "object",
      properties: {
        requestId: { type: "string" },
        taskId: { type: "string" },
        subtaskId: { type: "string" },
      },
      required: ["requestId", "taskId", "subtaskId"],
    },
  • Tool registration: MARK_SUBTASK_DONE_TOOL included in the list of tools returned by ListToolsRequestHandler
    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,
      ],
    }));
  • Tool object definition: exports the Tool spec with name, description, and inputSchema for use in server registration and handler binding
    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"],
      },
    };

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/pinkpixel-dev/taskflow-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server