Skip to main content
Glama
blizzy78
by blizzy78

update_task

Modify an existing task by adding dependencies, uncertainty areas, and definitions of done to ensure clarity and progress tracking in the Task Manager MCP Server.

Instructions

A tool to update an existing task. Can optionally provide a list of additional dependencies, uncertainty areas, and definitions of done.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
newDefinitionsOfDoneNoA detailed list of additional criteria that must be met for this task to be considered complete.
newDependsOnTaskIDsYesA list of additional task identifiers this task depends on.
newUncertaintyAreasYesA detailed list of additional areas where there is uncertainty about this task's requirements or execution. May be empty. Ensure list is ordered by priority.
taskIDYesThe identifier of this task.

Implementation Reference

  • tools/index.ts:34-37 (registration)
    Registration of the 'update_task' tool, mapping the name UPDATE_TASK to its handler and schema in the toolHandlers function.
    [UPDATE_TASK]: { handler: handleUpdateTask, schema: UpdateTaskArgsSchema, } satisfies ToolHandlerInfo,
  • The main handler function for the 'update_task' tool. It processes multiple task updates by delegating to handleUpdateSingleTask, computes remaining incomplete tasks, and returns structured results.
    export async function handleUpdateTask({ tasks }: UpdateTaskArgs, taskDB: TaskDB, singleAgent: boolean) { const updatedTasks = new Array<Task>() for (const taskUpdate of tasks) { const task = handleUpdateSingleTask(taskUpdate, taskDB) updatedTasks.push(task) } const taskID = tasks.map((t) => t.taskID)[0] const incompleteTaskIDs = taskDB.incompleteTasksInTree(taskID).map((t) => t.taskID) const res = { tasksUpdated: updatedTasks.map((t) => toBasicTaskInfo(t, false, t.status !== DoneStatus && t.status !== FailedStatus, t.status === TodoStatus) ), incompleteTasksIdealOrder: singleAgent ? incompleteTaskIDs : undefined, } return { content: [], structuredContent: res, } satisfies CallToolResult }
  • Supporting helper function that implements the core logic for updating a single task, including status transitions with validations, setting properties, adding arrays, and removing dependencies.
    function handleUpdateSingleTask({ taskID, set, add, remove }: TaskUpdate, taskDB: TaskDB) { const task = taskDB.get(taskID) if (!task) { throw new Error(`Task not found: ${taskID}`) } if (set) { const { status: newStatus, title, description, goal, criticalPath, estimatedComplexity } = set const oldStatus = task.status const critPathDepsNotDone = task.dependsOnTaskIDs.filter((depTaskID) => { const depTask = taskDB.get(depTaskID)! return depTask.criticalPath && depTask.status !== 'done' }) const transitionValidations: Array<{ from?: TaskStatus; to: TaskStatus; validate: () => void }> = [ { from: DoneStatus, to: FailedStatus, validate() { throw new Error(`Can't transition from ${oldStatus} to ${newStatus}`) }, }, { from: FailedStatus, to: DoneStatus, validate() { throw new Error(`Can't transition from ${oldStatus} to ${newStatus}`) }, }, { to: DoneStatus, validate() { if (critPathDepsNotDone.length > 0) { throw new Error( `Can't transition task ${taskID} to ${newStatus}: Critical path dependencies are not ${DoneStatus}: ${critPathDepsNotDone.join( ', ' )}` ) } }, }, ] transitionValidations .filter((tv) => !tv.from || tv.from === oldStatus) .filter((tv) => tv.to === newStatus) .forEach((tv) => tv.validate()) if (newStatus) { task.status = newStatus } if (title) { task.title = title } if (description) { task.description = description } if (goal) { task.goal = goal } if (typeof criticalPath !== 'undefined') { task.criticalPath = criticalPath } if (estimatedComplexity) { task.estimatedComplexity = estimatedComplexity } } if (add) { const { definitionsOfDone: addDefinitionsOfDone, uncertaintyAreas: addUncertaintyAreas, lessonsLearned: addLessonsLearned, verificationEvidence: addVerificationEvidence, } = add if (addDefinitionsOfDone) { task.definitionsOfDone.push(...addDefinitionsOfDone) } if (addUncertaintyAreas) { task.uncertaintyAreas.push(...addUncertaintyAreas) } if (addLessonsLearned) { task.lessonsLearned.push(...addLessonsLearned) } if (addVerificationEvidence) { task.verificationEvidence.push(...addVerificationEvidence) } } if (remove) { const { dependsOnTaskIDs: removeDependsOnTaskIDs } = remove if (removeDependsOnTaskIDs) { task.dependsOnTaskIDs = task.dependsOnTaskIDs.filter((depTaskID) => !removeDependsOnTaskIDs.includes(depTaskID)) } } return task }
  • Zod schema for the input arguments to the update_task tool, consisting of an array of task updates.
    export const UpdateTaskArgsSchema = z.object({ tasks: TaskUpdateSchema.array().min(1).describe('The tasks to update'), })
  • Inner Zod schema defining the structure of a single task update, used by UpdateTaskArgsSchema. Includes set, add, and remove operations.
    const TaskUpdateSchema = z.object({ taskID: TaskIDSchema.describe('The identifier of the task to change status'), set: z .object({ status: TaskStatusSchema.optional().describe('The new status of this task'), title: TaskTitleSchema.optional(), description: TaskDescriptionSchema.optional(), goal: TaskGoalSchema.optional(), criticalPath: TaskCriticalPathSchema.optional(), estimatedComplexity: TaskComplexitySchema.optional(), }) .optional() .describe('Optional properties to update on this task'), add: z .object({ dependsOnTaskIDs: TaskIDSchema.array().min(1).optional().describe('New tasks that this task depends on'), definitionsOfDone: TaskDefinitionsOfDoneSchema.optional(), uncertaintyAreas: TaskUncertaintyAreasSchema.optional(), lessonsLearned: z .string() .min(1) .array() .min(1) .optional() .describe('Lessons learned while executing this task that may inform future tasks'), verificationEvidence: z .string() .min(1) .array() .min(1) .optional() .describe( 'Verification evidence that this task was executed as planned, and that the definitions of done were met' ), }) .optional() .describe('Optional properties to add to this task'), remove: z .object({ dependsOnTaskIDs: TaskIDSchema.array().min(1).optional().describe('Tasks that this task no longer depends on'), }) .optional() .describe('Optional properties to remove from this task'), })

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

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