asana_get_multiple_tasks_by_gid
Retrieve detailed information for multiple Asana tasks using their global IDs, 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
| 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 |
Input Schema (JSON Schema)
{
"properties": {
"opt_fields": {
"description": "Comma-separated list of optional fields to include",
"type": "string"
},
"task_ids": {
"description": "Array or comma-separated string of task GIDs to retrieve (max 25)",
"oneOf": [
{
"items": {
"type": "string"
},
"maxItems": 25,
"type": "array"
},
{
"description": "Comma-separated list of task GIDs (max 25)",
"type": "string"
}
]
}
},
"required": [
"task_ids"
],
"type": "object"
}
Implementation Reference
- src/asana-client-wrapper.ts:635-648 (handler)Core handler logic: normalizes task IDs to array, enforces max 25 limit, fetches multiple tasks in parallel using Promise.all on individual getTask calls.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; }
- src/tool-handler.ts:286-296 (handler)MCP tool dispatch handler: destructures args, normalizes task_ids (array or comma-separated string), calls AsanaClient method, 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:402-431 (schema)Defines the tool schema: name, description, inputSchema 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"] } };
- src/tool-handler.ts:61-103 (registration)Registers the tool by importing from task-tools.ts (line ~32) and including getMultipleTasksByGidTool in the exported tools array used for MCP toolset.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 ];