Skip to main content
Glama
108yen

task-orchestrator-mcp

by 108yen

updateTask

Modify task details like name, description, status, or resolution using the task ID in the task-orchestrator-mcp server.

Instructions

Update an existing task

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
descriptionNoUpdated task description (optional)
idYesTask ID
nameNoUpdated task name (optional)
resolutionNoTask resolution details (optional)
statusNoUpdated task status (optional)

Implementation Reference

  • Core handler function that implements the updateTask tool logic: validates input, finds task by ID, mutates the task object with provided updates (name, description, status, resolution), persists to storage, and returns the updated task.
    export function updateTask(params: {
      description?: string
      id: string
      name?: string
      resolution?: string
      status?: string
    }): Task {
      const { description, id, name, resolution, status } = params
    
      if (!id || typeof id !== "string") {
        throw new Error(ERROR_MESSAGES.INVALID_TASK_ID)
      }
    
      const tasks = readTasks()
      const currentTask = findTaskById(tasks, id)
    
      if (!currentTask) {
        throw new Error(`Task with id '${id}' not found`)
      }
    
      // Validate status if provided
      if (status !== undefined) {
        const validStatuses = ["todo", "in_progress", "done"]
        if (!validStatuses.includes(status)) {
          throw new Error(
            `Invalid status '${status}'. Must be one of: ${validStatuses.join(", ")}`,
          )
        }
      }
    
      // Update fields if provided
      if (name !== undefined) {
        if (!name || typeof name !== "string" || name.trim() === "") {
          throw new Error("Task name must be a non-empty string")
        }
        currentTask.name = name.trim()
      }
    
      if (description !== undefined) {
        currentTask.description =
          typeof description === "string" ? description.trim() : ""
      }
    
      if (status !== undefined) {
        currentTask.status = status
      }
    
      if (resolution !== undefined) {
        currentTask.resolution =
          typeof resolution === "string" ? resolution.trim() : undefined
      }
    
      writeTasks(tasks)
    
      return currentTask
    }
  • Zod input schema for the updateTask tool defining parameters: id (required), name/description/resolution/status (optional).
    inputSchema: {
      description: z
        .string()
        .describe("Updated task description (optional)")
        .optional(),
      id: z.string().describe("Task ID"),
      name: z.string().describe("Updated task name (optional)").optional(),
      resolution: z
        .string()
        .describe("Task resolution details (optional)")
        .optional(),
      status: z
        .enum(["todo", "in_progress", "done"])
        .describe("Updated task status (optional)")
        .optional(),
    },
  • src/tools.ts:212-274 (registration)
    Registers the updateTask MCP tool with the server, providing description, Zod input schema validation, and a thin wrapper handler that calls the core updateTask function with error handling and JSON response formatting.
    server.registerTool(
      "updateTask",
      {
        description: "Update an existing task",
        inputSchema: {
          description: z
            .string()
            .describe("Updated task description (optional)")
            .optional(),
          id: z.string().describe("Task ID"),
          name: z.string().describe("Updated task name (optional)").optional(),
          resolution: z
            .string()
            .describe("Task resolution details (optional)")
            .optional(),
          status: z
            .enum(["todo", "in_progress", "done"])
            .describe("Updated task status (optional)")
            .optional(),
        },
      },
      (args) => {
        try {
          const task = updateTask(
            args as {
              description?: string
              id: string
              name?: string
              resolution?: string
              status?: string
            },
          )
          return {
            content: [
              {
                text: JSON.stringify({ task }, null, 2),
                type: "text",
              },
            ],
          }
        } catch (error) {
          return {
            content: [
              {
                text: JSON.stringify(
                  {
                    error: {
                      code: "TASK_UPDATE_ERROR",
                      message:
                        error instanceof Error ? error.message : "Unknown error",
                    },
                  },
                  null,
                  2,
                ),
                type: "text",
              },
            ],
            isError: true,
          }
        }
      },
    )
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. 'Update an existing task' implies a mutation operation, but it doesn't specify permissions needed, whether changes are reversible, rate limits, or what happens to unspecified fields. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 extremely concise with just three words, which is efficient and front-loaded. However, it's arguably too brief for a mutation tool with no annotations, as it leaves critical behavioral aspects unspecified, slightly reducing its effectiveness.

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?

Given this is a mutation tool with 5 parameters, no annotations, and no output schema, the description is incomplete. It doesn't explain what the tool returns, error conditions, or behavioral nuances. The agent lacks sufficient context to use this tool safely and effectively compared to siblings.

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 5 parameters with their types, optionality, and enum values. The description adds no additional parameter information beyond what's in the schema, so it meets the baseline of 3 where the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Update an existing task' clearly states the verb (update) and resource (task), but it's quite generic and doesn't differentiate from sibling tools like 'completeTask' or 'startTask' which also modify tasks. It specifies 'existing' which distinguishes from 'createTask', but lacks specificity about what aspects can be updated compared to other mutation tools.

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?

No explicit guidance on when to use this tool versus alternatives is provided. The description doesn't mention prerequisites, when to choose this over 'completeTask' or 'startTask', or any constraints. The agent must infer usage from the tool name and schema alone.

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/108yen/task-orchestrator-mcp'

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