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;
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states a read operation ('Get'), implying it's likely non-destructive, but doesn't cover aspects like authentication requirements, rate limits, error conditions, or what the output format looks like (e.g., raw count vs structured data). This leaves significant gaps for an agent to understand how to interact with it effectively.

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, clear sentence with no wasted words. It's front-loaded with the core purpose and avoids unnecessary elaboration, making it efficient and easy to parse.

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

Completeness2/5

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

Given the lack of annotations and output schema, the description is incomplete for a tool with two parameters. It doesn't explain the return value (e.g., whether it's a simple integer, a JSON object with counts, or includes optional fields), nor does it address potential behavioral nuances like pagination or error handling. This leaves the agent with insufficient context for reliable 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 input schema has 100% description coverage, fully documenting both parameters ('project_id' and 'opt_fields'). The description adds no additional semantic context about parameters beyond what's in the schema, such as explaining what 'opt_fields' might include or how task counts are calculated. This meets the baseline for high schema coverage.

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 action ('Get') and resource ('number of tasks in a project'), making the purpose understandable. However, it doesn't differentiate from sibling tools like 'asana_get_project' or 'asana_get_task', which also retrieve project/task information but for different data.

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 scenarios where task counts are needed over detailed task lists (e.g., from 'asana_get_tasks_for_tag') or other project metrics, nor does it specify 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/roychri/mcp-server-asana'

If you have feedback or need assistance with the MCP directory API, please join our Discord server