Skip to main content
Glama
by cristip73

asana_get_subtasks_for_task

Retrieve subtasks for any Asana task to track progress and manage dependencies. View subtask details including names, assignees, due dates, and completion status.

Instructions

Get the list of subtasks for a specific task

Input Schema

NameRequiredDescriptionDefault
task_idYesID of the task to get subtasks for
opt_fieldsNoOptional fields for subtasks (e.g. 'name,notes,assignee,due_on,completed')
limitNoMaximum number of results per page (1-100)
offsetNoPagination token from previous response
auto_paginateNoIf true, automatically gets all pages and combines results

Input Schema (JSON Schema)

{ "properties": { "auto_paginate": { "default": false, "description": "If true, automatically gets all pages and combines results", "type": "boolean" }, "limit": { "description": "Maximum number of results per page (1-100)", "type": "number" }, "offset": { "description": "Pagination token from previous response", "type": "string" }, "opt_fields": { "description": "Optional fields for subtasks (e.g. 'name,notes,assignee,due_on,completed')", "type": "string" }, "task_id": { "description": "ID of the task to get subtasks for", "type": "string" } }, "required": [ "task_id" ], "type": "object" }

Implementation Reference

  • Handler switch case that destructures input arguments and calls the Asana client method to retrieve subtasks, then returns JSON stringified response.
    case "asana_get_subtasks_for_task": { const { task_id, ...opts } = args; const response = await asanaClient.getSubtasksForTask(task_id, opts); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }
  • Tool schema definition including name, description, and input schema with required task_id and optional pagination/fields parameters.
    export const getSubtasksForTaskTool: Tool = { name: "asana_get_subtasks_for_task", description: "Get the list of subtasks for a specific task", inputSchema: { type: "object", properties: { task_id: { type: "string", description: "ID of the task to get subtasks for" }, opt_fields: { type: "string", description: "Optional fields for subtasks (e.g. 'name,notes,assignee,due_on,completed')" }, limit: { type: "number", description: "Maximum number of results per page (1-100)" }, offset: { type: "string", description: "Pagination token from previous response" }, auto_paginate: { type: "boolean", description: "If true, automatically gets all pages and combines results", default: false } }, required: ["task_id"] } };
  • Registration of all tools in the tools array, including getSubtasksForTaskTool which provides the schema for 'asana_get_subtasks_for_task'.
    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
  • Core helper method in AsanaClientWrapper that wraps the Asana SDK TasksApi.getSubtasksForTask call, handling the API request and error logging.
    async getSubtasksForTask(taskId: string, opts: any = {}) { try { const response = await this.tasks.getSubtasksForTask(taskId, opts); return response.data; } catch (error) { console.error("Error in getSubtasksForTask:", error); throw error; } }

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