get_task_dependencies
Retrieve all dependencies for a task or project in Helios-9, including optional transitive dependencies, to understand relationships and manage project workflows.
Instructions
Get all dependencies for a task or project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | No | ID of the task (optional if project_id provided) | |
| project_id | No | ID of the project (optional if task_id provided) | |
| include_transitive | No | Include transitive dependencies |
Implementation Reference
- src/tools/tasks.ts:588-617 (handler)The primary handler function for the 'get_task_dependencies' MCP tool. It validates input, fetches dependencies from the service, builds a dependency graph, computes critical path analysis for projects, and returns comprehensive dependency information including blocked tasks and analysis.export const getTaskDependencies = requireAuth(async (args: any) => { const { task_id, project_id, include_transitive } = GetTaskDependenciesSchema.parse(args) logger.info('Getting task dependencies', { task_id, project_id, include_transitive }) let dependencies if (task_id) { dependencies = await supabaseService.getTaskDependencies(task_id) } else { dependencies = await supabaseService.getProjectDependencies(project_id!) } // Build dependency graph const dependencyGraph = buildDependencyGraph(dependencies) // Calculate critical path if project-level let criticalPath = null if (project_id) { const projectTasks = await supabaseService.getTasks({ project_id }) criticalPath = calculateCriticalPath(projectTasks, dependencies) } return { dependencies, dependency_graph: dependencyGraph, critical_path: criticalPath, blocked_tasks: dependencies.filter(d => d.dependency_type === 'blocks' && d.depends_on_task?.status !== 'done'), analysis: analyzeDependencies(dependencies) } })
- src/tools/tasks.ts:580-586 (schema)Zod schema used for input validation in the handler, ensuring either task_id or project_id is provided.const GetTaskDependenciesSchema = z.object({ task_id: z.string().optional(), project_id: z.string().optional(), include_transitive: z.boolean().default(false) }).refine(data => data.task_id || data.project_id, { message: "Either task_id or project_id must be provided" })
- src/tools/tasks.ts:557-578 (registration)MCPTool object definition that registers the tool with name, description, and JSON input schema for MCP protocol.export const getTaskDependenciesTool: MCPTool = { name: 'get_task_dependencies', description: 'Get all dependencies for a task or project', inputSchema: { type: 'object', properties: { task_id: { type: 'string', description: 'ID of the task (optional if project_id provided)' }, project_id: { type: 'string', description: 'ID of the project (optional if task_id provided)' }, include_transitive: { type: 'boolean', default: false, description: 'Include transitive dependencies' } } } }
- src/tools/tasks.ts:1157-1167 (registration)Maps tool names to their handler functions. This object is imported and spread into the main allHandlers registry in src/index.ts for MCP tool execution.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 }
- src/lib/api-client.ts:620-623 (helper)Service method called by the handler to fetch raw dependencies from the backend (currently a placeholder implementation).async getTaskDependencies(taskId: string): Promise<any[]> { logger.warn('Task dependencies not yet implemented in API') return [] }