Skip to main content
Glama

complete_task

Mark a task as completed in the MCP Orchestrator Server by providing the task ID, instance ID, and result to update task status and track progress.

Instructions

Mark a task as completed

Input Schema

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

Implementation Reference

  • Handler function for the 'complete_task' tool. Validates the task assignment, updates task status to 'completed', saves the task data, identifies unlocked dependent tasks, and returns the completed task details along with any newly 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)
        }]
      };
    }
  • src/index.ts:416-437 (registration)
    Registration of the 'complete_task' tool in the list of available tools, including its name, description, and input schema definition for validation.
    {
      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"]
      }
    },
  • Input schema for the 'complete_task' tool, defining the required parameters: task_id, instance_id, and result.
    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"]
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden but only states the basic action without behavioral details. It doesn't disclose whether this is a mutation (implied but not explicit), what permissions are needed, if it's irreversible, or how it affects task state (e.g., sets status to 'completed'). This leaves significant gaps for a tool that likely modifies data.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero wasted words. It's front-loaded with the core action, making it easy to parse quickly, though this brevity contributes to gaps in other dimensions.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations and no output schema, the description is incomplete. It lacks details on behavior, side effects, return values, and differentiation from siblings. Given the complexity of task management and rich sibling tools, this minimal description leaves the agent under-informed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so parameters are well-documented in the schema. The description adds no additional meaning beyond implying 'task_id' identifies the task to complete, which is already clear from the schema. Baseline 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Mark as completed') and resource ('a task'), making the purpose immediately understandable. However, it doesn't differentiate from siblings like 'update_task' which might also handle completion status, leaving room for ambiguity in a task management system.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'update_task' or 'delete_task'. The description lacks context about prerequisites (e.g., task must be in progress) or exclusions (e.g., cannot complete already completed tasks), offering minimal usage direction.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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