Skip to main content
Glama
Leanware-io

ClickUp MCP Integration

by Leanware-io

get_folders

Retrieve all folders within a specified ClickUp space to organize and access project structures and content.

Instructions

Get all folders in a space

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
space_idYesClickUp space ID

Implementation Reference

  • The async handler function for the get_folders tool, which destructures space_id, calls folderService.getFolders, and returns the response as a text content block.
    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 using zod, requiring a space_id string.
    inputSchema: { space_id: z.string().describe("ClickUp space ID"), },
  • src/index.ts:20-20 (registration)
    Imports the getFoldersTool for registration.
    import { getFoldersTool } from "./controllers/folder.controller";
  • src/index.ts:40-41 (registration)
    Includes getFoldersTool in the tools array which is later registered to the MCP server.
    // Folder tools getFoldersTool,
  • Helper method in FolderService that fetches folders from ClickUp API for a given space, processes to remove lists, and returns data.
    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