delete_folder
Delete a folder and all its contents from ClickUp by providing the folder ID.
Instructions
Delete a folder from ClickUp. Removes the folder and its contents.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| folder_id | Yes | The ID of the folder to delete |
Implementation Reference
- src/tools/task-tools.ts:255-275 (handler)The MCP tool handler for 'delete_folder'. Registers a tool that accepts a folder_id (string), calls foldersClient.deleteFolder(folder_id), and returns the result as JSON.
server.tool( 'delete_folder', 'Delete a folder from ClickUp. Removes the folder and its contents.', { folder_id: z.string().describe('The ID of the folder to delete') }, async ({ folder_id }) => { try { const result = await foldersClient.deleteFolder(folder_id); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } catch (error: any) { console.error('Error deleting folder:', error); return { content: [{ type: 'text', text: `Error deleting folder: ${error.message}` }], isError: true }; } } ); - src/tools/task-tools.ts:258-259 (schema)Input schema for the delete_folder tool: expects a single required string parameter folder_id, validated with Zod.
{ folder_id: z.string().describe('The ID of the folder to delete') - src/tools/task-tools.ts:255-275 (registration)Tool registration via server.tool('delete_folder', ...) inside the setupTaskTools function.
server.tool( 'delete_folder', 'Delete a folder from ClickUp. Removes the folder and its contents.', { folder_id: z.string().describe('The ID of the folder to delete') }, async ({ folder_id }) => { try { const result = await foldersClient.deleteFolder(folder_id); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } catch (error: any) { console.error('Error deleting folder:', error); return { content: [{ type: 'text', text: `Error deleting folder: ${error.message}` }], isError: true }; } } ); - src/clickup-client/folders.ts:70-77 (helper)The FoldersClient.deleteFolder method that performs the HTTP DELETE request to /folder/{folderId} via the ClickUpClient.
/** * Delete a folder * @param folderId The ID of the folder to delete * @returns Success message */ async deleteFolder(folderId: string): Promise<{ success: boolean }> { return this.client.delete(`/folder/${folderId}`); }