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
| 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 |
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
- src/tool-handler.ts:360-366 (handler)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) }], }; }
- src/tools/task-tools.ts:577-607 (schema)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"] } };
- src/tool-handler.ts:61-102 (registration)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
- src/asana-client-wrapper.ts:604-612 (helper)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; } }