Skip to main content
Glama
aaronfeingold

MCP Project Context Server

Update Task

update_task

Modify task status, title, description, or priority within a project to track progress and maintain accurate project information.

Instructions

Update task status or details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectIdYesProject ID
taskIdYesTask ID
statusNoNew task status
titleNoNew task title
descriptionNoNew task description
priorityNoNew task priority

Implementation Reference

  • The handler function for the 'update_task' tool. It calls contextManager.updateTask with the provided parameters and returns a success or error message.
    async ({ projectId, taskId, status, title, description, priority }) => {
      try {
        const updatedTask = await this.contextManager.updateTask(
          projectId,
          taskId,
          {
            ...(status && { status }),
            ...(title && { title }),
            ...(description && { description }),
            ...(priority && { priority }),
          }
        );
        return {
          content: [
            {
              type: "text",
              text: `Task "${updatedTask.title}" updated successfully`,
            },
          ],
        };
      } catch (error) {
        return {
          content: [
            {
              type: "text",
              text: `Error updating task: ${
                error instanceof Error ? error.message : "Unknown error"
              }`,
            },
          ],
        };
      }
    }
  • The input schema definition for the 'update_task' tool, specifying parameters and Zod validation rules.
      title: "Update Task",
      description: "Update task status or details",
      inputSchema: {
        projectId: z.string().describe("Project ID"),
        taskId: z.string().describe("Task ID"),
        status: z
          .enum(["todo", "in-progress", "blocked", "completed"])
          .optional()
          .describe("New task status"),
        title: z.string().optional().describe("New task title"),
        description: z.string().optional().describe("New task description"),
        priority: z
          .enum(["low", "medium", "high", "critical"])
          .optional()
          .describe("New task priority"),
      },
    },
  • src/server.ts:223-276 (registration)
    The registration of the 'update_task' tool using this.server.registerTool, including schema and inline handler.
    this.server.registerTool(
      "update_task",
      {
        title: "Update Task",
        description: "Update task status or details",
        inputSchema: {
          projectId: z.string().describe("Project ID"),
          taskId: z.string().describe("Task ID"),
          status: z
            .enum(["todo", "in-progress", "blocked", "completed"])
            .optional()
            .describe("New task status"),
          title: z.string().optional().describe("New task title"),
          description: z.string().optional().describe("New task description"),
          priority: z
            .enum(["low", "medium", "high", "critical"])
            .optional()
            .describe("New task priority"),
        },
      },
      async ({ projectId, taskId, status, title, description, priority }) => {
        try {
          const updatedTask = await this.contextManager.updateTask(
            projectId,
            taskId,
            {
              ...(status && { status }),
              ...(title && { title }),
              ...(description && { description }),
              ...(priority && { priority }),
            }
          );
          return {
            content: [
              {
                type: "text",
                text: `Task "${updatedTask.title}" updated successfully`,
              },
            ],
          };
        } catch (error) {
          return {
            content: [
              {
                type: "text",
                text: `Error updating task: ${
                  error instanceof Error ? error.message : "Unknown error"
                }`,
              },
            ],
          };
        }
      }
    );
  • Helper method in ContextManager that performs the actual task update logic: locates the task, merges updates, handles special fields like completedAt, and persists to the project store.
    async updateTask(
      projectId: string,
      taskId: string,
      updates: Partial<Task>
    ): Promise<Task> {
      const project = await this.store.getProject(projectId);
      if (!project) {
        throw new Error("Project not found");
      }
    
      const taskIndex = project.tasks.findIndex((t) => t.id === taskId);
      if (taskIndex === -1) {
        throw new Error("Task not found");
      }
    
      const updatedTask = {
        ...project.tasks[taskIndex],
        ...updates,
        updatedAt: new Date().toISOString(),
      };
    
      if (updates.status === "completed" && !updatedTask.completedAt) {
        updatedTask.completedAt = new Date().toISOString();
      }
    
      project.tasks[taskIndex] = updatedTask;
      await this.store.updateProject(project);
    
      return updatedTask;
    }
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 states this is an update operation (implying mutation) but doesn't mention required permissions, whether changes are reversible, error handling, or what happens to existing fields not specified. This leaves significant behavioral gaps for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that communicates the core purpose without any wasted words. It's appropriately sized and front-loaded with essential information.

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

Completeness2/5

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

For a mutation tool with 6 parameters and no annotations or output schema, the description is inadequate. It doesn't explain what happens when only some fields are provided, whether updates are partial or complete, what the response looks like, or any error conditions. The description should provide more context given the complexity and lack of structured metadata.

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 schema description coverage is 100%, so all parameters are documented in the schema. The description mentions 'status or details' which aligns with the schema's parameters (status, title, description, priority), but adds no additional semantic context beyond what the schema already provides. Baseline 3 is appropriate when the schema does the heavy lifting.

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 resource ('task') along with what can be updated ('status or details'), making the purpose immediately understandable. It doesn't explicitly differentiate from sibling tools like 'add_task', but the 'update' vs 'add' distinction is implied through the naming convention.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'add_task' or 'record_decision', nor does it mention prerequisites or context for updating tasks. It simply states what the tool does without any usage context.

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/aaronfeingold/mcp-project-context'

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