Skip to main content
Glama
aaronfeingold

MCP Project Context Server

update_task

Modify task details such as status, title, description, or priority on the MCP Project Context Server to maintain accurate project tracking and context across coding sessions.

Instructions

Update task status or details

Input Schema

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

Implementation Reference

  • The MCP tool handler for 'update_task' that processes input, updates the task via ContextManager, and returns a formatted text response.
    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" }`, }, ], }; } }
  • Zod input schema defining parameters for the 'update_task' tool: projectId, taskId, optional status, title, description, priority.
    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)
    Registration of the 'update_task' tool with the MCP server, including name, metadata, schema, and handler reference.
    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" }`, }, ], }; } } );
  • ContextManager.updateTask helper method that finds and updates the specified task in the project, handles completion timestamp, and persists changes.
    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; }

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

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