asana_add_task_dependents
Set task dependencies in Asana by specifying which tasks depend on a particular task, establishing clear workflow relationships and sequencing.
Instructions
Set dependents for a task (tasks that depend on this task)
Input 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 |
Input Schema (JSON Schema)
{
"properties": {
"dependents": {
"description": "Array of task IDs that depend on this task",
"items": {
"type": "string"
},
"type": "array"
},
"task_id": {
"description": "The task ID to add dependents to",
"type": "string"
}
},
"required": [
"task_id",
"dependents"
],
"type": "object"
}
Implementation Reference
- src/tool-handler.ts:270-276 (handler)MCP tool handler switch case that destructures input parameters and delegates to AsanaClientWrapper.addTaskDependents method.case "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 (handler)Core business logic implementation that normalizes dependents array and calls Asana Tasks API to add dependents to the task.async 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; }
- Input schema definition for the tool, specifying required task_id and dependents array.export 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:41-92 (registration)Import of the tool definition and inclusion in the global tools array for MCP registration.addTaskDependenciesTool, addTaskDependentsTool, setParentForTaskTool, addFollowersToTaskTool } from './tools/task-relationship-tools.js'; import { getStoriesForTaskTool, createTaskStoryTool } from './tools/story-tools.js'; import { getTeamsForUserTool, getTeamsForWorkspaceTool, getUsersForWorkspaceTool } from './tools/user-tools.js'; import { getAttachmentsForObjectTool, uploadAttachmentForObjectTool, downloadAttachmentTool } from './tools/attachment-tools.js'; export const tools: Tool[] = [ listWorkspacesTool, searchProjectsTool, getProjectTool, getProjectTaskCountsTool, getProjectSectionsTool, createSectionForProjectTool, createProjectForWorkspaceTool, updateProjectTool, reorderSectionsTool, getProjectStatusTool, getProjectStatusesForProjectTool, createProjectStatusTool, deleteProjectStatusTool, searchTasksTool, getTaskTool, createTaskTool, updateTaskTool, createSubtaskTool, getMultipleTasksByGidTool, addTaskToSectionTool, getTasksForSectionTool, getProjectHierarchyTool, getSubtasksForTaskTool, getTasksForProjectTool, getTasksForTagTool, getTagsForWorkspaceTool, addTagsToTaskTool, addTaskDependenciesTool, addTaskDependentsTool, setParentForTaskTool, addFollowersToTaskTool,
- src/utils/validation.ts:226-235 (helper)Parameter validation logic ensuring task_id is a valid GID and dependents array is provided.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;