delete_folder
Remove a folder and its nested folders along with all contained messages by specifying the folder ID. This action is irreversible, so ensure accuracy before proceeding.
Instructions
Delete a folder by its ID. Deleting a folder will also delete nested folders and all the messages in referenced folders. (This is a destructive action and cannot be undone, so please be careful.)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes |
Implementation Reference
- src/server.ts:732-744 (handler)The MCP tool handler function for 'delete_folder'. It takes folder ID, authenticates, calls the simplified API's deleteFolder method, and formats the response.async (args: GetByIdParams, { authInfo }): Promise<McpToolResponse> => { try { return formatToMCPToolResponse( await simplifiedApi.deleteFolder( args.id, setCarbonVoiceAuthHeader(authInfo?.token), ), ); } catch (error) { logger.error('Error deleting folder:', { error }); return formatToMCPToolResponse(error); } },
- Zod input schema for delete_folder tool, requiring a folder 'id' string.export const deleteFolderParams = zod.object({ "id": zod.string() })
- src/server.ts:720-745 (registration)Registration of the 'delete_folder' MCP tool, including description, input schema reference, and annotations.server.registerTool( 'delete_folder', { description: 'Delete a folder by its ID. Deleting a folder will also delete nested folders and all the messages in referenced folders. ' + '(This is a destructive action and cannot be undone, so please be careful.)', inputSchema: deleteFolderParams.shape, annotations: { readOnlyHint: false, destructiveHint: true, }, }, async (args: GetByIdParams, { authInfo }): Promise<McpToolResponse> => { try { return formatToMCPToolResponse( await simplifiedApi.deleteFolder( args.id, setCarbonVoiceAuthHeader(authInfo?.token), ), ); } catch (error) { logger.error('Error deleting folder:', { error }); return formatToMCPToolResponse(error); } }, );
- Generated API client helper function that sends DELETE request to delete the folder via Carbon Voice API.const deleteFolder = ( id: string, options?: SecondParameter<typeof mutator>, ) => { return mutator<void>( { url: `/simplified/folders/${id}`, method: 'DELETE' }, options, ); };