Skip to main content
Glama

update_task

Modify an existing pending task by updating its description or dependencies to reflect changes in task orchestration workflows.

Instructions

Update an existing pending task

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idYesID of the task to update
descriptionNoNew description for the task
dependenciesNoNew list of dependency task IDs

Implementation Reference

  • Executes the update_task tool: updates pending task's description or dependencies, validates task existence, status, dependency existence, and absence of cycles. Persists changes to tasks.json and returns updated task.
    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 (registration)
    Registers the update_task tool in the listTools response, providing name, description, and input schema for task_id (required), optional 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"] } },
  • Defines the input schema for update_task tool.
    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"] }

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/mokafari/orchestrator-server'

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