Skip to main content
Glama
PhononX

Carbon Voice

by PhononX

get_message

Retrieve a specific message from Carbon Voice conversations using its unique ID, with options to include related data like conversation context or creator information.

Instructions

Get a message by its ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
languageNoLanguage (optional) - Original language will be used if not provided or not found.
fieldsNoFields (optional) - Additional fields to include in the response. Possible values: conversation, creator, labels.

Implementation Reference

  • src/server.ts:126-151 (registration)
    Registration of the 'get_message' MCP tool, including description, input schema (merged zod schemas), annotations, and the inline handler function that delegates to simplifiedApi.getMessageById with authentication.
    server.registerTool(
      'get_message',
      {
        description: 'Get a message by its ID.',
        inputSchema: getMessageByIdParams.merge(getMessageByIdQueryParams).shape,
        annotations: {
          readOnlyHint: true,
          destructiveHint: false,
        },
      },
      async (args: GetMessageInput, { authInfo }): Promise<McpToolResponse> => {
        try {
          const { id, ...queryParams } = args;
          return formatToMCPToolResponse(
            await simplifiedApi.getMessageById(
              id,
              queryParams,
              setCarbonVoiceAuthHeader(authInfo?.token),
            ),
          );
        } catch (error) {
          logger.error('Error getting message by id:', { args, error });
          return formatToMCPToolResponse(error);
        }
      },
    );
  • Zod schemas defining the input parameters for getMessageById: path param 'id' and optional query params 'language' and 'fields'. These are merged for the tool's inputSchema.
    export const getMessageByIdParams = zod.object({
      "id": zod.string()
    })
    
    export const getMessageByIdQueryParams = zod.object({
      "language": zod.string().optional().describe('Language (optional) - Original language will be used if not provided or not found.'),
      "fields": zod.string().optional().describe('Fields (optional) - Additional fields to include in the response. Possible values: conversation, creator, labels.')
    })
  • The underlying API handler getMessageById that makes the HTTP GET request to retrieve the message by ID using the mutator function, called by the MCP tool handler.
    const getMessageById = (
      id: string,
      params?: GetMessageByIdParams,
      options?: SecondParameter<typeof mutator>,
    ) => {
      return mutator<GetMessageResponse>(
        { url: `/simplified/messages/${id}`, method: 'GET', params },
        options,
      );
    };
  • TypeScript interface for the GetMessageResponse, defining the structure of the tool's output including message, optional creator, conversation, and labels.
    export interface GetMessageResponse {
      message: Message;
      creator?: User;
      conversation?: Conversation;
      labels?: Label[];
    }

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