Skip to main content
Glama
by cristip73

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

NameRequiredDescriptionDefault
task_idYesThe task ID to retrieve
opt_fieldsNoComma-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

  • 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; } }
  • 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) }], }; }
  • 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"] } };
  • 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 ];
  • 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;

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/cristip73/mcp-server-asana'

If you have feedback or need assistance with the MCP directory API, please join our Discord server