update_task
Modify an existing pending task by updating its description and dependencies using the task ID. Supports task management and coordination within the MCP Orchestrator Server environment.
Instructions
Update an existing pending task
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dependencies | No | New list of dependency task IDs | |
| description | No | New description for the task | |
| task_id | Yes | ID of the task to update |
Implementation Reference
- src/index.ts:131-182 (handler)Handler for the 'update_task' tool. Updates description or dependencies of a pending task after validating task existence, status, dependency existence, and absence of cycles.case "update_task": { const { task_id, description, dependencies } = request.params.arguments as { task_id: string; description?: string; dependencies?: string[]; }; debug(`Updating task ${task_id}`); const task = tasks[task_id]; if (!task) { throw new McpError(ErrorCode.InvalidRequest, `Task ${task_id} not found`); } if (task.status !== 'pending') { throw new McpError(ErrorCode.InvalidRequest, `Cannot update task ${task_id} in ${task.status} state`); } // Verify dependencies exist and don't create cycles if (dependencies) { const visited = new Set<string>(); const checkCycle = (taskId: string): boolean => { if (visited.has(taskId)) return true; visited.add(taskId); return (tasks[taskId]?.dependencies || []).some(depId => checkCycle(depId)); }; for (const depId of dependencies) { if (!tasks[depId]) { throw new McpError(ErrorCode.InvalidRequest, `Dependency task ${depId} not found`); } if (depId === task_id || checkCycle(depId)) { throw new McpError(ErrorCode.InvalidRequest, `Dependencies would create a cycle`); } } task.dependencies = dependencies; } if (description) { task.description = description; } saveTasks(); debug(`Updated task ${task_id}`); return { content: [{ type: "text", text: JSON.stringify(task, null, 2) }] }; }
- src/index.ts:363-387 (schema)Input schema definition for the 'update_task' tool, specifying parameters task_id (required), description, and dependencies.{ name: "update_task", description: "Update an existing pending task", inputSchema: { type: "object", properties: { task_id: { type: "string", description: "ID of the task to update" }, description: { type: "string", description: "New description for the task" }, dependencies: { type: "array", items: { type: "string" }, description: "New list of dependency task IDs" } }, required: ["task_id"] } },