asana_add_task_dependencies
Set task dependencies in Asana by linking tasks that must be completed before others can start, ensuring proper workflow sequencing.
Instructions
Set dependencies for a task
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | The task ID to add dependencies to | |
| dependencies | Yes | Array of task IDs that this task depends on |
Implementation Reference
- src/tool-handler.ts:262-268 (handler)Tool handler case that destructures the input arguments (task_id, dependencies) and calls the AsanaClientWrapper.addTaskDependencies method, returning the JSON stringified response.case "asana_add_task_dependencies": { const { task_id, dependencies } = args; const response = await asanaClient.addTaskDependencies(task_id, dependencies); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }
- Defines the MCP Tool object with name, description, and inputSchema specifying required task_id (string) and dependencies (array of strings).export const addTaskDependenciesTool: Tool = { name: "asana_add_task_dependencies", description: "Set dependencies for a task", inputSchema: { type: "object", properties: { task_id: { type: "string", description: "The task ID to add dependencies to" }, dependencies: { type: "array", items: { type: "string" }, description: "Array of task IDs that this task depends on" } }, required: ["task_id", "dependencies"] } };
- src/tool-handler.ts:88-92 (registration)Registers the addTaskDependenciesTool in the exported tools array used by the MCP server.addTagsToTaskTool, addTaskDependenciesTool, addTaskDependentsTool, setParentForTaskTool, addFollowersToTaskTool,
- src/asana-client-wrapper.ts:466-477 (helper)AsanaClientWrapper helper method that normalizes the dependencies to an array and makes the API call to Asana's TasksApi.addDependenciesForTask.async addTaskDependencies(taskId: string, dependencies: any) { // Ensure dependencies is an array const dependenciesArray = this.ensureArray(dependencies); const body = { data: { dependencies: dependenciesArray } }; const response = await this.tasks.addDependenciesForTask(body, taskId); return response.data; }
- src/utils/validation.ts:225-235 (helper)Validation logic specific to this tool: validates task_id as a valid GID and ensures dependencies parameter is present.case 'asana_add_task_dependencies': case 'asana_add_task_dependents': result = validateGid(params.task_id, 'task_id'); if (!result.valid) errors.push(...result.errors); // Verificăm dacă dependencies/dependents există și este un array sau string const arrayParam = toolName === 'asana_add_task_dependencies' ? 'dependencies' : 'dependents'; if (!params[arrayParam]) { errors.push(`${arrayParam} is required`); } break;