asana_set_parent_for_task
Set a task's parent in Asana and position it among other subtasks using insert_after or insert_before parameters to organize your project hierarchy.
Instructions
Set the parent of a task and position the subtask within the other subtasks of that parent
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | ||
| task_id | Yes | The task ID to operate on | |
| opts | No |
Input Schema (JSON Schema)
{
"properties": {
"data": {
"insert_after": {
"description": "A subtask of the parent to insert the task after, or null to insert at the beginning of the list. Cannot be used with insert_before. The task must already be set as a subtask of that parent.",
"type": "string"
},
"insert_before": {
"description": "A subtask of the parent to insert the task before, or null to insert at the end of the list. Cannot be used with insert_after. The task must already be set as a subtask of that parent.",
"type": "string"
},
"parent": {
"description": "The GID of the new parent of the task, or null for no parent",
"required": true,
"type": "string"
}
},
"opts": {
"opt_fields": {
"description": "Comma-separated list of optional fields to include",
"type": "string"
}
},
"task_id": {
"description": "The task ID to operate on",
"type": "string"
}
},
"required": [
"task_id",
"data"
],
"type": "object"
}
Implementation Reference
- src/tool-handler.ts:298-310 (handler)Handler logic for executing the asana_set_parent_for_task tool: parses JSON args if needed and delegates to AsanaClientWrapper.setParentForTaskcase "asana_set_parent_for_task": { let { data, task_id, opts } = args; if ( typeof data == "string" ) { data = JSON.parse( data ); } if ( typeof opts == "string" ) { opts = JSON.parse( opts ); } const response = await asanaClient.setParentForTask(data, task_id, opts); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }
- Tool schema definition including inputSchema with properties for data (parent, insert_after, insert_before), task_id, and optsexport const setParentForTaskTool: Tool = { name: "asana_set_parent_for_task", description: "Set the parent of a task and position the subtask within the other subtasks of that parent", inputSchema: { type: "object", properties: { data: { parent: { type: "string", description: "The GID of the new parent of the task, or null for no parent", required: true }, insert_after: { type: "string", description: "A subtask of the parent to insert the task after, or null to insert at the beginning of the list. Cannot be used with insert_before. The task must already be set as a subtask of that parent." }, insert_before: { type: "string", description: "A subtask of the parent to insert the task before, or null to insert at the end of the list. Cannot be used with insert_after. The task must already be set as a subtask of that parent." }, }, task_id: { type: "string", description: "The task ID to operate on" }, opts: { opt_fields: { type: "string", description: "Comma-separated list of optional fields to include" } } }, required: ["task_id", "data"] } };
- src/tool-handler.ts:91-91 (registration)Registration of the tool in the exported tools array used by MCPsetParentForTaskTool,
- src/asana-client-wrapper.ts:599-602 (helper)AsanaClientWrapper helper method that wraps the Asana SDK call to setParentForTaskasync setParentForTask(data: any, taskId: string, opts: any = {}) { const response = await this.tasks.setParentForTask({ data }, taskId, opts); return response.data; }
- src/tool-handler.ts:41-45 (registration)Import of the setParentForTaskTool for registration in tool-handler.tsaddTaskDependenciesTool, addTaskDependentsTool, setParentForTaskTool, addFollowersToTaskTool } from './tools/task-relationship-tools.js';