Skip to main content
Glama

asana_get_multiple_tasks_by_gid

Retrieve detailed information for multiple Asana tasks using their 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 implementation of fetching multiple tasks: validates max 25, uses Promise.all to call getTask in parallel for each task ID, returns array of task objects.
    async getMultipleTasksByGid(taskIds: string[], opts: any = {}) {
      if (taskIds.length > 25) {
        throw new Error("Maximum of 25 task IDs allowed");
      }
    
      // Use Promise.all to fetch tasks in parallel
      const tasks = await Promise.all(
        taskIds.map(taskId => this.getTask(taskId, opts))
      );
    
      return tasks;
    }
  • Tool dispatch handler: destructures args, converts task_ids (array or comma-separated string) to array, calls AsanaClientWrapper.getMultipleTasksByGid, returns JSON response.
    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) }],
      };
    }
  • Defines the Tool object with name, description, and inputSchema for validating task_ids (array max 25 or comma-string) and 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"]
      }
    };
  • Exports the list_of_tools which includes the asana_get_multiple_tasks_by_gid tool (imported and added to all_tools earlier), filtered for read-only mode if enabled. This list is used for MCP tool registration.
    export const list_of_tools = isReadOnlyMode
      ? all_tools.filter(tool => READ_ONLY_TOOLS.includes(tool.name))
      : all_tools;
  • Imports the getMultipleTasksByGidTool from task-tools.ts for inclusion in the tools list.
      searchTasksTool,
      getTaskTool,
      createTaskTool,
      updateTaskTool,
      createSubtaskTool,
      getMultipleTasksByGidTool
    } 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 mentions the 25-task limit, which is useful, but fails to describe other critical behaviors: whether this is a read-only operation, what authentication is required, rate limits, error handling for invalid GIDs, or the structure of returned data. For a batch retrieval tool with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves.

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 ('Get detailed information about multiple tasks') followed by the key constraint ('by their GIDs (maximum 25 tasks)'). Every word earns its place with zero redundancy or unnecessary elaboration.

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 complexity of batch retrieval, absence of annotations, and no output schema, the description is incomplete. It doesn't explain what 'detailed information' includes, how results are structured, error scenarios, or authentication requirements. While concise, it lacks sufficient context for an agent to confidently use this tool without additional assumptions or trial-and-error.

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 fully documents both parameters (task_ids with format options and max limit, opt_fields). The description adds minimal value beyond the schema by mentioning 'maximum 25 tasks' which aligns with the schema's maxItems constraint. No additional parameter semantics are provided, so the baseline 3 is appropriate when the schema does the heavy lifting.

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 detailed information') and resource ('multiple tasks by their GIDs'), making the purpose immediately understandable. It distinguishes from the single-task retrieval sibling 'asana_get_task' by specifying 'multiple tasks' and the batch limit. However, it doesn't explicitly contrast with other task-related siblings like 'asana_get_tasks_for_tag' or 'asana_search_tasks'.

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

Usage Guidelines3/5

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

The description implies usage context by specifying 'maximum 25 tasks' and the GID-based retrieval approach, suggesting this is for batch fetching of known tasks. However, it provides no explicit guidance on when to use this versus alternatives like 'asana_get_task' (single task) or 'asana_search_tasks' (filter-based search). The agent must infer appropriate usage from the description's constraints.

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