Skip to main content
Glama

update_task

Modify task properties such as title, description, status, and recommendations for tools or rules. Ensure completed details are provided when marking tasks as done. Follow valid status transitions: not started → in progress → done.

Instructions

Modify a task's properties. Note: (1) completedDetails are required when setting status to 'done', (2) approved tasks cannot be modified, (3) status must follow valid transitions: not started → in progress → done. You can also update tool and rule recommendations to guide task completion.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
completedDetailsNoDetails about the task completion (required if status is set to 'done').
descriptionNoThe new description for the task (optional).
projectIdYesThe ID of the project containing the task (e.g., proj-1).
ruleRecommendationsNoRecommendations for relevant rules to review when completing the task.
statusNoThe new status for the task (optional).
taskIdYesThe ID of the task to update (e.g., task-1).
titleNoThe new title for the task (optional).
toolRecommendationsNoRecommendations for tools to use to complete the task.

Implementation Reference

  • The ToolExecutor for 'update_task' that handles input validation, constructs updates object, and delegates to TaskManager.updateTask.
    const updateTaskToolExecutor: ToolExecutor = {
      name: "update_task",
      async execute(taskManager, args) {
        const projectId = validateProjectId(args.projectId);
        const taskId = validateTaskId(args.taskId);
        const updates: Record<string, string> = {};
    
        if (args.title !== undefined) {
          updates.title = validateRequiredStringParam(args.title, "title");
        }
        if (args.description !== undefined) {
          updates.description = validateRequiredStringParam(args.description, "description");
        }
        if (args.toolRecommendations !== undefined) {
          if (typeof args.toolRecommendations !== "string") {
            throw new AppError(
              "Invalid toolRecommendations: must be a string",
              AppErrorCode.InvalidArgument
            );
          }
          updates.toolRecommendations = args.toolRecommendations;
        }
        if (args.ruleRecommendations !== undefined) {
          if (typeof args.ruleRecommendations !== "string") {
            throw new AppError(
              "Invalid ruleRecommendations: must be a string",
              AppErrorCode.InvalidArgument
            );
          }
          updates.ruleRecommendations = args.ruleRecommendations;
        }
    
        if (args.status !== undefined) {
          const status = args.status;
          if (
            typeof status !== "string" ||
            !["not started", "in progress", "done"].includes(status)
          ) {
            throw new AppError(
              "Invalid status: must be one of 'not started', 'in progress', 'done'",
              AppErrorCode.InvalidArgument
            );
          }
          if (status === "done") {
            updates.completedDetails = validateRequiredStringParam(
              args.completedDetails,
              "completedDetails (required when status = 'done')"
            );
          }
          updates.status = status;
        }
    
        const resultData = await taskManager.updateTask(projectId, taskId, updates);
        return resultData;
      },
    };
    toolExecutorMap.set(updateTaskToolExecutor.name, updateTaskToolExecutor);
  • The Tool object definition including name, description, and inputSchema for the 'update_task' tool.
    const updateTaskTool: Tool = {
      name: "update_task",
      description: "Modify a task's properties. Note: (1) completedDetails are required when setting status to 'done', (2) approved tasks cannot be modified, (3) status must follow valid transitions: not started → in progress → done. You can also update tool and rule recommendations to guide task completion.",
      inputSchema: {
        type: "object",
        properties: {
          projectId: {
            type: "string",
            description: "The ID of the project containing the task (e.g., proj-1).",
          },
          taskId: {
            type: "string",
            description: "The ID of the task to update (e.g., task-1).",
          },
          title: {
            type: "string",
            description: "The new title for the task (optional).",
          },
          description: {
            type: "string",
            description: "The new description for the task (optional).",
          },
          status: {
            type: "string",
            enum: ["not started", "in progress", "done"],
            description: "The new status for the task (optional).",
          },
          completedDetails: {
            type: "string",
            description: "Details about the task completion (required if status is set to 'done').",
          },
          toolRecommendations: {
            type: "string",
            description: "Recommendations for tools to use to complete the task.",
          },
          ruleRecommendations: {
            type: "string",
            description: "Recommendations for relevant rules to review when completing the task.",
          }
        },
        required: ["projectId", "taskId"], // title, description, status are optional, but completedDetails is conditionally required
      },
    };
  • Registration of the updateTaskTool in the ALL_TOOLS export array used for MCP tool listing.
    export const ALL_TOOLS: Tool[] = [
      listProjectsTool,
      readProjectTool,
      createProjectTool,
      deleteProjectTool,
      addTasksToProjectTool,
      finalizeProjectTool,
      generateProjectPlanTool,
    
      listTasksTool,
      readTaskTool,
      createTaskTool,
      updateTaskTool,
      deleteTaskTool,
      approveTaskTool,
      getNextTaskTool,
    ];
  • The core updateTask method in TaskManager that applies updates to the task object, handles validation, and persists changes.
    public async updateTask(
      projectId: string,
      taskId: string,
      updates: {
        title?: string;
        description?: string;
        toolRecommendations?: string;
        ruleRecommendations?: string;
        status?: "not started" | "in progress" | "done";
        completedDetails?: string;
      }
    ): Promise<UpdateTaskSuccessData> {
      await this.ensureInitialized();
      await this.reloadFromDisk();
    
      const proj = this.data.projects.find((p) => p.projectId === projectId);
      if (!proj) {
        throw new AppError(`Project ${projectId} not found`, AppErrorCode.ProjectNotFound);
      }
    
      if (proj.completed) {
        throw new AppError('Project is already completed', AppErrorCode.ProjectAlreadyCompleted);
      }
    
      const task = proj.tasks.find((t) => t.id === taskId);
      if (!task) {
        throw new AppError(`Task ${taskId} not found`, AppErrorCode.TaskNotFound);
      }
    
      if (task.approved) {
        throw new AppError('Cannot modify an approved task', AppErrorCode.CannotModifyApprovedTask);
      }
    
      // Apply updates
      Object.assign(task, updates);
    
      // Generate message if needed
      let message: string | undefined = undefined;
      if (updates.status === 'done' && proj.autoApprove === false) {
        message = `Task marked as done but requires human approval.\nTo approve, user should run: npx taskqueue approve-task -- ${projectId} ${taskId}`;
      }
    
      await this.saveTasks();
      return { task, message };
    }
  • Type definition for the success response data of update_task.
    export interface UpdateTaskSuccessData {
      task: Task; // The updated task object
      message?: string; // Optional message (e.g., approval reminder)
    }
Behavior4/5

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

With no annotations provided, the description carries the full burden and does well by disclosing key behavioral traits: required conditions for 'completedDetails', restrictions on approved tasks, and valid status transitions. It doesn't cover aspects like error handling or response format, but adds substantial value beyond basic functionality.

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 and front-loaded with the core purpose, followed by specific notes. Each sentence adds value (e.g., constraints and additional capabilities), though it could be slightly more streamlined by integrating the recommendation update into the opening statement.

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 of an update tool with 8 parameters, no annotations, and no output schema, the description is adequate but has gaps. It covers key behavioral rules and some parameter context, but lacks details on error cases, response format, or broader system implications, making it minimally viable rather than comprehensive.

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 100%, so the schema already documents all parameters thoroughly. The description adds minimal semantic context (e.g., linking 'completedDetails' to 'done' status and mentioning updates to recommendations), but doesn't significantly enhance understanding beyond the schema, justifying the baseline score.

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 ('Modify') and resource ('task's properties'), making the purpose evident. However, it doesn't explicitly differentiate from sibling tools like 'create_task' or 'delete_task' beyond the basic action, which prevents a perfect score.

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

Usage Guidelines4/5

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

The description provides clear context on when to use this tool (e.g., to update task properties) and includes important constraints like 'approved tasks cannot be modified' and status transition rules. It doesn't explicitly name alternatives like 'create_task' for new tasks or mention prerequisites, keeping it from a 5.

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

Related 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/chriscarrollsmith/taskqueue-mcp'

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