Skip to main content
Glama
cristip73

MCP Server for Asana

by cristip73

asana_get_project_task_counts

Retrieve task counts for Asana projects to monitor progress and manage workloads. Provide a project ID to get the number of tasks.

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

  • Tool schema definition including name, description, and input schema for asana_get_project_task_counts
    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 all tools including getProjectTaskCountsTool in the tools array used by the 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
    ];
  • Dispatch handler case in tool_handler switch that extracts parameters and calls AsanaClientWrapper.getProjectTaskCounts
    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) }],
      };
    }
  • Core implementation of getProjectTaskCounts in AsanaClientWrapper, calling Asana SDK's getTaskCountsForProject with appropriate opt_fields
    async getProjectTaskCounts(projectId: string, opts: any = {}) {
      // Ensure we always include essential opt_fields for task counts
      // See: https://developers.asana.com/reference/gettaskcountsforproject
      const options = {
        opt_fields: 'num_tasks,num_incomplete_tasks,num_completed_tasks,num_milestones,num_incomplete_milestones,num_completed_milestones'
      };
      
      // If caller provided specific opt_fields, use those instead
      if (opts.opt_fields) {
        options.opt_fields = opts.opt_fields;
      }
      
      const response = await this.projects.getTaskCountsForProject(projectId, options);
      return response.data;
    }
  • Validation logic for project_id parameter in validateProjectParameters function
    case 'asana_get_project_task_counts':
    case 'asana_get_project_sections':
      result = validateGid(params.project_id, 'project_id');
      if (!result.valid) errors.push(...result.errors);
      break;
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool 'gets' data, implying a read-only operation, but doesn't specify permissions, rate limits, or response format. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior and constraints.

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: 'Get the number of tasks in a project.' It's front-loaded with the core purpose, has zero wasted words, and is appropriately sized for a simple tool. Every part of the sentence earns its place by clearly conveying the tool's function.

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

Completeness3/5

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

Given the tool's low complexity (a read operation with 2 parameters) and 100% schema coverage, the description is minimally adequate. However, with no annotations and no output schema, it doesn't fully compensate for missing behavioral details (e.g., what the return value looks like or any limitations). It meets basic needs but lacks depth for optimal agent use.

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%, with clear descriptions for both parameters ('project_id' and 'opt_fields'). The description doesn't add any meaning beyond the schema, such as explaining what 'opt_fields' might include or how counts are calculated. With high schema coverage, a baseline score of 3 is appropriate as the schema handles the parameter documentation adequately.

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 tool's purpose: 'Get the number of tasks in a project.' It specifies the verb ('Get') and resource ('tasks in a project'), making the function unambiguous. However, it doesn't differentiate from sibling tools like 'asana_get_tasks_for_project' (which retrieves task details rather than counts), so it misses full sibling distinction.

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 detailed task lists or 'asana_get_project' for project metadata, leaving the agent without context for selection. There's no indication of prerequisites or exclusions.

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