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
| Name | Required | Description | Default |
|---|---|---|---|
| section_id | Yes | The section ID to get tasks from | |
| opt_fields | No | Comma-separated list of optional fields to include (e.g., 'name,gid,completed,assignee,notes,subtasks') | |
| completed_since | No | Only return tasks that are either incomplete or that have been completed since this time (ISO 8601 format) | |
| limit | No | Number of results to return per page (1-100) | |
| offset | No | Pagination token from previous response. Required for paginated requests | |
| auto_paginate | No | If true, automatically gets all pages of results (limited by max_pages) | |
| max_pages | No | Maximum 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
- src/asana-client-wrapper.ts:847-856 (handler)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; } }
- src/tool-handler.ts:344-350 (handler)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) }], }; }
- src/tools/task-tools.ts:456-495 (schema)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"] } };
- src/tool-handler.ts:81-85 (registration)Registration of the tool in the main tools array export, imported from task-tools.js.addTaskToSectionTool, getTasksForSectionTool, getProjectHierarchyTool, getSubtasksForTaskTool, getTasksForProjectTool,
- src/utils/validation.ts:346-349 (helper)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;