Skip to main content
Glama

asana_create_subtask

Create a subtask within an existing Asana task to break down work into manageable components. Specify details like name, description, due date, and assignee to organize project workflows.

Instructions

Create a new subtask for an existing task

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
parent_task_idYesThe parent task ID to create the subtask under
nameYesName of the subtask
notesNoDescription of the subtask
html_notesNoHTML-like formatted description of the subtask. Does not support ALL HTML tags. Only a subset. The only allowed TAG in the HTML are: <body> <h1> <h2> <ol> <ul> <li> <strong> <em> <u> <s> <code> <pre> <blockquote> <a data-asana-type="" data-asana-gid=""> <hr> <img> <table> <tr> <td>. No other tags are allowed. Use the \n to create a newline. Do not use \n after <body>. Example: <body><h1>Motivation</h1> A customer called in to complain <h1>Goal</h1> Fix the problem</body>
due_onNoDue date in YYYY-MM-DD format
assigneeNoAssignee (can be 'me' or a user ID)
opt_fieldsNoComma-separated list of optional fields to include

Implementation Reference

  • Handler function in the main tool switch statement that processes calls to 'asana_create_subtask', performs HTML validation if notes provided, and calls the AsanaClientWrapper.createSubtask method.
    case "asana_create_subtask": {
      const { parent_task_id, opt_fields, ...taskData } = args;
    
      try {
        // Validate html_notes if provided
        if (taskData.html_notes) {
          const xmlValidationErrors = validateAsanaXml(taskData.html_notes);
          if (xmlValidationErrors.length > 0) {
            return {
              content: [{
                type: "text",
                text: JSON.stringify({
                  error: "HTML validation failed",
                  validation_errors: xmlValidationErrors,
                  message: "The HTML notes contain invalid XML formatting. Please check the validation errors above."
                })
              }],
            };
          }
        }
    
        const response = await asanaClient.createSubtask(parent_task_id, taskData, { opt_fields });
        return {
          content: [{ type: "text", text: JSON.stringify(response) }],
        };
      } catch (error) {
        // When error occurs and html_notes was provided, help troubleshoot
        if (taskData.html_notes && error instanceof Error && error.message.includes('400')) {
          return {
            content: [{
              type: "text",
              text: JSON.stringify({
                error: error instanceof Error ? error.message : String(error),
                html_notes_validation: "The HTML notes format is valid. The error must be related to something else."
              })
            }],
          };
        }
        throw error; // re-throw to be caught by the outer try/catch
      }
    }
  • Tool schema definition for 'asana_create_subtask' including input schema with properties like parent_task_id, name, notes, etc.
    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"
          },
          html_notes: {
            type: "string",
            description: "HTML-like formatted description of the subtask. Does not support ALL HTML tags. Only a subset. The only allowed TAG in the HTML are: <body> <h1> <h2> <ol> <ul> <li> <strong> <em> <u> <s> <code> <pre> <blockquote> <a data-asana-type=\"\" data-asana-gid=\"\"> <hr> <img> <table> <tr> <td>. No other tags are allowed. Use the \\n to create a newline. Do not use \\n after <body>. Example: <body><h1>Motivation</h1>\nA customer called in to complain\n<h1>Goal</h1>\nFix the problem</body>"
          },
          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"]
      }
    };
  • Registration of the tool in the all_tools array and exported as list_of_tools (filtered for read-only mode if enabled). Note: createSubtaskTool is included at line 52.
    const all_tools: Tool[] = [
      listWorkspacesTool,
      searchProjectsTool,
      searchTasksTool,
      getTaskTool,
      createTaskTool,
      getStoriesForTaskTool,
      updateTaskTool,
      getProjectTool,
      getProjectTaskCountsTool,
      getProjectSectionsTool,
      createTaskStoryTool,
      addTaskDependenciesTool,
      addTaskDependentsTool,
      createSubtaskTool,
      getMultipleTasksByGidTool,
      getProjectStatusTool,
      getProjectStatusesForProjectTool,
      createProjectStatusTool,
      deleteProjectStatusTool,
      setParentForTaskTool,
      getTasksForTagTool,
      getTagsForWorkspaceTool,
    ];
    
    // List of tools that only read Asana state
    const READ_ONLY_TOOLS = [
      'asana_list_workspaces',
      'asana_search_projects',
      'asana_search_tasks',
      'asana_get_task',
      'asana_get_task_stories',
      'asana_get_project',
      'asana_get_project_task_counts',
      'asana_get_project_status',
      'asana_get_project_statuses',
      'asana_get_project_sections',
      'asana_get_multiple_tasks_by_gid',
      'asana_get_tasks_for_tag',
      'asana_get_tags_for_workspace'
    ];
    
    // Filter tools based on READ_ONLY_MODE
    const isReadOnlyMode = process.env.READ_ONLY_MODE === 'true';
    
    // Export filtered list of tools
    export const list_of_tools = isReadOnlyMode
      ? all_tools.filter(tool => READ_ONLY_TOOLS.includes(tool.name))
      : all_tools;
  • Helper method in AsanaClientWrapper that wraps the Asana SDK call to createSubtaskForTask, which is invoked by the tool handler.
    async createSubtask(parentTaskId: string, data: any, opts: any = {}) {
      const taskData = {
        data: {
          ...data
        }
      };
      const response = await this.tasks.createSubtaskForTask(taskData, parentTaskId, opts);
      return response.data;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It states 'Create' which implies a write/mutation operation, but doesn't disclose permissions needed, rate limits, whether the operation is idempotent, what happens on failure, or what the response contains. For a creation tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, clear sentence with zero wasted words. It's front-loaded with the core purpose and appropriately sized for what it communicates. Every word earns its place without being overly terse.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a creation tool with 7 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what a successful creation returns, error conditions, or important behavioral aspects like whether subtasks inherit properties from parent tasks. The high parameter count and mutation nature demand more contextual information than provided.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 7 parameters thoroughly. The description adds no parameter-specific information beyond what's in the schema. However, it does imply the existence of a parent-child relationship through 'subtask for an existing task,' which contextualizes the 'parent_task_id' parameter. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Create') and resource ('new subtask for an existing task'), making the purpose immediately understandable. It distinguishes this from general task creation tools like 'asana_create_task' by specifying it's for subtasks, though it doesn't explicitly contrast with sibling tools beyond this inherent differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (like needing an existing parent task), compare it to 'asana_create_task' for regular tasks, or indicate when subtasks are appropriate versus dependencies or other task relationships available in sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/roychri/mcp-server-asana'

If you have feedback or need assistance with the MCP directory API, please join our Discord server