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

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

With no annotations provided, the description carries the full burden. It discloses that updates are restricted to uncompleted subtasks and mentions a progress table display, adding useful behavioral context. However, it lacks details on permissions, error handling, or mutation effects, leaving gaps for a tool with no 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 appropriately sized with three sentences: the first states the purpose and parameters, the second adds a constraint, and the third describes output behavior. It's front-loaded with essential info, though the last sentence could be more concise.

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 no annotations, 0% schema coverage, and no output schema, the description is moderately complete. It covers purpose, parameters, a key constraint, and output indication, but lacks details on error cases, auth needs, or return values, which are important for a mutation tool.

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

Parameters3/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 5 parameters and indicates that 'title' and 'description' are optional, adding meaning beyond the bare schema. However, it doesn't explain parameter formats, constraints, or examples, providing only basic semantics.

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 verb 'update' and the resource 'subtask's title or description', making the purpose specific. It distinguishes from sibling tools like 'update_task' by focusing on subtasks, though it doesn't explicitly contrast with 'update_note' or 'update_prompts'.

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 implies when not to use it. However, it doesn't explicitly guide when to choose this over alternatives like 'update_task' or 'mark_subtask_done', leaving usage partly implied.

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

Install Server

Other Tools

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