get_task_comments
Retrieve comments for a specific ClickUp task to view feedback, updates, or discussions related to task management.
Instructions
Get comments on a task
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | Task ID |
Implementation Reference
- src/clickup_mcp/tools.py:819-840 (handler)MCP tool handler implementation for 'get_task_comments'. Resolves task ID using _resolve_task_id helper and delegates to ClickUpClient.get_task_comments, then formats the response.async def get_task_comments(self, task_id: str) -> Dict[str, Any]: """Get task comments.""" try: # First resolve the task to get the internal ID task = await self._resolve_task_id(task_id) comments = await self.client.get_task_comments(task.id) except ClickUpAPIError as e: return {"error": f"Failed to get comments for task '{task_id}': {e!s}"} return { "task_id": task.id, "comments": [ { "id": comment["id"], "text": comment["comment_text"], "user": comment["user"]["username"], "date": comment["date"], } for comment in comments ], "count": len(comments), }
- src/clickup_mcp/tools.py:208-218 (schema)Input schema definition for the get_task_comments tool, requiring task_id.Tool( name="get_task_comments", description="Get comments on a task", inputSchema={ "type": "object", "properties": { "task_id": {"type": "string", "description": "Task ID"}, }, "required": ["task_id"], }, ),
- src/clickup_mcp/tools.py:23-57 (registration)Registration of the get_task_comments handler in the tools dictionary mapping tool names to handler functions.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, }
- src/clickup_mcp/client.py:411-414 (handler)Core API client handler that makes the HTTP request to ClickUp API to fetch task comments.async def get_task_comments(self, task_id: str) -> List[Dict[str, Any]]: """Get comments for a task.""" data = await self._request("GET", f"/task/{task_id}/comment") return data.get("comments", [])
- src/clickup_mcp/server.py:41-44 (registration)MCP server registration where tool definitions (including schemas) are provided via list_tools handler.@self.server.list_tools() async def list_tools() -> List[Tool]: """List all available tools.""" return self.tools.get_tool_definitions()