asana_create_subtask
Add subtasks to existing Asana tasks to break down work into manageable components, track progress, and organize project details effectively.
Instructions
Create a new subtask for an existing task
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| parent_task_id | Yes | The parent task ID to create the subtask under | |
| name | Yes | Name of the subtask | |
| notes | No | Description of the subtask | |
| due_on | No | Due date in YYYY-MM-DD format | |
| assignee | No | Assignee (can be 'me' or a user ID) | |
| opt_fields | No | Comma-separated list of optional fields to include |
Implementation Reference
- src/tool-handler.ts:278-284 (handler)The handler case in the tool_handler switch statement that executes the asana_create_subtask tool by destructuring input arguments and calling the AsanaClientWrapper.createSubtask method.case "asana_create_subtask": { const { parent_task_id, opt_fields, ...taskData } = args; const response = await asanaClient.createSubtask(parent_task_id, taskData, { opt_fields }); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }
- src/tools/task-tools.ts:367-400 (schema)The Tool object definition providing the input schema, description, and name for the asana_create_subtask tool.export const createSubtaskTool: Tool = { name: "asana_create_subtask", description: "Create a new subtask for an existing task", inputSchema: { type: "object", properties: { parent_task_id: { type: "string", description: "The parent task ID to create the subtask under" }, name: { type: "string", description: "Name of the subtask" }, notes: { type: "string", description: "Description of the subtask" }, due_on: { type: "string", description: "Due date in YYYY-MM-DD format" }, assignee: { type: "string", description: "Assignee (can be 'me' or a user ID)" }, opt_fields: { type: "string", description: "Comma-separated list of optional fields to include" } }, required: ["parent_task_id", "name"] } };
- src/tool-handler.ts:61-103 (registration)Registration of the tool in the main tools array exported from tool-handler.ts, which aggregates all MCP tools.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:587-597 (helper)The AsanaClientWrapper method that wraps the Asana SDK call to createSubtaskForTask, preparing the request data and handling the API response.async createSubtask(parentTaskId: string, data: any, opts: any = {}) { const taskData = { data: { ...data, // Asigură-te că subtask-ul este adăugat la sfârșitul listei insert_before: null } }; const response = await this.tasks.createSubtaskForTask(taskData, parentTaskId, opts); return response.data; }
- src/tool-handler.ts:26-38 (registration)Import statement that brings the createSubtaskTool into tool-handler.ts for registration in the tools list.import { searchTasksTool, getTaskTool, createTaskTool, updateTaskTool, createSubtaskTool, getMultipleTasksByGidTool, addTaskToSectionTool, getTasksForSectionTool, getProjectHierarchyTool, getSubtasksForTaskTool, getTasksForProjectTool } from './tools/task-tools.js';