asana_get_task
Retrieve detailed information about a specific Asana task using its unique task ID, including optional fields for comprehensive task management.
Instructions
Get detailed information about a specific task
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | The task ID to retrieve | |
| 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_id": {
"description": "The task ID to retrieve",
"type": "string"
}
},
"required": [
"task_id"
],
"type": "object"
}
Implementation Reference
- src/asana-client-wrapper.ts:327-339 (handler)Core handler method that executes the Asana API call to retrieve a specific task by ID using the TasksApi.async 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/tool-handler.ts:166-172 (handler)Dispatch handler in tool_handler function that extracts parameters and calls the AsanaClientWrapper.getTask method.case "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/tools/task-tools.ts:244-261 (schema)Tool schema definition including name, description, and inputSchema for parameter validation.export 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 the getTaskTool in the main tools array exported for MCP tool discovery.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 ];
- src/utils/validation.ts:202-205 (helper)Validation helper that checks the task_id parameter is a valid Asana GID.case 'asana_get_task': result = validateGid(params.task_id, 'task_id'); if (!result.valid) errors.push(...result.errors); break;