Skip to main content
Glama
cristip73

MCP Server for Asana

by cristip73

asana_get_multiple_tasks_by_gid

Retrieve detailed information for multiple Asana tasks using their unique GIDs, supporting up to 25 tasks per request with optional field selection.

Instructions

Get detailed information about multiple tasks by their GIDs (maximum 25 tasks)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
task_idsYesArray or comma-separated string of task GIDs to retrieve (max 25)
opt_fieldsNoComma-separated list of optional fields to include

Implementation Reference

  • Core handler function that fetches multiple tasks in parallel using Promise.all on individual getTask calls, with limit check for max 25 tasks.
    async getMultipleTasksByGid(taskIds: any, opts: any = {}) {
      const taskIdsArray = this.ensureArray(taskIds);
      
      if (taskIdsArray.length > 25) {
        throw new Error("Maximum of 25 task IDs allowed");
      }
    
      // Use Promise.all to fetch tasks in parallel
      const tasks = await Promise.all(
        taskIdsArray.map(taskId => this.getTask(taskId, opts))
      );
    
      return tasks;
    }
  • Tool dispatching handler that normalizes task_ids input (array or comma-separated string) and delegates to AsanaClientWrapper.getMultipleTasksByGid.
    case "asana_get_multiple_tasks_by_gid": {
      const { task_ids, ...opts } = args;
      // Handle both array and string input
      const taskIdList = Array.isArray(task_ids)
        ? task_ids
        : task_ids.split(',').map((id: string) => id.trim()).filter((id: string) => id.length > 0);
      const response = await asanaClient.getMultipleTasksByGid(taskIdList, opts);
      return {
        content: [{ type: "text", text: JSON.stringify(response) }],
      };
    }
  • Input schema definition for the tool, supporting task_ids as array (max 25 items) or comma-separated string, with optional opt_fields.
    export const getMultipleTasksByGidTool: Tool = {
      name: "asana_get_multiple_tasks_by_gid",
      description: "Get detailed information about multiple tasks by their GIDs (maximum 25 tasks)",
      inputSchema: {
        type: "object",
        properties: {
          task_ids: {
            oneOf: [
              {
                type: "array",
                items: {
                  type: "string"
                },
                maxItems: 25
              },
              {
                type: "string",
                description: "Comma-separated list of task GIDs (max 25)"
              }
            ],
            description: "Array or comma-separated string of task GIDs to retrieve (max 25)"
          },
          opt_fields: {
            type: "string",
            description: "Comma-separated list of optional fields to include"
          }
        },
        required: ["task_ids"]
      }
    };
  • Registration of all tools including getMultipleTasksByGidTool in the main tools array exported for MCP.
    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
    ];

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior3/5

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

With no annotations provided, the description carries the full burden for behavioral disclosure. It does disclose the 25-task maximum limit, which is a key constraint, but it omits any details about error behavior, permissions, or return format. This is a modest disclosure that avoids contradictions.

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, efficient sentence that front-loads the core purpose and key limit. No filler or redundant content exists.

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

Completeness4/5

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

Given the tool's relative simplicity (2 params, no output schema), the description adequately covers the essential use case. It notes the batch aspect and max limit, but lacks any detail about response shape or error cases, which would be expected in a fully complete context. Still, it is sufficient for a straightforward GET operation.

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?

Because schema description coverage is 100%, the schema already fully documents both parameters (task_ids and opt_fields). The description adds little beyond the schema, only hinting at 'detailed information' which is not a strong supplement. Baseline 3 applies.

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

Purpose5/5

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

The description clearly states the action ('Get'), the resource ('tasks'), and the specific qualifier ('by their GIDs', 'multiple', 'maximum 25 tasks'). This distinguishes it from single-task retrieval (asana_get_task) and search tools.

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

Usage Guidelines4/5

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

The description implies usage for retrieving multiple tasks by GID, which is a clear context. However, it does not explicitly contrast with alternatives like asana_get_task or mention when not to use it, so there is slight room for improvement.

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