create_voicememo_message
Generate and send a VoiceMemo Message by converting a transcript to audio or attaching links, enabling easy communication through Carbon Voice.
Instructions
Create a VoiceMemo Message. In order to create a VoiceMemo Message, you must provide a transcript or link attachments.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| folder_id | No | Folder ID (not allowed when workspace_id specified is different from the folder_id) | |
| links | No | Array of links to be attached to the message | |
| transcript | No | The Message transcript will be used to generate audio using text-to-speech | |
| workspace_id | No | Workspace ID (not allowed when folder_id specified is different from the folder_id) |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"folder_id": {
"description": "Folder ID (not allowed when workspace_id specified is different from the folder_id)",
"type": "string"
},
"links": {
"description": "Array of links to be attached to the message",
"items": {
"type": "string"
},
"type": "array"
},
"transcript": {
"description": "The Message transcript will be used to generate audio using text-to-speech",
"type": "string"
},
"workspace_id": {
"description": "Workspace ID (not allowed when folder_id specified is different from the folder_id)",
"type": "string"
}
},
"type": "object"
}
Implementation Reference
- src/server.ts:255-269 (handler)The handler function for the MCP 'create_voicememo_message' tool. It calls the simplified API with authentication and formats the response or error.args: CreateVoicememoMessage, { authInfo }, ): Promise<McpToolResponse> => { try { return formatToMCPToolResponse( await simplifiedApi.createVoiceMemoMessage( args, setCarbonVoiceAuthHeader(authInfo?.token), ), ); } catch (error) { logger.error('Error creating voicememo message:', { args, error }); return formatToMCPToolResponse(error); } },
- src/server.ts:243-270 (registration)Registration of the 'create_voicememo_message' tool on the MCP server, including schema reference and inline handler.server.registerTool( 'create_voicememo_message', { description: 'Create a VoiceMemo Message. In order to create a VoiceMemo Message, you must provide a transcript or link attachments.', inputSchema: createVoiceMemoMessageBody.shape, annotations: { readOnlyHint: false, destructiveHint: false, }, }, async ( args: CreateVoicememoMessage, { authInfo }, ): Promise<McpToolResponse> => { try { return formatToMCPToolResponse( await simplifiedApi.createVoiceMemoMessage( args, setCarbonVoiceAuthHeader(authInfo?.token), ), ); } catch (error) { logger.error('Error creating voicememo message:', { args, error }); return formatToMCPToolResponse(error); } }, );
- Zod schema for the input body of createVoiceMemoMessage, used as inputSchema.shape in tool registration for validation.export const createVoiceMemoMessageBody = zod.object({ "transcript": zod.string().optional().describe('The Message transcript will be used to generate audio using text-to-speech'), "links": zod.array(zod.string()).optional().describe('Array of links to be attached to the message'), "folder_id": zod.string().optional().describe('Folder ID (not allowed when workspace_id specified is different from the folder_id)'), "workspace_id": zod.string().optional().describe('Workspace ID (not allowed when folder_id specified is different from the folder_id)') })
- TypeScript interface defining the structure of CreateVoicememoMessage input parameters, used in handler args type.export interface CreateVoicememoMessage { /** The Message transcript will be used to generate audio using text-to-speech */ transcript?: string; /** Array of links to be attached to the message */ links?: string[]; /** Folder ID (not allowed when workspace_id specified is different from the folder_id) */ folder_id?: string; /** Workspace ID (not allowed when folder_id specified is different from the folder_id) */ workspace_id?: string; }
- Generated API client helper function that sends POST request to /simplified/messages/voicememo endpoint, called by the MCP handler.const createVoiceMemoMessage = ( createVoicememoMessage: CreateVoicememoMessage, options?: SecondParameter<typeof mutator>, ) => { return mutator<GetMessageResponse>( { url: `/simplified/messages/voicememo`, method: 'POST', headers: { 'Content-Type': 'application/json' }, data: createVoicememoMessage, }, options, ); };