Skip to main content
Glama
by cristip73

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

NameRequiredDescriptionDefault
task_idYesThe task ID to add dependents to
dependentsYesArray 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

  • 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) }], }; }
  • 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"] } };
  • 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,
  • 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;

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/cristip73/mcp-server-asana'

If you have feedback or need assistance with the MCP directory API, please join our Discord server