Skip to main content
Glama

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
NameRequiredDescriptionDefault
dependenciesNoNew list of dependency task IDs
descriptionNoNew description for the task
task_idYesID of the task to update

Implementation Reference

  • 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) }] }; }
  • 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"] } },

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

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