Skip to main content
Glama

complete_task

Mark a task as completed by specifying the task ID, instance ID, and result to update task status and maintain orchestration progress within the MCP Orchestrator Server.

Instructions

Mark a task as completed

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
instance_idYesID of the instance completing the task
resultYesResult or output from the task
task_idYesID of the task to complete

Implementation Reference

  • Handler for the 'complete_task' tool: validates task and instance, updates task status to completed with result, saves tasks, identifies unlocked dependent tasks, and returns the completed task and unlocked tasks.
    case "complete_task": { const { task_id, instance_id, result } = request.params.arguments as { task_id: string; instance_id: string; result: string; }; debug(`Instance ${instance_id} completing task ${task_id}`); const task = tasks[task_id]; if (!task) { throw new McpError(ErrorCode.InvalidRequest, `Task ${task_id} not found`); } if (task.assignedTo !== instance_id) { throw new McpError(ErrorCode.InvalidRequest, `Task ${task_id} is not assigned to instance ${instance_id}`); } task.status = 'completed'; task.result = result; saveTasks(); debug(`Task ${task_id} completed by instance ${instance_id}`); // Find tasks that can now be started const unlockedTasks = Object.values(tasks).filter(t => t.status === 'pending' && t.dependencies?.includes(task_id) && t.dependencies.every(depId => tasks[depId]?.status === 'completed') ); return { content: [{ type: "text", text: JSON.stringify({ completed_task: task, unlocked_tasks: unlockedTasks }, null, 2) }] }; }
  • Schema definition for the 'complete_task' tool, including input schema with required parameters task_id, instance_id, and result, provided in the listTools response.
    { name: "complete_task", description: "Mark a task as completed", inputSchema: { type: "object", properties: { task_id: { type: "string", description: "ID of the task to complete" }, instance_id: { type: "string", description: "ID of the instance completing the task" }, result: { type: "string", description: "Result or output from the task" } }, required: ["task_id", "instance_id", "result"] } },

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