asana_get_project_sections
Retrieve sections from an Asana project to organize tasks and track workflow progress. Specify a project ID to get structured task lists.
Instructions
Get sections in a project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | The project ID to get sections for | |
| opt_fields | No | Comma-separated list of optional fields to include |
Implementation Reference
- src/tool-handler.ts:246-252 (handler)The primary MCP tool handler case that processes the tool call, destructures arguments, invokes the Asana client method, and formats the response.case "asana_get_project_sections": { const { project_id, ...opts } = args; const response = await asanaClient.getProjectSections(project_id, opts); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }
- src/tools/project-tools.ts:83-100 (schema)Defines the tool's metadata including name, description, and input schema for validation.export const getProjectSectionsTool: Tool = { name: "asana_get_project_sections", description: "Get sections in a project", inputSchema: { type: "object", properties: { project_id: { type: "string", description: "The project ID to get sections for" }, opt_fields: { type: "string", description: "Comma-separated list of optional fields to include" } }, required: ["project_id"] } };
- src/tool-handler.ts:61-103 (registration)Registers the getProjectSectionsTool in the list_of_tools array exported for MCP server tool listing.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/asana-client-wrapper.ts:447-453 (helper)Core helper method in AsanaClientWrapper that performs the actual Asana API call to retrieve project sections.async getProjectSections(projectId: string, opts: any = {}) { // Only include opts if opt_fields was actually provided const options = opts.opt_fields ? opts : {}; const sections = new Asana.SectionsApi(); const response = await sections.getSectionsForProject(projectId, options); return response.data; }