Skip to main content
Glama
108yen

task-orchestrator-mcp

by 108yen

startTask

Initiate task execution by changing status to in_progress. Use this tool to begin processing tasks within the task orchestration system.

Instructions

Start a task (change status to in_progress)

  1. Run this tool to start the task.

  2. When the task is complete, call the completeTask tool to complete the task.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesTask ID

Implementation Reference

  • Core handler function implementing the startTask tool logic: loads tasks, validates parameters and execution order, aggregates criteria and constraints from hierarchy, handles leaf node resets and execution path auto-starting, updates parent statuses, generates response message and hierarchy summary.
    export function startTask(id: string): {
      aggregated_completion_criteria: string[]
      aggregated_constraints: string[]
      hierarchy_summary?: string
      message?: string
      started_tasks: Task[]
      task: Task
    } {
      // Load tasks and validate parameters
      const tasks = readTasks()
      const task = validateStartTaskParams(id, tasks)
    
      // Validate execution order - check if all preceding sibling tasks are completed
      validateExecutionOrder(task, tasks)
    
      // Aggregate completion criteria and constraints from hierarchy
      const { aggregated_completion_criteria, aggregated_constraints } =
        aggregateCriteriaFromHierarchy(id, tasks)
    
      // Process leaf node reset if necessary
      const resetLeafTasks = processLeafNodeReset(task, tasks)
    
      // Start the main task and update parent statuses
      const { startedTasks, updatedTask } = startMainTaskAndUpdateParents(id, tasks)
    
      // Process execution path for nested task starting
      const { depth, executionPath } = processExecutionPath(id, tasks, startedTasks)
    
      // Generate appropriate message
      const message = generateStartTaskMessage(
        task,
        executionPath,
        depth,
        resetLeafTasks,
      )
    
      // Save changes
      writeTasks(tasks)
    
      // Generate hierarchy summary with changed task IDs
      const changedTaskIds = new Set<string>(startedTasks.map((t) => t.id))
      const hierarchySummary = generateHierarchySummary(tasks, changedTaskIds)
    
      return {
        aggregated_completion_criteria,
        aggregated_constraints,
        hierarchy_summary: hierarchySummary.table,
        message,
        started_tasks: startedTasks,
        task: updatedTask,
      }
    }
  • src/tools.ts:320-372 (registration)
    Registers the "startTask" MCP tool with the server, providing description, Zod input schema for task ID, and error-handling wrapper that calls the core startTask function and returns JSON response.
    // Register startTask tool
    server.registerTool(
      "startTask",
      {
        description:
          "Start a task (change status to in_progress)\n\n" +
          "1. Run this tool to start the task. \n" +
          "2. When the task is complete, call the `completeTask` tool to complete the task.",
        inputSchema: {
          id: z.string().describe("Task ID"),
        },
      },
      (args) => {
        try {
          const result = startTask(args.id)
          return {
            content: [
              {
                text: JSON.stringify(result, null, 2),
                type: "text",
              },
            ],
          }
        } catch (error) {
          const errorMessage =
            error instanceof Error ? error.message : "Unknown error"
          const isExecutionOrderError = errorMessage.includes(
            "Execution order violation",
          )
    
          return {
            content: [
              {
                text: JSON.stringify(
                  {
                    error: {
                      code: isExecutionOrderError
                        ? "EXECUTION_ORDER_VIOLATION"
                        : "TASK_START_ERROR",
                      message: errorMessage,
                    },
                  },
                  null,
                  2,
                ),
                type: "text",
              },
            ],
            isError: true,
          }
        }
      },
    )
  • Zod input schema definition for the startTask tool: requires a single 'id' parameter of type string.
      inputSchema: {
        id: z.string().describe("Task ID"),
      },
    },
  • Helper function to validate startTask parameters: checks ID format, task existence, and prevents starting already in_progress or done tasks.
    function validateStartTaskParams(id: string, tasks: Task[]): Task {
      if (!id || typeof id !== "string") {
        throw new Error("Task ID is required and must be a string")
      }
    
      const task = findTaskById(tasks, id)
    
      if (!task) {
        throw new Error(`Task with id '${id}' not found`)
      }
    
      if (task.status === "done") {
        throw new Error(`Task '${id}' is already completed`)
      }
    
      if (task.status === "in_progress") {
        throw new Error(`Task '${id}' is already in progress`)
      }
    
      return task
    }
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. It mentions the status change to 'in_progress', which implies mutation, but fails to disclose critical behavioral traits like required permissions, whether the change is reversible, error conditions (e.g., invalid ID), or response format. This leaves significant gaps for an agent to understand the tool's behavior.

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 and structured as a two-step list, making it efficient and easy to parse. However, the second sentence repeats the tool name ('completeTask') without adding new value, slightly reducing conciseness. Overall, it's well-structured but not perfectly tight.

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

Completeness3/5

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

Given the tool's complexity (a mutation operation with no annotations and no output schema), the description is minimally adequate. It covers the basic purpose and usage but lacks details on behavioral aspects like permissions, errors, or return values. This makes it functional but incomplete for safe and effective use by an agent.

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?

The input schema has 100% description coverage, with the 'id' parameter documented as 'Task ID'. The description adds no additional meaning beyond this, such as format examples or constraints. According to the rules, with high schema coverage (>80%), the baseline is 3, which is appropriate here.

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 ('Start a task') and specifies the effect ('change status to in_progress'), which distinguishes it from siblings like 'completeTask' or 'updateTask'. However, it doesn't explicitly mention what resource it operates on (e.g., a task management system), making it slightly less specific than a perfect 5.

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

Usage Guidelines4/5

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

The description provides explicit guidance on when to use this tool ('Run this tool to start the task') and references an alternative ('call the `completeTask` tool to complete the task'), which helps differentiate it from siblings. It lacks explicit exclusions or prerequisites, such as when not to use it (e.g., if the task is already started), preventing a score of 5.

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/108yen/task-orchestrator-mcp'

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