Skip to main content
Glama
aafsar

Task Manager MCP Server

by aafsar

update_task

Modify existing tasks in the Task Manager MCP Server by updating titles, descriptions, priorities, categories, due dates, or statuses to keep task information current and accurate.

Instructions

Update an existing task

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
taskIdYesTask ID (use first 8 characters)
titleNoNew title
descriptionNoNew description
priorityNoNew priority
categoryNoNew category
dueDateNoNew due date (YYYY-MM-DD)
statusNoNew status

Implementation Reference

  • Executes the update_task tool: validates args with UpdateTaskSchema, loads tasks, finds task by partial ID, updates fields, saves, returns formatted response.
    export async function updateTask(args: unknown) { // Validate input const validated = UpdateTaskSchema.parse(args); // Load tasks const storage = await loadTasks(); // Find task by ID (partial match) const taskIndex = storage.tasks.findIndex((t) => t.id.startsWith(validated.taskId) ); if (taskIndex === -1) { return { content: [ { type: "text", text: `❌ Task with ID ${validated.taskId} not found.`, }, ], }; } const task = storage.tasks[taskIndex]!; // Update fields if provided if (validated.title !== undefined) { task.title = validated.title; } if (validated.description !== undefined) { task.description = validated.description; } if (validated.priority !== undefined) { task.priority = validated.priority as Priority; } if (validated.category !== undefined) { task.category = validated.category; } if (validated.dueDate !== undefined) { task.dueDate = validated.dueDate; } if (validated.status !== undefined) { task.status = validated.status as Status; if (validated.status === "completed" && !task.completedAt) { task.completedAt = new Date().toISOString(); } else if (validated.status !== "completed") { task.completedAt = undefined; } } await saveTasks(storage); return { content: [ { type: "text", text: `✅ Task updated successfully!\n\n${formatTask(task)}`, }, ], }; }
  • Zod schema defining the input validation for update_task tool arguments.
    export const UpdateTaskSchema = z.object({ taskId: z.string().min(8, "Task ID must be at least 8 characters"), title: z.string().optional(), description: z.string().optional(), priority: z.enum(["low", "medium", "high"]).optional(), category: z.string().optional(), dueDate: z .string() .regex(/^\d{4}-\d{2}-\d{2}$/, "Date must be YYYY-MM-DD") .optional(), status: z.enum(["pending", "in_progress", "completed"]).optional(), });
  • src/index.ts:84-125 (registration)
    Registers the update_task tool in the TOOLS array with name, description, and JSON inputSchema for MCP ListToolsRequest.
    { name: "update_task", description: "Update an existing task", inputSchema: { type: "object", properties: { taskId: { type: "string", description: "Task ID (use first 8 characters)", minLength: 8, }, title: { type: "string", description: "New title", }, description: { type: "string", description: "New description", }, priority: { type: "string", enum: ["low", "medium", "high"], description: "New priority", }, category: { type: "string", description: "New category", }, dueDate: { type: "string", pattern: "^\\d{4}-\\d{2}-\\d{2}$", description: "New due date (YYYY-MM-DD)", }, status: { type: "string", enum: ["pending", "in_progress", "completed"], description: "New status", }, }, required: ["taskId"], }, },
  • src/index.ts:221-222 (registration)
    Dispatches calls to the updateTask handler function in the MCP CallToolRequest switch statement.
    case "update_task": return await updateTask(args);

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/aafsar/task-manager-mcp-server'

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