Skip to main content
Glama
PhononX

Carbon Voice

by PhononX

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
NameRequiredDescriptionDefault
message_idYesOnly allowed to add messages of type: voicememo,prerecorded
workspace_idNoWorkspace ID
folder_idNoFolder 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);
        }
      },
    );
  • 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,
      );
    };

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