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
| Name | Required | Description | Default |
|---|---|---|---|
| task_ids | Yes | Array or comma-separated string of task GIDs to retrieve (max 25) | |
| opt_fields | No | Comma-separated list of optional fields to include |
Implementation Reference
- src/asana-client-wrapper.ts:273-284 (handler)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; }
- src/tool-handler.ts:384-394 (handler)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) }], }; }
- src/tools/task-tools.ts:406-435 (schema)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"] } };
- src/tool-handler.ts:84-86 (registration)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;
- src/tool-handler.ts:19-25 (registration)Imports the getMultipleTasksByGidTool from task-tools.ts for inclusion in the tools list.searchTasksTool, getTaskTool, createTaskTool, updateTaskTool, createSubtaskTool, getMultipleTasksByGidTool } from './tools/task-tools.js';