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
| Name | Required | Description | Default |
|---|---|---|---|
| space_id | Yes | ClickUp 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,
- src/services/folder.service.ts:28-42 (helper)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; }