Skip to main content
Glama

update_task

Modify the title or description of an existing, uncompleted task in TaskFlow MCP and view the updated progress table.

Instructions

Update an existing task's title and/or description. Only uncompleted tasks can be updated.

A progress table will be displayed showing the updated task information.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestIdYes
taskIdYes
titleNo
descriptionNo

Implementation Reference

  • MCP tool handler function that extracts arguments and delegates to TaskFlowService.updateTask method to perform the update.
    async update_task(args: any) {
      const { requestId, taskId, title, description } = args ?? {};
      return service.updateTask(String(requestId), String(taskId), { title, description });
    },
  • Tool definition including name, description, and input schema for the update_task tool.
    export const UPDATE_TASK_TOOL: Tool = {
      name: "update_task",
      description:
        "Update an existing task's title and/or description. Only uncompleted tasks can be updated.\n\n" +
        "A progress table will be displayed showing the updated task information.",
      inputSchema: {
        type: "object",
        properties: {
          requestId: { type: "string" },
          taskId: { type: "string" },
          title: { type: "string" },
          description: { type: "string" },
        },
        required: ["requestId", "taskId"],
      },
    };
  • Registration of UPDATE_TASK_TOOL in the list of tools provided by the MCP server.
    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,
      ],
    }));
  • Core service method implementing the task update logic: loads data, validates, sanitizes and applies updates, saves, and returns status with progress table.
    public async updateTask(
      requestId: string,
      taskId: 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" };
      if (task.done) return { status: "error", message: "Cannot update completed task" };
    
      if (updates.title) task.title = sanitizeString(updates.title);
      if (updates.description) task.description = sanitizeString(updates.description);
    
      await this.saveTasks();
    
      const progressTable = formatTaskProgressTableForRequest(req);
      return {
        status: "task_updated",
        message: `Task ${taskId} has been updated.\n${progressTable}`,
        task: { id: task.id, title: task.title, description: task.description },
      };
    }
  • JSON schema definition for update_task input validation in jsonSchemas object (matches tool inputSchema).
    update_task: {
      type: "object",
      properties: {
        requestId: { type: "string" },
        taskId: { type: "string" },
        title: { type: "string" },
        description: { type: "string" },
      },
      required: ["requestId", "taskId"],
    },

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