Skip to main content
Glama
cristip73

MCP Server for Asana

by cristip73

asana_get_tasks_for_section

Retrieve all tasks from a specific project section in Asana, with options to filter by completion date, include custom fields, and manage pagination for large task lists.

Instructions

Get all tasks from a specific section in a project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
section_idYesThe section ID to get tasks from
opt_fieldsNoComma-separated list of optional fields to include (e.g., 'name,gid,completed,assignee,notes,subtasks')
completed_sinceNoOnly return tasks that are either incomplete or that have been completed since this time (ISO 8601 format)
limitNoNumber of results to return per page (1-100)
offsetNoPagination token from previous response. Required for paginated requests
auto_paginateNoIf true, automatically gets all pages of results (limited by max_pages)
max_pagesNoMaximum pages to fetch when auto_paginate is true

Implementation Reference

  • MCP tool handler case that extracts section_id and options, calls AsanaClientWrapper.getTasksForSection, and returns JSON response.
    case "asana_get_tasks_for_section": {
      const { section_id, ...opts } = args;
      const response = await asanaClient.getTasksForSection(section_id, opts);
      return {
        content: [{ type: "text", text: JSON.stringify(response) }],
      };
    }
  • Core Asana API wrapper method that calls the Asana SDK's getTasksForSection with section ID and options, handling basic error logging.
    // Metodă nouă pentru a obține task-urile dintr-o secțiune
    async getTasksForSection(sectionId: string, opts: any = {}) {
      try {
        const response = await this.tasks.getTasksForSection(sectionId, opts);
        return response.data;
      } catch (error) {
        console.error("Error in getTasksForSection:", error);
        throw error;
      }
    }
  • Tool schema definition including name, description, and detailed input schema with pagination support.
    export const getTasksForSectionTool: Tool = {
      name: "asana_get_tasks_for_section",
      description: "Get all tasks from a specific section in a project",
      inputSchema: {
        type: "object",
        properties: {
          section_id: {
            type: "string",
            description: "The section ID to get tasks from"
          },
          opt_fields: {
            type: "string",
            description: "Comma-separated list of optional fields to include (e.g., 'name,gid,completed,assignee,notes,subtasks')"
          },
          completed_since: {
            type: "string",
            description: "Only return tasks that are either incomplete or that have been completed since this time (ISO 8601 format)"
          },
          limit: {
            type: "number",
            description: "Number of results to return per page (1-100)"
          },
          offset: {
            type: "string",
            description: "Pagination token from previous response. Required for paginated requests"
          },
          auto_paginate: {
            type: "boolean",
            description: "If true, automatically gets all pages of results (limited by max_pages)",
            default: false
          },
          max_pages: {
            type: "number",
            description: "Maximum pages to fetch when auto_paginate is true",
            default: 10
          }
        },
        required: ["section_id"]
      }
    };
  • Registration of the tool in the main tools array exported for MCP server.
    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
    ];
  • Input validation helper that checks section_id is a valid Asana GID.
    case 'asana_get_tasks_for_section':
      result = validateGid(params.section_id, 'section_id');
      if (!result.valid) errors.push(...result.errors);
      break;
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool retrieves tasks but omits critical details: whether it's paginated (implied by parameters but not explicitly stated), rate limits, authentication requirements, error handling, or the format of returned data. This leaves significant gaps for an agent to understand operational behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose without unnecessary words. It avoids redundancy and wastes no space, making it easy to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 7 parameters, no annotations, and no output schema, the description is insufficient. It lacks information on behavioral traits (e.g., pagination, auth), output format, error conditions, and usage context relative to siblings. The high parameter count and absence of structured metadata require more descriptive support than provided.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 100%, providing detailed documentation for all 7 parameters. The description adds no additional parameter semantics beyond implying retrieval from a section, which is already covered by the schema's 'section_id' description. This meets the baseline for high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Get') and resource ('all tasks from a specific section in a project'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'asana_get_tasks_for_project' or 'asana_get_tasks_for_tag', which have similar retrieval patterns but target different resources.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'asana_get_tasks_for_project' (for project-level tasks) or 'asana_search_tasks' (for broader searches), nor does it specify prerequisites such as needing a valid section ID or appropriate permissions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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