Skip to main content
Glama
jakedx6

Helios-9 MCP Server

by jakedx6

create_task_workflow

Build structured workflows with interconnected tasks for project management, organizing dependencies and priorities within Helios-9 projects.

Instructions

Create a workflow with multiple connected tasks

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
project_idYesID of the project
workflow_nameYesName of the workflow
tasksYesArray of tasks to create in the workflow
auto_startNoWhether to automatically start the first tasks

Implementation Reference

  • The main handler function that parses input arguments, creates multiple tasks in sequence, establishes blocking dependencies based on the depends_on indices, and optionally updates independent tasks. Returns summary of created tasks and dependencies.
    export const createTaskWorkflow = requireAuth(async (args: any) => {
      const { project_id, workflow_name, tasks, auto_start } = CreateTaskWorkflowSchema.parse(args)
      
      logger.info('Creating task workflow', { project_id, workflow_name, task_count: tasks.length })
    
      const createdTasks = []
      const taskMap = new Map() // Map task index to created task ID
      
      // Create all tasks first
      for (let i = 0; i < tasks.length; i++) {
        const taskData = tasks[i]
        const task = await supabaseService.createTask({
          title: taskData.title,
          description: taskData.description || null,
          project_id,
          initiative_id: null,
          status: 'todo',
          priority: taskData.priority,
          assignee_id: taskData.assignee_id || null,
          due_date: null
          // Removed metadata as it doesn't exist in the database schema
        })
        
        createdTasks.push(task)
        taskMap.set(i, task.id)
      }
    
      // Create dependencies
      const dependencies = []
      for (let i = 0; i < tasks.length; i++) {
        const taskData = tasks[i]
        const currentTaskId = taskMap.get(i)!
        
        for (const dependsOnIndex of taskData.depends_on) {
          if (dependsOnIndex < i) { // Only allow dependencies on previous tasks
            const dependsOnTaskId = taskMap.get(dependsOnIndex)!
            const dependency = await supabaseService.createTaskDependency({
              task_id: currentTaskId,
              depends_on_task_id: dependsOnTaskId,
              dependency_type: 'blocks'
            })
            dependencies.push(dependency)
          }
        }
      }
    
      // Auto-start first tasks if requested
      if (auto_start) {
        const firstTasks = createdTasks.filter((_, index) => tasks[index].depends_on.length === 0)
        for (const task of firstTasks) {
          await supabaseService.updateTask(task.id, {
            status: 'todo',
            updated_at: new Date().toISOString()
          })
        }
      }
    
      return {
        workflow_name,
        tasks_created: createdTasks.length,
        dependencies_created: dependencies.length,
        tasks: createdTasks,
        dependencies,
        ready_tasks: auto_start ? createdTasks.filter((_, i) => tasks[i].depends_on.length === 0).length : 0
      }
    })
  • Zod validation schema for the create_task_workflow tool input: requires project_id, workflow_name, and at least one task with title; optional fields include description, assignee, priority, estimated_hours, depends_on (array of indices), and auto_start.
    const CreateTaskWorkflowSchema = z.object({
      project_id: z.string().min(1),
      workflow_name: z.string().min(1),
      tasks: z.array(z.object({
        title: z.string().min(1),
        description: z.string().optional(),
        assignee_id: z.string().optional(),
        priority: z.enum(['low', 'medium', 'high']).default('medium'),
        estimated_hours: z.number().positive().optional(),
        depends_on: z.array(z.number()).default([])
      })).min(1),
      auto_start: z.boolean().default(false)
    })
  • MCPTool definition exporting the tool specification including name 'create_task_workflow', description, and JSON inputSchema matching the Zod schema.
    export const createTaskWorkflowTool: MCPTool = {
      name: 'create_task_workflow',
      description: 'Create a workflow with multiple connected tasks',
      inputSchema: {
        type: 'object',
        properties: {
          project_id: {
            type: 'string',
            description: 'ID of the project'
          },
          workflow_name: {
            type: 'string',
            description: 'Name of the workflow'
          },
          tasks: {
            type: 'array',
            items: {
              type: 'object',
              properties: {
                title: { type: 'string' },
                description: { type: 'string' },
                assignee_id: { type: 'string' },
                priority: { type: 'string', enum: ['low', 'medium', 'high'] },
                estimated_hours: { type: 'number' },
                depends_on: { 
                  type: 'array',
                  items: { type: 'number' },
                  description: 'Array of task indices this task depends on'
                }
              },
              required: ['title']
            },
            description: 'Array of tasks to create in the workflow'
          },
          auto_start: {
            type: 'boolean',
            default: false,
            description: 'Whether to automatically start the first tasks'
          }
        },
        required: ['project_id', 'workflow_name', 'tasks']
      }
    }
  • Registration of all task handlers in a map, mapping 'create_task_workflow' to the createTaskWorkflow handler function.
    export const taskHandlers = {
      list_tasks: listTasks,
      create_task: createTask,
      get_task: getTask,
      update_task: updateTask,
      add_task_dependency: addTaskDependency,
      get_task_dependencies: getTaskDependencies,
      create_task_workflow: createTaskWorkflow,
      bulk_update_tasks: bulkUpdateTasks,
      get_task_workflow_status: getTaskWorkflowStatus
    }
  • Collection export of all task tools, including createTaskWorkflowTool.
    export const taskTools = {
      listTasksTool,
      createTaskTool,
      getTaskTool,
      updateTaskTool,
      addTaskDependencyTool,
      getTaskDependenciesTool,
      createTaskWorkflowTool,
      bulkUpdateTasksTool,
      getTaskWorkflowStatusTool
    }

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/jakedx6/helios9-MCP-Server'

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