Skip to main content
Glama
PhononX

Carbon Voice

by PhononX

create_conversation_message

Send messages to existing Carbon Voice conversations using text-to-speech transcripts or attachments, with options for threaded replies and link sharing.

Instructions

Sends a message to an existing conversation or any type with a conversation_id. To reply as a thread, included a message_id for "parent_id". You must provide a transcript or attachment.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
transcriptNoThe Message transcript will be used to generate audio using text-to-speech
linksNoArray of links to be attached to the message
from_message_typeNoFrom Message typeNewMessage
from_message_idNoMessage ID to be used as a base for the new message. (Optional only when from_message_type is NewMessage)

Implementation Reference

  • The main handler function for the MCP tool 'create_conversation_message'. It receives the input arguments, authenticates using authInfo, calls the simplified Carbon Voice API to create the message, formats the response, and handles errors.
    async (
      args: CreateConversationMessageInput,
      { authInfo },
    ): Promise<McpToolResponse> => {
      try {
        return formatToMCPToolResponse(
          await simplifiedApi.createConversationMessage(
            args.id,
            args,
            setCarbonVoiceAuthHeader(authInfo?.token),
          ),
        );
      } catch (error) {
        logger.error('Error creating conversation message:', { args, error });
        return formatToMCPToolResponse(error);
      }
    },
  • src/server.ts:183-214 (registration)
    Registers the 'create_conversation_message' tool with the MCP server, defining its name, description, input schema (merged params and body Zod schemas), and annotations.
    server.registerTool(
      'create_conversation_message',
      {
        description:
          'Sends a message to an existing conversation or any type with a conversation_id. ' +
          'To reply as a thread, included a message_id for "parent_id". You must provide a transcript or attachment.',
        inputSchema: createConversationMessageParams.merge(
          createConversationMessageBody,
        ).shape,
        annotations: {
          readOnlyHint: false,
          destructiveHint: false,
        },
      },
      async (
        args: CreateConversationMessageInput,
        { authInfo },
      ): Promise<McpToolResponse> => {
        try {
          return formatToMCPToolResponse(
            await simplifiedApi.createConversationMessage(
              args.id,
              args,
              setCarbonVoiceAuthHeader(authInfo?.token),
            ),
          );
        } catch (error) {
          logger.error('Error creating conversation message:', { args, error });
          return formatToMCPToolResponse(error);
        }
      },
    );
  • Zod schema definitions for the tool input: createConversationMessageParams (conversation ID path param) and createConversationMessageBody (body with transcript, links, from_message_type, from_message_id). These are merged for the tool's inputSchema.
    export const createConversationMessageParams = zod.object({
      "id": zod.string()
    })
    
    export const createConversationMessageBodyFromMessageTypeDefault = "NewMessage";
    
    export const createConversationMessageBody = 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'),
      "from_message_type": zod.enum(['PreRecorded', 'NewMessage', 'Forward']).default(createConversationMessageBodyFromMessageTypeDefault).describe('From Message type'),
      "from_message_id": zod.string().optional().describe('Message ID to be used as a base for the new message. (Optional only when from_message_type is NewMessage)')
    })
  • TypeScript interface definition for CreateConversationMessage, matching the Zod body schema.
    export interface CreateConversationMessage {
      /** 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[];
      /** From Message type */
      from_message_type?: CreateConversationMessageFromMessageType;
      /** Message ID to be used as a base for the new message. (Optional only when from_message_type is NewMessage) */
      from_message_id?: string;
    }
  • Generated API client helper function simplifiedApi.createConversationMessage that performs the HTTP POST request to the Carbon Voice API endpoint to create the conversation message.
    const createConversationMessage = (
      id: string,
      createConversationMessage: CreateConversationMessage,
      options?: SecondParameter<typeof mutator>,
    ) => {
      return mutator<GetMessageResponse>(
        {
          url: `/simplified/messages/conversation/${id}`,
          method: 'POST',
          headers: { 'Content-Type': 'application/json' },
          data: createConversationMessage,
        },
        options,
      );
    };
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations indicate this is not read-only and not destructive, which the description doesn't contradict. The description adds useful behavioral context by specifying that a transcript or attachment is required and explaining the thread-reply functionality. However, it doesn't disclose other traits like rate limits, authentication needs, or what happens on success/failure, leaving some gaps despite the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with three sentences that each serve a purpose: stating the main action, explaining thread replies, and specifying requirements. It's front-loaded with the core functionality. However, it could be slightly more structured by explicitly listing key parameters or use cases.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 5 parameters, no output schema, and annotations covering only read/write/destructive hints, the description is moderately complete. It covers the main action and some requirements but lacks details on return values, error conditions, or how it interacts with sibling tools. Given the complexity, it should do more to compensate for the missing output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 80%, so the schema already documents most parameters well. The description adds marginal value by clarifying that 'parent_id' is for thread replies and that transcript/attachment is required, but it doesn't explain the semantics of 'id' (likely conversation_id) or other parameters beyond what the schema provides. Baseline 3 is appropriate given high schema coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Sends a message') and target ('to an existing conversation or any type with a conversation_id'), distinguishing it from sibling tools like create_direct_message or create_voicememo_message. However, it doesn't explicitly mention what resource type is being created/modified beyond 'message', making it slightly less specific than a perfect 5.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides some usage context by mentioning 'To reply as a thread, included a message_id for "parent_id"' and 'You must provide a transcript or attachment', which implies when to use certain parameters. However, it doesn't explicitly state when to use this tool versus alternatives like create_direct_message or add_attachments_to_message, nor does it mention prerequisites or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/PhononX/cv-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server