move_message_to_folder
Organize Carbon Voice messages by moving voicememos and prerecorded messages to specific folders or workspaces using message IDs.
Instructions
Move a message to a folder by its ID. Move a Message into another Folder or into a Workspace. Only allowed to move messages of type: voicememo,prerecorded.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message_id | Yes | Only allowed to add messages of type: voicememo,prerecorded | |
| workspace_id | No | Workspace ID | |
| folder_id | No | Folder ID |
Implementation Reference
- src/server.ts:774-802 (registration)Registration of the 'move_message_to_folder' MCP tool, including description, input schema reference, annotations, and inline handler function.server.registerTool( 'move_message_to_folder', { description: 'Move a message to a folder by its ID. Move a Message into another Folder or into a Workspace. ' + 'Only allowed to move messages of type: voicememo,prerecorded.', inputSchema: addMessageToFolderOrWorkspaceBody.shape, annotations: { readOnlyHint: false, destructiveHint: false, }, }, async ( args: AddMessageToFolderPayload, { authInfo }, ): Promise<McpToolResponse> => { try { return formatToMCPToolResponse( await simplifiedApi.addMessageToFolderOrWorkspace( args, setCarbonVoiceAuthHeader(authInfo?.token), ), ); } catch (error) { logger.error('Error moving message to folder:', { error }); return formatToMCPToolResponse(error); } }, );
- src/server.ts:786-801 (handler)Inline handler function that executes the tool logic: authenticates, calls the simplified API to move the message, formats the MCP response, and logs errors.async ( args: AddMessageToFolderPayload, { authInfo }, ): Promise<McpToolResponse> => { try { return formatToMCPToolResponse( await simplifiedApi.addMessageToFolderOrWorkspace( args, setCarbonVoiceAuthHeader(authInfo?.token), ), ); } catch (error) { logger.error('Error moving message to folder:', { error }); return formatToMCPToolResponse(error); } },
- Zod input schema definition for the tool: requires message_id, optionally workspace_id or folder_id to move the message to.export const addMessageToFolderOrWorkspaceBody = zod.object({ "message_id": zod.string().describe('Only allowed to add messages of type: voicememo,prerecorded'), "workspace_id": zod.string().optional().describe('Workspace ID'), "folder_id": zod.string().optional().describe('Folder ID') })
- Simplified API helper function that performs a PATCH request to `/simplified/folders/message` to move the message to a folder or workspace.const addMessageToFolderOrWorkspace = ( addMessageToFolderPayload: AddMessageToFolderPayload, options?: SecondParameter<typeof mutator>, ) => { return mutator<MessageV2>( { url: `/simplified/folders/message`, method: 'PATCH', headers: { 'Content-Type': 'application/json' }, data: addMessageToFolderPayload, }, options, ); };