Skip to main content
Glama
DiversioTeam

ClickUp MCP Server

by DiversioTeam

list_lists

Retrieve all lists within a ClickUp folder or space to organize and manage project workflows efficiently.

Instructions

List all lists in a folder or space

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
folder_idNoFolder ID
space_idNoSpace ID

Implementation Reference

  • The main execution logic for the 'list_lists' tool. Fetches lists from ClickUp API (via client.get_lists) either for a specific folder/space or all spaces, and returns formatted list with IDs, names, space, and folder info.
    async def list_lists(
        self,
        folder_id: Optional[str] = None,
        space_id: Optional[str] = None,
    ) -> Dict[str, Any]:
        """List all lists."""
        if not folder_id and not space_id:
            # List all lists from all spaces
            spaces = await self.client.get_spaces()
            all_lists = []
            for space in spaces:
                lists = await self.client.get_lists(space_id=space.id)
                all_lists.extend(lists)
        else:
            all_lists = await self.client.get_lists(folder_id=folder_id, space_id=space_id)
    
        return {
            "lists": [
                {
                    "id": lst.id,
                    "name": lst.name,
                    "space": lst.space.get("name", "Unknown"),
                    "folder": lst.folder.get("name") if lst.folder else None,
                }
                for lst in all_lists
            ],
            "count": len(all_lists),
        }
  • The input schema definition for the list_lists tool, specifying optional folder_id and space_id parameters.
    Tool(
        name="list_lists",
        description="List all lists in a folder or space",
        inputSchema={
            "type": "object",
            "properties": {
                "folder_id": {"type": "string", "description": "Folder ID"},
                "space_id": {"type": "string", "description": "Space ID"},
            },
        },
    ),
  • MCP server registration: the list_tools handler that exposes the list_lists tool schema to the MCP protocol.
    @self.server.list_tools()
    async def list_tools() -> List[Tool]:
        """List all available tools."""
        return self.tools.get_tool_definitions()
  • Internal registration of the list_lists handler method in the ClickUpTools class _tools dictionary, used by call_tool.
    "list_lists": self.list_lists,
  • Instantiates ClickUpTools (containing list_lists) and MCP Server in ClickUpMCPServer init.
    self.client = ClickUpClient(config)
    self.tools = ClickUpTools(self.client)
    self.server = Server("clickup-mcp")

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