list_folders
Retrieve a list of folders within a specified space in ClickUp. Enables organized task management by accessing folder structures for improved project workflow navigation.
Instructions
List folders in a space
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| space_id | Yes | Space ID |
Implementation Reference
- src/clickup_mcp/tools.py:951-974 (handler)The handler function for the 'list_folders' tool. It fetches folders from the ClickUp client for a given space_id and returns a structured JSON response including folder details and nested lists.async def list_folders(self, space_id: str) -> Dict[str, Any]: """List folders in space.""" folders = await self.client.get_folders(space_id) return { "space_id": space_id, "folders": [ { "id": folder.id, "name": folder.name, "task_count": folder.task_count, "lists": [ { "id": lst.id, "name": lst.name, "task_count": lst.task_count, } for lst in folder.lists ], } for folder in folders ], "count": len(folders), }
- src/clickup_mcp/tools.py:297-307 (schema)The input/output schema definition for the 'list_folders' tool as part of the MCP Tool returned in get_tool_definitions().Tool( name="list_folders", description="List folders in a space", inputSchema={ "type": "object", "properties": { "space_id": {"type": "string", "description": "Space ID"}, }, "required": ["space_id"], }, ),
- src/clickup_mcp/tools.py:23-57 (registration)The internal registration of the 'list_folders' handler method in the _tools dictionary, used by call_tool to dispatch tool calls.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/server.py:41-45 (registration)MCP server registration of list_tools handler which provides the tool schemas including 'list_folders' via ClickUpTools.get_tool_definitions().@self.server.list_tools() async def list_tools() -> List[Tool]: """List all available tools.""" return self.tools.get_tool_definitions()
- src/clickup_mcp/server.py:46-59 (registration)MCP server registration of call_tool handler which dispatches to ClickUpTools.call_tool, enabling execution of 'list_folders'.@self.server.call_tool() async def call_tool( name: str, arguments: Optional[Dict[str, Any]] = None ) -> List[TextContent | ImageContent | EmbeddedResource]: """Call a specific tool.""" logger.debug(f"Calling tool: {name} with arguments: {arguments}") try: result = await self.tools.call_tool(name, arguments or {}) return [TextContent(type="text", text=result)] except Exception as e: logger.error(f"Error calling tool {name}: {e}", exc_info=True) return [TextContent(type="text", text=f"Error: {e!s}")]