asana_get_subtasks_for_task
Retrieve subtasks for any Asana task to track progress, assign responsibilities, and manage dependencies within projects.
Instructions
Get the list of subtasks for a specific task
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | ID of the task to get subtasks for | |
| opt_fields | No | Optional fields for subtasks (e.g. 'name,notes,assignee,due_on,completed') | |
| limit | No | Maximum number of results per page (1-100) | |
| offset | No | Pagination token from previous response | |
| auto_paginate | No | If true, automatically gets all pages and combines results |
Implementation Reference
- src/tool-handler.ts:360-366 (handler)MCP tool handler switch case that destructures input arguments (task_id and opts), calls AsanaClientWrapper.getSubtasksForTask(), and returns the 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) }], }; }
- src/asana-client-wrapper.ts:604-612 (helper)Core implementation in AsanaClientWrapper that calls the Asana SDK TasksApi.getSubtasksForTask(taskId, opts) and returns the data, with basic error handling.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; } }
- src/tools/task-tools.ts:577-607 (schema)Tool schema definition including name, description, and inputSchema 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"] } };
- src/tool-handler.ts:61-103 (registration)Tool registration in the exported tools array that includes getSubtasksForTaskTool (imported from task-tools.ts), making it available to 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 ];