Skip to main content
Glama
by cristip73

asana_add_task_dependencies

Set task dependencies in Asana by linking tasks that must be completed before others can begin, ensuring proper workflow sequencing and project management.

Instructions

Set dependencies for a task

Input Schema

NameRequiredDescriptionDefault
task_idYesThe task ID to add dependencies to
dependenciesYesArray of task IDs that this task depends on

Input Schema (JSON Schema)

{ "properties": { "dependencies": { "description": "Array of task IDs that this task depends on", "items": { "type": "string" }, "type": "array" }, "task_id": { "description": "The task ID to add dependencies to", "type": "string" } }, "required": [ "task_id", "dependencies" ], "type": "object" }

Implementation Reference

  • Core handler function that implements the tool logic by preparing the request body and calling the Asana SDK's addDependenciesForTask method.
    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; }
  • Tool dispatch handler that extracts parameters and calls the AsanaClientWrapper's addTaskDependencies method.
    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 Tool object with name, description, and input schema for validating tool calls.
    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"] } };
  • Registers the addTaskDependenciesTool in the main tools array used by the MCP server.
    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, getStoriesForTaskTool, createTaskStoryTool, getTeamsForUserTool, getTeamsForWorkspaceTool, addMembersForProjectTool, addFollowersForProjectTool, getUsersForWorkspaceTool, getAttachmentsForObjectTool, uploadAttachmentForObjectTool, downloadAttachmentTool
  • Validates task_id as a valid Asana GID and ensures dependencies array is provided before tool execution.
    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;

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