Skip to main content
Glama

asana_get_project_sections

Retrieve all sections within an Asana project to organize tasks and track workflow progress using the project ID.

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

  • Core handler implementation that fetches project sections using Asana's SectionsApi, conditionally including opt_fields.
    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;
    }
  • Tool dispatch handler that extracts parameters and calls AsanaClientWrapper.getProjectSections, returning JSON 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) }],
      };
    }
  • Tool definition with name, description, and input schema validating project_id (required) and 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"]
      }
    };
  • Registers the tool in the all_tools array for availability.
    getProjectSectionsTool,
  • Includes the tool in READ_ONLY_TOOLS list for read-only mode filtering.
    'asana_get_project_sections',

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

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