Skip to main content
Glama
DiversioTeam

ClickUp MCP Server

by DiversioTeam

get_task_analytics

Analyze task performance metrics like velocity and completion rates for a specified ClickUp space over a defined period to track team productivity.

Instructions

Get analytics for tasks (velocity, completion rate, etc.)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
space_idYesSpace ID
period_daysNoPeriod in days to analyze

Implementation Reference

  • The handler function implementing get_task_analytics. Fetches tasks created in the specified period for the space, computes metrics like total tasks, completion rate, average completion time in hours, tasks per day, and breakdown by priority.
    async def get_task_analytics(self, space_id: str, period_days: int = 30) -> Dict[str, Any]:
        """Get analytics for tasks."""
        # Calculate date range
        end_date = datetime.now()
        start_date = end_date - timedelta(days=period_days)
    
        # Get tasks created in period
        tasks = await self.client.search_tasks(
            query="",
            date_created_gt=int(start_date.timestamp() * 1000),
            date_created_lt=int(end_date.timestamp() * 1000),
        )
    
        # Calculate metrics
        total_tasks = len(tasks)
        completed_tasks = sum(1 for task in tasks if task.status.type == "closed")
    
        # Calculate average completion time
        completion_times = []
        for task in tasks:
            if task.date_closed and task.date_created:
                time_to_complete = (task.date_closed - task.date_created).total_seconds() / 3600
                completion_times.append(time_to_complete)
    
        avg_completion_time = (
            sum(completion_times) / len(completion_times) if completion_times else 0
        )
    
        # Tasks by priority
        by_priority = {1: 0, 2: 0, 3: 0, 4: 0}
        for task in tasks:
            if task.priority:
                by_priority[task.priority.value] += 1
    
        return {
            "space_id": space_id,
            "period_days": period_days,
            "metrics": {
                "total_tasks_created": total_tasks,
                "completed_tasks": completed_tasks,
                "completion_rate": round(
                    completed_tasks / total_tasks * 100 if total_tasks > 0 else 0, 2
                ),
                "avg_completion_hours": round(avg_completion_time, 2),
                "tasks_per_day": round(total_tasks / period_days, 2),
            },
            "by_priority": by_priority,
        }
  • The JSON schema definition for the get_task_analytics tool input, including space_id (required) and optional period_days.
    Tool(
        name="get_task_analytics",
        description="Get analytics for tasks (velocity, completion rate, etc.)",
        inputSchema={
            "type": "object",
            "properties": {
                "space_id": {"type": "string", "description": "Space ID"},
                "period_days": {
                    "type": "integer",
                    "description": "Period in days to analyze",
                },
            },
            "required": ["space_id"],
        },
    ),
  • Registration of get_task_analytics in the ClickUpTools class's internal _tools dictionary, mapping the tool name to its handler method. This enables dynamic tool calling via call_tool.
    self._tools: Dict[str, Callable] = {
        "create_task": self.create_task,
        "get_task": self.get_task,
        "update_task": self.update_task,
        "delete_task": self.delete_task,
        "list_tasks": self.list_tasks,
        "search_tasks": self.search_tasks,
        "get_subtasks": self.get_subtasks,
        "get_task_comments": self.get_task_comments,
        "create_task_comment": self.create_task_comment,
        "get_task_status": self.get_task_status,
        "update_task_status": self.update_task_status,
        "get_assignees": self.get_assignees,
        "assign_task": self.assign_task,
        "list_spaces": self.list_spaces,
        "list_folders": self.list_folders,
        "list_lists": self.list_lists,
        "find_list_by_name": self.find_list_by_name,
        # Bulk operations
        "bulk_update_tasks": self.bulk_update_tasks,
        "bulk_move_tasks": self.bulk_move_tasks,
        # Time tracking
        "get_time_tracked": self.get_time_tracked,
        "log_time": self.log_time,
        # Templates
        "create_task_from_template": self.create_task_from_template,
        "create_task_chain": self.create_task_chain,
        # Analytics
        "get_team_workload": self.get_team_workload,
        "get_task_analytics": self.get_task_analytics,
        # User management
        "list_users": self.list_users,
        "get_current_user": self.get_current_user,
        "find_user_by_name": self.find_user_by_name,
    }
Behavior2/5

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

With no annotations provided, the description carries full burden but lacks behavioral details. It doesn't disclose whether this is a read-only operation (implied by 'Get'), what permissions are needed, rate limits, or what the analytics output format looks like (e.g., aggregated metrics vs. raw data).

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 with zero waste. It's front-loaded with the core purpose and includes examples (velocity, completion rate) that add value without verbosity.

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?

For a tool with no annotations, no output schema, and 2 parameters, the description is incomplete. It doesn't explain what the analytics output contains (e.g., metrics format, timeframes), behavioral constraints, or how it differs from similar sibling tools, leaving significant gaps for an agent.

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?

Schema description coverage is 100%, so the schema already documents both parameters (space_id, period_days). The description adds no additional meaning about parameters beyond implying analytics are for tasks, which is redundant with the tool name. Baseline 3 is appropriate when schema does the heavy lifting.

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 verb 'Get' and the resource 'analytics for tasks', specifying the type of analytics (velocity, completion rate, etc.). It distinguishes from siblings like get_task (single task) or get_team_workload (team focus), but doesn't explicitly differentiate from all siblings like get_time_tracked (time-specific).

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?

No guidance on when to use this tool versus alternatives is provided. It doesn't mention when to choose this over get_team_workload for team metrics or get_time_tracked for time analytics, nor does it specify prerequisites like needing a space_id for analysis.

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/DiversioTeam/clickup-mcp'

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