asana_get_task
Retrieve detailed information about a specific Asana task using its unique ID, including optional fields for comprehensive task management.
Instructions
Get detailed information about a specific task
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | The task ID to retrieve | |
| opt_fields | No | Comma-separated list of optional fields to include |
Implementation Reference
- src/tools/task-tools.ts:244-261 (schema)Tool schema definition including input validation schema for asana_get_taskexport const getTaskTool: Tool = { name: "asana_get_task", description: "Get detailed information about a specific task", inputSchema: { type: "object", properties: { task_id: { type: "string", description: "The task ID to retrieve" }, opt_fields: { type: "string", description: "Comma-separated list of optional fields to include" } }, required: ["task_id"] } };
- src/tool-handler.ts:61-103 (registration)Registration of all tools including getTaskTool (imported from task-tools) in the main tools array exported for MCPexport 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 ];
- src/tool-handler.ts:166-172 (handler)Main handler logic in tool_handler switch statement: destructures arguments, calls asanaClient.getTask, returns JSON responsecase "asana_get_task": { const { task_id, ...opts } = args; const response = await asanaClient.getTask(task_id, opts); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }
- src/asana-client-wrapper.ts:327-339 (helper)Core implementation: AsanaClientWrapper.getTask method wraps Asana SDK tasks.getTask callasync getTask(taskId: string, opts: any = {}) { try { const response = await this.tasks.getTask(taskId, opts); return response.data; } catch (error: any) { console.error(`Error retrieving task ${taskId}: ${error.message}`); // Adăugăm informații utile pentru diagnosticare if (error.response && error.response.body) { console.error(`Response error details: ${JSON.stringify(error.response.body, null, 2)}`); } throw error; } }
- src/utils/validation.ts:202-205 (helper)Parameter validation specifically for task_id GID format in validateTaskParameters called before handler executioncase 'asana_get_task': result = validateGid(params.task_id, 'task_id'); if (!result.valid) errors.push(...result.errors); break;