Skip to main content
Glama
cristip73

MCP Server for Asana

by cristip73

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
NameRequiredDescriptionDefault
project_idYesThe project ID to get sections for
opt_fieldsNoComma-separated list of optional fields to include

Implementation Reference

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

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