Skip to main content
Glama
hrishirc

Task Orchestration

complete_task_status

Update task completion status within goals using dot-notation IDs, optionally completing child tasks recursively.

Instructions

Update the completion status of tasks. Task IDs use a dot-notation (e.g., "1", "1.1", "1.1.1"). Responses will return simplified task objects without createdAt, updatedAt, or parentId.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
goalIdYesID of the goal containing the tasks (number)
taskIdsYesIDs of the tasks to update (array of strings). Example: ["1.1", "1.2"].
completeChildrenNoWhether to complete all child tasks recursively (boolean). Defaults to false. If false, a task can only be completed if all its subtasks are already complete.

Implementation Reference

  • MCP tool handler for 'complete_task_status' that parses input arguments, calls storage.completeTasksStatus, and returns the JSON-stringified results.
    case 'complete_task_status': {
      const { goalId, taskIds, completeChildren } = request.params.arguments as {
        goalId: number;
        taskIds: string[];
        completeChildren?: boolean;
      };
      const results = await storage.completeTasksStatus(goalId, taskIds, completeChildren);
      const textContent = JSON.stringify(results, null, 2);
      return {
        content: [
          {
            type: 'text',
            text: textContent,
          } as { type: 'text'; text: string },
        ],
      };
    }
  • src/index.ts:164-189 (registration)
    Tool registration including name, description, and input schema for 'complete_task_status'.
    {
      name: 'complete_task_status',
      description: 'Update the completion status of tasks. Task IDs use a dot-notation (e.g., "1", "1.1", "1.1.1"). Responses will return simplified task objects without `createdAt`, `updatedAt`, or `parentId`.',
      inputSchema: {
        type: 'object',
        properties: {
          goalId: {
            type: 'number',
            description: 'ID of the goal containing the tasks (number)',
          },
          taskIds: {
            type: 'array',
            items: {
              type: 'string',
            },
            description: 'IDs of the tasks to update (array of strings). Example: ["1.1", "1.2"].',
          },
          completeChildren: {
            type: 'boolean',
            description: 'Whether to complete all child tasks recursively (boolean). Defaults to false. If false, a task can only be completed if all its subtasks are already complete.',
            default: false,
          },
        },
        required: ['goalId', 'taskIds'],
      },
    },
  • Core implementation of task completion logic in storage, handling recursive completion of children if specified, checking subtasks, updating parent statuses, and persisting changes to the database.
    async completeTasksStatus(
      goalId: number,
      taskIds: string[],
      completeChildren: boolean = false
    ): Promise<{ updatedTasks: TaskResponse[]; completedParents: TaskResponse[] }> {
      const plan = await this.getPlan(goalId);
      if (!plan) {
        throw new Error(`No plan found for goal ${goalId}`);
      }
    
      const updatedTasks: TaskResponse[] = [];
      const completedParents: TaskResponse[] = [];
      const parentsToCheck: Set<string | null> = new Set();
    
      const completeTaskAndChildren = async (taskId: string) => {
        const task = this.tasks.findOne({ goalId, id: taskId });
        if (!task) return;
    
        // If completeChildren is true, mark all subtasks as complete first
        if (completeChildren) {
          const subtasks = this.tasks.find({ goalId, parentId: taskId });
          for (const subtask of subtasks) {
            await completeTaskAndChildren(subtask.id); // Recursively complete children
          }
        } else {
          // A task can be completed only if all its non-deleted sub-tasks (if any) are completed.
          const subtasks = this.tasks.find({ goalId, parentId: taskId, deleted: false });
          const allSubtasksComplete = subtasks.every(sub => sub.isComplete);
          if (!allSubtasksComplete) {
            console.warn(`Task ${taskId} cannot be marked complete because not all its non-deleted subtasks are complete.`);
            return; // Do not mark this task as complete
          }
        }
    
        // Only update if status is changing to complete
        if (!task.isComplete) {
          task.isComplete = true;
          task.updatedAt = new Date().toISOString();
          this.tasks.update(task);
          const { createdAt, updatedAt, parentId: _, $loki, meta, ...taskData } = task as LokiTask;
          updatedTasks.push(taskData);
        }
    
        // Add parent to set for status check later
        if (task.parentId !== null) {
          parentsToCheck.add(task.parentId);
        }
      };
    
      for (const taskId of taskIds) {
        await completeTaskAndChildren(taskId);
      }
    
      // After updating tasks, check and update parent statuses
      for (const parentId of parentsToCheck) {
        const completedParent = await this.updateParentTaskStatus(goalId, parentId);
        if (completedParent) {
          completedParents.push(completedParent);
        }
      }
    
      plan.updatedAt = new Date().toISOString();
      await this.save();
      return { updatedTasks, completedParents };
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It mentions that responses return simplified task objects without certain fields, which adds some context about output behavior. However, it fails to disclose critical traits like whether this is a mutation (implied by 'Update'), permission requirements, error handling, or side effects on child tasks beyond the parameter description.

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

Conciseness4/5

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

The description is front-loaded with the core purpose in the first sentence, followed by important details about ID format and response format. Both sentences earn their place by providing necessary context. It avoids redundancy and is appropriately sized for a tool with three parameters.

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?

Given that this is a mutation tool with no annotations and no output schema, the description is incomplete. It lacks information about behavioral traits (e.g., authentication needs, side effects), error conditions, and typical usage patterns. While it covers ID format and response simplification, it doesn't compensate for the absence of structured data about the tool's operation.

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 the schema already documents all parameters thoroughly. The description adds minimal value by mentioning the dot-notation format for task IDs, which is useful but not essential since the schema provides an example. No additional semantic context is given for parameters like 'goalId' or 'completeChildren' beyond what's in the schema.

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 verb 'Update' and resource 'completion status of tasks', making the purpose immediately understandable. It distinguishes from siblings like 'add_tasks' or 'remove_tasks' by focusing on status modification rather than creation or deletion. However, it doesn't explicitly contrast with 'get_tasks' for read vs. write operations.

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 'add_tasks' or 'remove_tasks'. The description mentions task ID format and response format but offers no context about prerequisites, error conditions, or typical scenarios for invoking this tool. Usage is implied only through the action of updating status.

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/hrishirc/task-orchestrator'

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