Skip to main content
Glama
cristip73

MCP Server for Asana

by cristip73

asana_get_subtasks_for_task

Retrieve subtasks for any Asana task to track progress, assign responsibilities, and manage dependencies within projects.

Instructions

Get the list of subtasks for a specific task

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idYesID of the task to get subtasks for
opt_fieldsNoOptional fields for subtasks (e.g. 'name,notes,assignee,due_on,completed')
limitNoMaximum number of results per page (1-100)
offsetNoPagination token from previous response
auto_paginateNoIf true, automatically gets all pages and combines results

Implementation Reference

  • MCP tool handler switch case that destructures input arguments (task_id and opts), calls AsanaClientWrapper.getSubtasksForTask(), and returns the JSON-stringified response.
    case "asana_get_subtasks_for_task": {
      const { task_id, ...opts } = args;
      const response = await asanaClient.getSubtasksForTask(task_id, opts);
      return {
        content: [{ type: "text", text: JSON.stringify(response) }],
      };
    }
  • Core implementation in AsanaClientWrapper that calls the Asana SDK TasksApi.getSubtasksForTask(taskId, opts) and returns the data, with basic error handling.
    async getSubtasksForTask(taskId: string, opts: any = {}) {
      try {
        const response = await this.tasks.getSubtasksForTask(taskId, opts);
        return response.data;
      } catch (error) {
        console.error("Error in getSubtasksForTask:", error);
        throw error;
      }
    }
  • Tool schema definition including name, description, and inputSchema with required task_id and optional pagination/fields parameters.
    export const getSubtasksForTaskTool: Tool = {
      name: "asana_get_subtasks_for_task",
      description: "Get the list of subtasks for a specific task",
      inputSchema: {
        type: "object",
        properties: {
          task_id: {
            type: "string",
            description: "ID of the task to get subtasks for"
          },
          opt_fields: {
            type: "string",
            description: "Optional fields for subtasks (e.g. 'name,notes,assignee,due_on,completed')"
          },
          limit: {
            type: "number",
            description: "Maximum number of results per page (1-100)"
          },
          offset: {
            type: "string",
            description: "Pagination token from previous response"
          },
          auto_paginate: {
            type: "boolean",
            description: "If true, automatically gets all pages and combines results",
            default: false
          }
        },
        required: ["task_id"]
      }
    };
  • Tool registration in the exported tools array that includes getSubtasksForTaskTool (imported from task-tools.ts), making it available to the MCP server.
    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
    ];
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states it 'gets' data, implying a read-only operation, but doesn't mention pagination behavior (handled by 'limit', 'offset', and 'auto_paginate' parameters), rate limits, authentication needs, or error conditions. This leaves significant gaps for an agent to understand how the tool behaves in practice.

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 no wasted words. It's front-loaded with the core purpose ('Get the list of subtasks'), making it easy to parse. Every part of the sentence contributes directly to understanding the tool's function.

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?

Given the tool has 5 parameters, no annotations, and no output schema, the description is incomplete. It doesn't address behavioral aspects like pagination, error handling, or return format, which are critical for an agent to use the tool effectively. The high parameter count and lack of structured metadata mean the description should do more to compensate.

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?

The input schema has 100% description coverage, so parameters like 'task_id', 'opt_fields', 'limit', 'offset', and 'auto_paginate' are well-documented in the schema. The description adds no additional meaning beyond the schema, such as explaining the format of 'opt_fields' or how pagination works. This meets the baseline score when schema coverage is high.

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 verb ('Get') and resource ('list of subtasks for a specific task'), making the purpose unambiguous. However, it doesn't differentiate from sibling tools like 'asana_get_task' or 'asana_get_tasks_for_project', which also retrieve task-related data but with different scopes.

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. For example, it doesn't mention when to prefer this over 'asana_get_task' (which might include subtasks) or 'asana_create_subtask' for adding subtasks. There's no context about prerequisites or exclusions.

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