Skip to main content
Glama
cristip73

MCP Server for Asana

by cristip73

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
NameRequiredDescriptionDefault
parent_task_idYesThe parent task ID to create the subtask under
nameYesName of the subtask
notesNoDescription of the subtask
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

  • 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) }],
      };
    }
  • 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"]
      }
    };
  • 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
    ];
  • 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;
    }
  • 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';
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states 'Create' implying a write/mutation operation but doesn't mention permissions, side effects, error conditions, or response format. For a creation tool with zero annotation coverage, this leaves significant behavioral gaps.

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, focused sentence with zero wasted words. It's front-loaded with the core action and resource, making it immediately scannable and efficient.

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 no annotations and no output schema, the description is insufficient. It doesn't explain what happens after creation, error handling, or how this differs from similar tools. Given the complexity of task management and sibling tools, more context is needed for effective use.

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 6 parameters thoroughly. The description adds no parameter-specific information beyond what's in the schema, meeting the baseline for high schema coverage but not enhancing understanding.

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 a new subtask') and target resource ('for an existing task'), making the purpose immediately understandable. However, it doesn't distinguish this tool from its sibling 'asana_create_task' or explain the parent-child relationship beyond what's implied by 'subtask.'

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 like 'asana_create_task' or 'asana_set_parent_for_task.' It mentions 'for an existing task' but doesn't clarify prerequisites or contextual constraints, leaving the agent to infer usage scenarios.

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/cristip73/mcp-server-asana'

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