create_folder
Create a new folder in a ClickUp space by providing the space ID and folder name.
Instructions
Create a new folder in a ClickUp space with the specified name.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| space_id | Yes | The ID of the space to create the folder in | |
| name | Yes | The name of the folder |
Implementation Reference
- src/tools/task-tools.ts:209-230 (handler)The MCP tool handler for 'create_folder'. Registers the tool with server.tool(), defines schema (space_id, name), calls foldersClient.createFolder(), and handles errors.
server.tool( 'create_folder', 'Create a new folder in a ClickUp space with the specified name.', { space_id: z.string().describe('The ID of the space to create the folder in'), name: z.string().describe('The name of the folder') }, async ({ space_id, name }) => { try { const result = await foldersClient.createFolder(space_id, { name }); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } catch (error: any) { console.error('Error creating folder:', error); return { content: [{ type: 'text', text: `Error creating folder: ${error.message}` }], isError: true }; } } ); - src/clickup-client/folders.ts:56-58 (helper)The FoldersClient.createFolder() method that makes the actual HTTP POST request to the ClickUp API endpoint /space/{spaceId}/folder.
async createFolder(spaceId: string, params: { name: string }): Promise<Folder> { return this.client.post(`/space/${spaceId}/folder`, params); } - src/tools/task-tools.ts:212-215 (schema)Zod input schema for create_folder tool: requires space_id (string) and name (string).
{ space_id: z.string().describe('The ID of the space to create the folder in'), name: z.string().describe('The name of the folder') }, - src/tools/task-tools.ts:209-230 (registration)The tool is registered via server.tool() in setupTaskTools(), which is called from src/index.ts line 42.
server.tool( 'create_folder', 'Create a new folder in a ClickUp space with the specified name.', { space_id: z.string().describe('The ID of the space to create the folder in'), name: z.string().describe('The name of the folder') }, async ({ space_id, name }) => { try { const result = await foldersClient.createFolder(space_id, { name }); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } catch (error: any) { console.error('Error creating folder:', error); return { content: [{ type: 'text', text: `Error creating folder: ${error.message}` }], isError: true }; } } ); - src/clickup-client/index.ts:54-55 (helper)The ClickUpClient.post() method used by createFolder to make the HTTP POST request.
async post<T = any>(endpoint: string, data?: any): Promise<T> { const response = await this.axiosInstance.post(endpoint, data);