asana_add_task_dependents
Add dependent tasks to an Asana task to establish workflow dependencies and manage task sequencing within projects.
Instructions
Set dependents for a task (tasks that depend on this task)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | The task ID to add dependents to | |
| dependents | Yes | Array of task IDs that depend on this task |
Implementation Reference
- src/tool-handler.ts:270-276 (handler)Handler case in tool_handler switch that destructures arguments and calls AsanaClientWrapper.addTaskDependents to execute the tool logiccase "asana_add_task_dependents": { const { task_id, dependents } = args; const response = await asanaClient.addTaskDependents(task_id, dependents); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }
- src/asana-client-wrapper.ts:479-490 (helper)Core implementation in AsanaClientWrapper that normalizes dependents array and calls Asana TasksApi.addDependentsForTaskasync addTaskDependents(taskId: string, dependents: any) { // Ensure dependents is an array const dependentsArray = this.ensureArray(dependents); const body = { data: { dependents: dependentsArray } }; const response = await this.tasks.addDependentsForTask(body, taskId); return response.data; }
- Tool definition with input schema specifying task_id and dependents arrayexport const addTaskDependentsTool: Tool = { name: "asana_add_task_dependents", description: "Set dependents for a task (tasks that depend on this task)", inputSchema: { type: "object", properties: { task_id: { type: "string", description: "The task ID to add dependents to" }, dependents: { type: "array", items: { type: "string" }, description: "Array of task IDs that depend on this task" } }, required: ["task_id", "dependents"] } };
- src/tool-handler.ts:89-90 (registration)Registration of the tool in the exported tools array used by MCPaddTaskDependenciesTool, addTaskDependentsTool,
- src/utils/validation.ts:226-235 (schema)Input parameter validation logic for task_id (GID) and dependents array in validateTaskParameterscase '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;