create_folder
Generate a new folder in Carbon Voice to organize voicememos or prerecorded messages. Specify folder name, type, and workspace for efficient voice data management.
Instructions
Create a new folder.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name of the Folder | |
| parent_folder_id | No | Parent Folder ID | |
| type | Yes | Folder type | |
| workspace_id | Yes | Workspace ID |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"name": {
"description": "Name of the Folder",
"type": "string"
},
"parent_folder_id": {
"description": "Parent Folder ID",
"type": "string"
},
"type": {
"description": "Folder type",
"enum": [
"voicememo",
"prerecorded"
],
"type": "string"
},
"workspace_id": {
"description": "Workspace ID",
"type": "string"
}
},
"required": [
"name",
"type",
"workspace_id"
],
"type": "object"
}
Implementation Reference
- src/server.ts:614-637 (registration)Registration of the MCP 'create_folder' tool, including the handler function that calls the underlying Carbon Voice API via simplifiedApi.createFolder, with input schema validation using Zod.server.registerTool( 'create_folder', { description: 'Create a new folder.', inputSchema: createFolderBody.shape, annotations: { readOnlyHint: false, destructiveHint: false, }, }, async (args: CreateFolderPayload, { authInfo }): Promise<McpToolResponse> => { try { return formatToMCPToolResponse( await simplifiedApi.createFolder( args, setCarbonVoiceAuthHeader(authInfo?.token), ), ); } catch (error) { logger.error('Error creating folder:', { error }); return formatToMCPToolResponse(error); } }, );
- TypeScript interface defining the input payload structure for creating a folder, used by the tool's schema.export interface CreateFolderPayload { /** Name of the Folder */ name: string; /** Folder type */ type: CreateFolderPayloadType; /** Workspace ID */ workspace_id: string; /** Parent Folder ID */ parent_folder_id?: string; }
- Type definition and enum for the folder type used in CreateFolderPayload.export type CreateFolderPayloadType = (typeof CreateFolderPayloadType)[keyof typeof CreateFolderPayloadType]; // eslint-disable-next-line @typescript-eslint/no-redeclare export const CreateFolderPayloadType = { voicememo: 'voicememo', prerecorded: 'prerecorded', } as const;
- Generated API client function that performs the HTTP POST request to create a folder, called by the MCP tool handler.const createFolder = ( createFolderPayload: CreateFolderPayload, options?: SecondParameter<typeof mutator>, ) => { return mutator<Folder>( { url: `/simplified/folders`, method: 'POST', headers: { 'Content-Type': 'application/json' }, data: createFolderPayload, }, options, ); };