asana_get_project_sections
Retrieve all sections within a specific Asana project to organize and categorize tasks effectively. Use this tool to access project structure and manage workflow sections.
Instructions
Get sections in a project
Input 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 |
Input Schema (JSON Schema)
{
"properties": {
"opt_fields": {
"description": "Comma-separated list of optional fields to include",
"type": "string"
},
"project_id": {
"description": "The project ID to get sections for",
"type": "string"
}
},
"required": [
"project_id"
],
"type": "object"
}
Implementation Reference
- src/tool-handler.ts:246-252 (handler)MCP tool handler case that destructures input parameters and calls the Asana client wrapper's getProjectSections method, returning the JSON stringified 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)Tool definition with name, description, and input schema specifying required project_id and optional opt_fields.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/asana-client-wrapper.ts:447-453 (helper)Core helper method in AsanaClientWrapper that instantiates SectionsApi and calls getSectionsForProject to fetch sections for the given project ID.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; }
- src/tool-handler.ts:61-103 (registration)Registration of all tools including getProjectSectionsTool (line 66) in the exported tools array used 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:267-270 (schema)Input validation case ensuring project_id is a valid Asana GID.case 'asana_get_project_sections': result = validateGid(params.project_id, 'project_id'); if (!result.valid) errors.push(...result.errors); break;