asana_create_subtask
Create a new subtask for an existing Asana task to break down complex work into manageable steps, track progress, and organize project details effectively.
Instructions
Create a new subtask for an existing task
Input 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 |
Input Schema (JSON Schema)
{
"properties": {
"assignee": {
"description": "Assignee (can be 'me' or a user ID)",
"type": "string"
},
"due_on": {
"description": "Due date in YYYY-MM-DD format",
"type": "string"
},
"name": {
"description": "Name of the subtask",
"type": "string"
},
"notes": {
"description": "Description of the subtask",
"type": "string"
},
"opt_fields": {
"description": "Comma-separated list of optional fields to include",
"type": "string"
},
"parent_task_id": {
"description": "The parent task ID to create the subtask under",
"type": "string"
}
},
"required": [
"parent_task_id",
"name"
],
"type": "object"
}
Implementation Reference
- src/tool-handler.ts:278-284 (handler)Handler case in tool_handler switch that executes asana_create_subtask by calling AsanaClientWrapper.createSubtaskcase "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)Input schema and metadata definition for the asana_create_subtask toolexport 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/asana-client-wrapper.ts:587-597 (helper)Core helper method in AsanaClientWrapper that performs the actual Asana API call to create a subtaskasync 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:77-81 (registration)Registration of asana_create_subtask (as createSubtaskTool) in the exported tools array used by MCP servercreateTaskTool, updateTaskTool, createSubtaskTool, getMultipleTasksByGidTool, addTaskToSectionTool,
- src/index.ts:52-58 (registration)MCP server registration of the tool_handler and list_of_tools containing asana_create_subtaskserver.setRequestHandler(ListToolsRequestSchema, async () => { console.error("Received ListToolsRequest"); return { tools: list_of_tools, }; });