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"],
      },
    };

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions that 'A progress table will be displayed showing the updated status of all tasks and subtasks', which adds some behavioral context about output. However, it lacks details on permissions, side effects (e.g., if this is irreversible), or error handling, which are important for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized with three sentences. The first sentence states the purpose and parameters, the second describes the output, and the third provides a prerequisite. It is front-loaded with the core action, though the third sentence could be more integrated.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations, 0% schema coverage, no output schema, and 3 parameters for a mutation tool, the description is incomplete. It mentions output behavior but lacks details on return values, error conditions, or dependencies, leaving gaps for an AI agent to understand full usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It lists the parameters ('requestId', 'taskId', 'subtaskId') but does not explain their meaning, format, or relationships. This adds minimal value beyond the schema, which already specifies the required parameters without descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Mark a subtask as done') and specifies the required parameters ('requestId', 'taskId', 'subtaskId'), which distinguishes it from siblings like 'mark_task_done' or 'update_subtask'. However, it does not explicitly differentiate from all siblings, such as 'delete_subtask', which also operates on subtasks.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by stating 'All subtasks must be completed before a task can be marked as done', which suggests a prerequisite but does not explicitly say when to use this tool versus alternatives like 'mark_task_done' or 'update_subtask'. No exclusions or clear alternatives are provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.