Skip to main content
Glama
Leanware-io

ClickUp MCP Integration

by Leanware-io

get_folders

Retrieve all folders within a ClickUp space to organize and access project structures. Provide the space ID to list available folders.

Instructions

Get all folders in a space

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
space_idYesClickUp space ID

Implementation Reference

  • Defines the get_folders tool, including its handler function that calls the folder service to retrieve folders.
    const getFoldersTool = defineTool((z) => ({
      name: "get_folders",
      description: "Get all folders in a space",
      inputSchema: {
        space_id: z.string().describe("ClickUp space ID"),
      },
      handler: async (input) => {
        const { space_id } = input;
        const response = await folderService.getFolders(space_id);
        return {
          content: [{ type: "text", text: JSON.stringify(response) }],
        };
      },
    }));
  • Input schema definition for the get_folders tool, specifying the required space_id parameter.
    inputSchema: {
      space_id: z.string().describe("ClickUp space ID"),
    },
  • src/index.ts:20-20 (registration)
    Import statement for the getFoldersTool.
    import { getFoldersTool } from "./controllers/folder.controller";
  • src/index.ts:41-41 (registration)
    Registration of getFoldersTool in the tools array, which is later used to register all tools with the MCP server.
    getFoldersTool,
  • Helper service method that makes the API request to ClickUp to get folders in a space and processes the response.
    async getFolders(spaceId: string) {
      const response = await this.request<{ folders: any[] }>(
        `/space/${spaceId}/folder`
      );
    
      // Remove the "lists" attribute from each folder to reduce payload size
      if (response.folders && Array.isArray(response.folders)) {
        response.folders = response.folders.map((folder) => {
          const { lists, ...folderWithoutLists } = folder;
          return folderWithoutLists;
        });
      }
    
      return response;
    }

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/Leanware-io/clickup-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server