Skip to main content
Glama

update_task

Modify task details such as name, description, notes, dependencies, related files, implementation guide, and verification criteria. Ensures updates align with task status, allowing comprehensive task management and tracking.

Instructions

Update task content, including name, description and notes, dependent tasks, related files, implementation guide and verification criteria. Completed tasks only allow updating summary and related files

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dependenciesNoNew dependency relationships for the task (optional)
descriptionNoNew description content for the task (optional)
implementationGuideNoNew implementation guide for the task (optional)
nameNoNew name for the task (optional)
notesNoNew supplementary notes for the task (optional)
relatedFilesNoList of files related to the task, used to record code files, reference materials, files to be created, etc. related to the task (optional)
taskIdYesUnique identifier of the task to update, must be an existing and unfinished task ID in the system
verificationCriteriaNoNew verification criteria for the task (optional)

Implementation Reference

  • The core handler function for the 'update_task' tool. Validates input parameters, checks task existence, performs the update via modelUpdateTaskContent, handles errors, and returns a formatted response using getUpdateTaskContentPrompt.
    export async function updateTaskContent({
      taskId,
      name,
      description,
      notes,
      relatedFiles,
      dependencies,
      implementationGuide,
      verificationCriteria,
    }: z.infer<typeof updateTaskContentSchema>) {
      if (relatedFiles) {
        for (const file of relatedFiles) {
          if (
            (file.lineStart && !file.lineEnd) ||
            (!file.lineStart && file.lineEnd) ||
            (file.lineStart && file.lineEnd && file.lineStart > file.lineEnd)
          ) {
            return {
              content: [
                {
                  type: "text" as const,
                  text: getUpdateTaskContentPrompt({
                    taskId,
                    validationError:
                      "Invalid line number settings: must set both start and end lines, and the start line must be less than the end line",
                  }),
                },
              ],
            };
          }
        }
      }
    
      if (
        !(
          name ||
          description ||
          notes ||
          dependencies ||
          implementationGuide ||
          verificationCriteria ||
          relatedFiles
        )
      ) {
        return {
          content: [
            {
              type: "text" as const,
              text: getUpdateTaskContentPrompt({
                taskId,
                emptyUpdate: true,
              }),
            },
          ],
        };
      }
    
      // Get the task to check if it exists
      const task = await getTaskById(taskId);
    
      if (!task) {
        return {
          content: [
            {
              type: "text" as const,
              text: getUpdateTaskContentPrompt({
                taskId,
              }),
            },
          ],
          isError: true,
        };
      }
    
      // Record the task and content to be updated
      let updateSummary = `Preparing to update task: ${task.name} (ID: ${task.id})`;
      if (name) updateSummary += `, new name: ${name}`;
      if (description) updateSummary += `, update description`;
      if (notes) updateSummary += `, update notes`;
      if (relatedFiles)
        updateSummary += `, update related files (${relatedFiles.length})`;
      if (dependencies)
        updateSummary += `, update dependencies (${dependencies.length})`;
      if (implementationGuide) updateSummary += `, update implementation guide`;
      if (verificationCriteria) updateSummary += `, update verification criteria`;
    
      // Execute the update operation
      const result = await modelUpdateTaskContent(taskId, {
        name,
        description,
        notes,
        relatedFiles,
        dependencies,
        implementationGuide,
        verificationCriteria,
      });
    
      return {
        content: [
          {
            type: "text" as const,
            text: getUpdateTaskContentPrompt({
              taskId,
              task,
              success: result.success,
              message: result.message,
              updatedTask: result.task,
            }),
          },
        ],
        isError: !result.success,
      };
    }
  • Zod schema defining the input structure and validation for the 'update_task' tool, including taskId (required UUID), optional fields like name, description, notes, dependencies, relatedFiles, etc.
    export const updateTaskContentSchema = z.object({
      taskId: z
        .string()
        .uuid({ message: "Invalid task ID format, please provide a valid UUID format" })
        .describe("Unique identifier of the task to update, must be an existing and unfinished task ID in the system"),
      name: z.string().optional().describe("New name for the task (optional)"),
      description: z.string().optional().describe("New description content for the task (optional)"),
      notes: z.string().optional().describe("New supplementary notes for the task (optional)"),
      dependencies: z
        .array(z.string())
        .optional()
        .describe("New dependency relationships for the task (optional)"),
      relatedFiles: z
        .array(
          z.object({
            path: z
              .string()
              .min(1, { message: "File path cannot be empty, please provide a valid file path" })
              .describe("File path, can be a path relative to the project root directory or an absolute path"),
            type: z
              .nativeEnum(RelatedFileType)
              .describe(
                "Relationship type between the file and task (TO_MODIFY, REFERENCE, CREATE, DEPENDENCY, OTHER)"
              ),
            description: z.string().optional().describe("Supplementary description of the file (optional)"),
            lineStart: z
              .number()
              .int()
              .positive()
              .optional()
              .describe("Starting line of the relevant code block (optional)"),
            lineEnd: z
              .number()
              .int()
              .positive()
              .optional()
              .describe("Ending line of the relevant code block (optional)"),
          })
        )
        .optional()
        .describe(
          "List of files related to the task, used to record code files, reference materials, files to be created, etc. related to the task (optional)"
        ),
      implementationGuide: z
        .string()
        .optional()
        .describe("New implementation guide for the task (optional)"),
      verificationCriteria: z
        .string()
        .optional()
        .describe("New verification criteria for the task (optional)"),
    });
  • src/index.ts:297-303 (registration)
    Registration of the 'update_task' tool in the MCP server's ListToolsRequestHandler, specifying name, description from MD file, and input schema converted to JSON schema.
    {
      name: "update_task",
      description: loadPromptFromTemplate(
        "toolsDescription/updateTask.md"
      ),
      inputSchema: zodToJsonSchema(updateTaskContentSchema),
    },
  • Dispatch handler in the central CallToolRequest handler that parses arguments with the schema and invokes the updateTaskContent function for 'update_task' tool calls.
    case "update_task":
      parsedArgs = await updateTaskContentSchema.safeParseAsync(
        request.params.arguments
      );
      if (!parsedArgs.success) {
        throw new Error(
          `Invalid arguments for tool ${request.params.name}: ${parsedArgs.error.message}`
        );
      }
      taskId = parsedArgs.data.taskId;
      await saveRequest();
      result = await updateTaskContent(parsedArgs.data);
      await saveResponse(result);
      return result;
  • Model-level helper function updateTaskContent that performs the actual database update for task content, called by the tool handler.
    export async function updateTaskContent(
      taskId: string,
      updates: {
        name?: string;
        description?: string;
        notes?: string;
        relatedFiles?: RelatedFile[];
        dependencies?: string[];
        implementationGuide?: string;
        verificationCriteria?: string;
      }
    ): Promise<{ success: boolean; message: string; task?: Task }> {
      // Get task and check if it exists
      const task = await getTaskById(taskId);
    
      if (!task) {
        return { success: false, message: "Task not found" };
      }
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions that 'Completed tasks only allow updating summary and related files,' which adds useful context about limitations. However, it doesn't disclose other critical behaviors such as whether updates are reversible, what permissions are required, error handling, or response format. For a mutation tool with zero annotation coverage, this leaves significant gaps in understanding its operational traits.

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 two sentences that are front-loaded: the first sentence covers the main purpose and key fields, and the second adds an important behavioral constraint. There's no wasted text, and each sentence earns its place by providing essential information. However, it could be slightly more structured by explicitly separating general updates from the completed-task exception.

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 8 parameters, no annotations, and no output schema, the description is moderately complete. It covers the purpose and some behavioral constraints but lacks details on permissions, error handling, and return values. For a mutation tool with rich parameters, it should do more to compensate for the absence of annotations and output schema, such as explaining what happens on success or failure.

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?

The description lists the updatable fields (name, description, notes, dependencies, related files, implementation guide, verification criteria), which aligns with the input schema parameters. Since schema description coverage is 100%, the schema already documents all parameters well. The description adds minimal value beyond the schema by implying the scope of updates but doesn't provide additional syntax, format details, or constraints beyond what's in the schema 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 ('Update task content') and specifies the resource ('task'), listing key updatable fields like name, description, notes, dependencies, files, implementation guide, and verification criteria. It distinguishes from siblings like 'complete_task' or 'delete_task' by focusing on content modification rather than state changes or removal. However, it doesn't explicitly differentiate from 'analyze_task' or 'query_task' in terms of when to use each.

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 implied guidance by stating 'Completed tasks only allow updating summary and related files,' which helps differentiate usage based on task status. However, it doesn't explicitly mention when to use this tool versus alternatives like 'complete_task' for marking completion or 'get_task_detail' for viewing details. No clear exclusions or prerequisites beyond the taskId requirement are stated.

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/liorfranko/mcp-chain-of-thought'

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