list_spaces
Retrieve all spaces within a ClickUp workspace to organize and manage projects efficiently. This tool integrates with the ClickUp MCP Server to streamline task management workflows.
Instructions
List all spaces in workspace
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/clickup_mcp/tools.py:934-949 (handler)The main handler function for the 'list_spaces' tool. It calls the ClickUp client's get_spaces method and returns a formatted list of spaces with id, name, private status, and color.async def list_spaces(self) -> Dict[str, Any]: """List all spaces.""" spaces = await self.client.get_spaces() return { "spaces": [ { "id": space.id, "name": space.name, "private": space.private, "color": space.color, } for space in spaces ], "count": len(spaces), }
- src/clickup_mcp/tools.py:289-296 (schema)The schema definition for the 'list_spaces' tool, specifying no input parameters and a description of listing all spaces in the workspace.Tool( name="list_spaces", description="List all spaces in workspace", inputSchema={ "type": "object", "properties": {}, }, ),
- src/clickup_mcp/tools.py:37-37 (registration)Registration of the 'list_spaces' handler function in the ClickUpTools._tools dictionary, mapping the tool name to its implementation."list_spaces": self.list_spaces,
- src/clickup_mcp/client.py:186-198 (helper)Helper method in ClickUpClient that fetches spaces from the ClickUp API via GET /team/{workspace_id}/space and parses them into Space model objects.async def get_spaces(self, workspace_id: Optional[str] = None) -> List[Space]: """Get all spaces in a workspace.""" workspace_id = workspace_id or self.config.default_workspace_id if not workspace_id: workspaces = await self.get_workspaces() if not workspaces: raise ClickUpAPIError("No workspaces found") workspace_id = workspaces[0].id data = await self._request("GET", f"/team/{workspace_id}/space") spaces = data.get("spaces", []) return [Space(**space) for space in spaces]