Skip to main content
Glama

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
NameRequiredDescriptionDefault
project_idYesThe project ID to get task counts for
opt_fieldsNoComma-separated list of optional fields to include

Implementation Reference

  • 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) }], }; }
  • 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"] } };
  • 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, ];
  • 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; }
  • 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;

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