Skip to main content
Glama

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
NameRequiredDescriptionDefault
requestIdYes
taskIdYes
subtaskIdYes
titleNo
descriptionNo

Implementation Reference

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.3/5.0
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions that a 'progress table will be displayed showing the updated task with its subtasks,' which adds some output context. However, it lacks details on permissions needed, whether updates are reversible, error conditions, or rate limits—critical for a mutation tool with zero annotation coverage.

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 well-structured and front-loaded with the core purpose, followed by parameter guidance and behavioral notes. Each sentence adds value: the first defines the tool, the second lists parameters, the third gives a constraint, and the fourth describes output. It could be slightly more concise by integrating the parameter list more fluidly.

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

Completeness3/5

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

Given the complexity (a mutation tool with 5 parameters, no annotations, and no output schema), the description is moderately complete. It covers the basic action, parameters, a key constraint, and output behavior, but lacks details on error handling, authentication, or side effects, which are important for safe usage.

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

Parameters4/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 all parameters ('requestId', 'taskId', 'subtaskId', 'title', 'description') and clarifies that 'title' and 'description' are optional, adding meaningful context beyond the bare schema. However, it doesn't explain the purpose or format of 'requestId', 'taskId', or 'subtaskId', leaving some ambiguity.

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 ('Update a subtask's title or description') and specifies the resource ('subtask'), making the purpose immediately understandable. It distinguishes this from sibling tools like 'update_task' by focusing specifically on subtasks, though it doesn't explicitly contrast with other update tools like 'update_note'.

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 provides some usage context by stating 'Only uncompleted subtasks can be updated,' which gives a conditional rule. However, it doesn't explicitly guide when to choose this tool over alternatives like 'update_task' or 'mark_subtask_done,' nor does it mention prerequisites or exclusions beyond completion status.

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