Skip to main content
Glama
jakedx6
by jakedx6

add_task_dependency

Establish dependency relationships between tasks to define execution order and manage project workflows within the Helios-9 MCP Server.

Instructions

Add a dependency relationship between tasks

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idYesID of the dependent task
depends_on_task_idYesID of the task this task depends on
dependency_typeNoType of dependency relationshipblocks

Implementation Reference

  • The main handler function that implements the add_task_dependency tool. It validates input, checks task existence, detects circular dependencies, creates the dependency record in the database, and returns the result with related task information.
    export const addTaskDependency = requireAuth(async (args: any) => { const { task_id, depends_on_task_id, dependency_type } = AddTaskDependencySchema.parse(args) logger.info('Adding task dependency', { task_id, depends_on_task_id, dependency_type }) // Validate tasks exist const [task, dependsOnTask] = await Promise.all([ supabaseService.getTask(task_id), supabaseService.getTask(depends_on_task_id) ]) if (!task || !dependsOnTask) { throw new Error('One or both tasks not found') } // Check for circular dependencies const hasCircularDependency = await checkCircularDependency(task_id, depends_on_task_id) if (hasCircularDependency) { throw new Error('Cannot create dependency: would create circular dependency') } // Create dependency record const dependency = await supabaseService.createTaskDependency({ task_id, depends_on_task_id, dependency_type, created_at: new Date().toISOString() }) // Note: blocked status doesn't exist in database schema // In a real implementation, you might use metadata or a separate blocking system return { dependency, task: await supabaseService.getTask(task_id), depends_on_task: dependsOnTask, message: `Dependency created: "${task.title}" ${dependency_type} "${dependsOnTask.title}"` } })
  • Zod schema used for input validation in the addTaskDependency handler.
    const AddTaskDependencySchema = z.object({ task_id: z.string().min(1), depends_on_task_id: z.string().min(1), dependency_type: z.enum(['blocks', 'subtask', 'related']).default('blocks') })
  • MCPTool definition for add_task_dependency, including name, description, and JSON input schema for registration.
    export const addTaskDependencyTool: MCPTool = { name: 'add_task_dependency', description: 'Add a dependency relationship between tasks', inputSchema: { type: 'object', properties: { task_id: { type: 'string', description: 'ID of the dependent task' }, depends_on_task_id: { type: 'string', description: 'ID of the task this task depends on' }, dependency_type: { type: 'string', enum: ['blocks', 'subtask', 'related'], default: 'blocks', description: 'Type of dependency relationship' } }, required: ['task_id', 'depends_on_task_id'] } }
  • Registration of the addTaskDependency handler in the taskHandlers object, mapping tool name to 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 }
  • Inclusion of addTaskDependencyTool in the exported taskTools collection for tool registration.
    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