Skip to main content
Glama
DiversioTeam

ClickUp MCP Server

by DiversioTeam

get_subtasks

Retrieve all subtasks associated with a parent task in ClickUp to manage project workflows and track task dependencies.

Instructions

Get all subtasks of a parent task

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
parent_task_idYesParent task ID

Implementation Reference

  • MCP tool handler for 'get_subtasks'. Resolves parent task ID, fetches subtasks via client, and formats the response dictionary.
    async def get_subtasks(self, parent_task_id: str) -> Dict[str, Any]:
        """Get subtasks of a parent task."""
        try:
            # First resolve the task to get the internal ID
            task = await self._resolve_task_id(parent_task_id)
            # Use the client's proper subtasks method
            subtasks = await self.client.get_subtasks(task.id)
    
            return {
                "parent_id": task.id,
                "subtasks": [
                    {
                        "id": task.id,
                        "name": task.name,
                        "status": task.status.status,
                        "assignees": [u.username for u in task.assignees],
                        "url": format_task_url(task.id),
                        "custom_id": task.custom_id if task.custom_id else None,
                    }
                    for task in subtasks
                ],
                "count": len(subtasks),
            }
        except Exception as e:
            return {"error": f"Failed to get subtasks for '{parent_task_id}': {e!s}"}
  • JSON Schema definition for the input parameters of the 'get_subtasks' tool.
    Tool(
        name="get_subtasks",
        description="Get all subtasks of a parent task",
        inputSchema={
            "type": "object",
            "properties": {
                "parent_task_id": {"type": "string", "description": "Parent task ID"},
            },
            "required": ["parent_task_id"],
        },
    ),
  • Registration of the 'get_subtasks' handler method in the tools dispatch dictionary used by 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,
    }
  • Helper method in ClickUpClient that performs the actual API call to retrieve subtasks using the team/task endpoint with parent filter.
    async def get_subtasks(self, parent_task_id: str) -> List[Task]:
        """Get subtasks of a parent task using team endpoint."""
        # Get the workspace ID - use configured default or fetch from API
        workspace_id = self.config.default_workspace_id
        if not workspace_id:
            workspaces = await self.get_workspaces()
            if not workspaces:
                return []
            workspace_id = workspaces[0].id
    
        # Use team endpoint to get tasks with parent filter
        params = {
            "parent": parent_task_id,
            "include_closed": "true",
        }
    
        try:
            data = await self._request("GET", f"/team/{workspace_id}/task", params=params)
            tasks_data = data.get("tasks", [])
            return [Task(**task_data) for task_data in tasks_data]
        except ClickUpAPIError as e:
            # If team endpoint fails, fallback to original method
            logger.warning(f"Team endpoint failed for subtasks: {e}")
            return []
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states a read operation ('Get'), implying it's likely safe, but doesn't cover critical aspects like permissions required, rate limits, pagination, error handling, or return format. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 zero waste—it directly states the tool's purpose without unnecessary words. It's appropriately sized for a simple retrieval tool and front-loaded with essential information.

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 tool's simplicity (1 parameter, 100% schema coverage) but lack of annotations and output schema, the description is incomplete. It doesn't explain what 'subtasks' entail (e.g., structure, fields returned) or behavioral traits like error cases. For a tool with no structured output or safety hints, more context is needed to be fully helpful.

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 the single parameter 'parent_task_id' fully documented in the schema. The description adds no additional meaning beyond implying the parameter is required to fetch subtasks. This meets the baseline of 3 when the 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 resource ('subtasks of a parent task'), making the purpose specific and understandable. It distinguishes from siblings like 'get_task' (single task) and 'list_tasks' (all tasks), though it doesn't explicitly name these alternatives. A 5 would require explicit sibling differentiation.

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 like 'get_task' or 'list_tasks'. It doesn't mention prerequisites (e.g., needing a valid parent task ID) or exclusions. The minimal context implies usage for retrieving subtasks but offers no decision-making help.

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