Skip to main content
Glama
aaronfeingold

MCP Project Context Server

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; }

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