Skip to main content
Glama
by cristip73

asana_get_tasks_for_section

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

Instructions

Get all tasks from a specific section in a project

Input 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

Input Schema (JSON Schema)

{ "properties": { "auto_paginate": { "default": false, "description": "If true, automatically gets all pages of results (limited by max_pages)", "type": "boolean" }, "completed_since": { "description": "Only return tasks that are either incomplete or that have been completed since this time (ISO 8601 format)", "type": "string" }, "limit": { "description": "Number of results to return per page (1-100)", "type": "number" }, "max_pages": { "default": 10, "description": "Maximum pages to fetch when auto_paginate is true", "type": "number" }, "offset": { "description": "Pagination token from previous response. Required for paginated requests", "type": "string" }, "opt_fields": { "description": "Comma-separated list of optional fields to include (e.g., 'name,gid,completed,assignee,notes,subtasks')", "type": "string" }, "section_id": { "description": "The section ID to get tasks from", "type": "string" } }, "required": [ "section_id" ], "type": "object" }

Implementation Reference

  • Core handler function that executes the Asana API call to retrieve tasks for a specific section using the Asana SDK's TasksApi.
    // 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; } }
  • Dispatch handler case in the main tool_handler function that destructures parameters and delegates to AsanaClientWrapper.getTasksForSection.
    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) }], }; }
  • Tool schema defining the name, description, input parameters (section_id required, optional pagination and fields), and validation schema.
    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 export, imported from task-tools.js.
    addTaskToSectionTool, getTasksForSectionTool, getProjectHierarchyTool, getSubtasksForTaskTool, getTasksForProjectTool,
  • Validation helper that checks if section_id is a valid GID.
    case 'asana_get_tasks_for_section': result = validateGid(params.section_id, 'section_id'); if (!result.valid) errors.push(...result.errors); break;

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