asana_get_project_task_counts
Retrieve task counts for Asana projects to monitor progress and manage workloads effectively.
Instructions
Get the number of tasks in a project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_id | Yes | The project ID to get task counts for | |
| opt_fields | No | Comma-separated list of optional fields to include |
Implementation Reference
- src/tool-handler.ts:236-242 (handler)The MCP tool handler switch case that executes the tool logic by calling the Asana client wrapper's getProjectTaskCounts method.case "asana_get_project_task_counts": { const { project_id, ...opts } = args; const response = await asanaClient.getProjectTaskCounts(project_id, opts); return { content: [{ type: "text", text: JSON.stringify(response) }], }; }
- src/tools/project-tools.ts:50-67 (schema)The Tool definition including input schema (inputSchema) for validating arguments.export const getProjectTaskCountsTool: Tool = { name: "asana_get_project_task_counts", description: "Get the number of tasks in a project", inputSchema: { type: "object", properties: { project_id: { type: "string", description: "The project ID to get task counts for" }, opt_fields: { type: "string", description: "Comma-separated list of optional fields to include" } }, required: ["project_id"] } };
- src/tool-handler.ts:38-61 (registration)Registration of the tool in the all_tools array, which is filtered and exported as list_of_tools for MCP.const all_tools: Tool[] = [ listWorkspacesTool, searchProjectsTool, searchTasksTool, getTaskTool, createTaskTool, getStoriesForTaskTool, updateTaskTool, getProjectTool, getProjectTaskCountsTool, getProjectSectionsTool, createTaskStoryTool, addTaskDependenciesTool, addTaskDependentsTool, createSubtaskTool, getMultipleTasksByGidTool, getProjectStatusTool, getProjectStatusesForProjectTool, createProjectStatusTool, deleteProjectStatusTool, setParentForTaskTool, getTasksForTagTool, getTagsForWorkspaceTool, ];
- src/asana-client-wrapper.ts:185-190 (helper)The AsanaClientWrapper method implementing the core logic by calling the Asana SDK's getTaskCountsForProject.async getProjectTaskCounts(projectId: string, opts: any = {}) { // Only include opts if opt_fields was actually provided const options = opts.opt_fields ? opts : {}; const response = await this.projects.getTaskCountsForProject(projectId, options); return response.data; }
- src/tool-handler.ts:84-86 (registration)Final export of the tools list, conditionally filtered for read-only mode, making the tool available to MCP.export const list_of_tools = isReadOnlyMode ? all_tools.filter(tool => READ_ONLY_TOOLS.includes(tool.name)) : all_tools;