Skip to main content
Glama
PhononX

Carbon Voice

by PhononX

move_folder

Move folders in Carbon Voice by ID to reorganize content into different folders or workspaces.

Instructions

Move a folder by its ID. Move a Folder into another Folder or into a Workspace.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYes
workspace_idNoWorkspace ID
folder_idNoFolder ID

Implementation Reference

  • MCP tool handler for 'move_folder' that handles authentication and delegates to simplifiedApi.moveFolder.
    async (args: MoveFolderInput, { authInfo }): Promise<McpToolResponse> => {
      try {
        return formatToMCPToolResponse(
          await simplifiedApi.moveFolder(
            args.id,
            args,
            setCarbonVoiceAuthHeader(authInfo?.token),
          ),
        );
      } catch (error) {
        logger.error('Error moving folder:', { error });
        return formatToMCPToolResponse(error);
      }
    },
  • src/server.ts:747-772 (registration)
    Registers the 'move_folder' tool with the MCP server, defining its description, input schema, and handler function.
    server.registerTool(
      'move_folder',
      {
        description:
          'Move a folder by its ID. Move a Folder into another Folder or into a Workspace.',
        inputSchema: moveFolderParams.merge(moveFolderBody).shape,
        annotations: {
          readOnlyHint: false,
          destructiveHint: false,
        },
      },
      async (args: MoveFolderInput, { authInfo }): Promise<McpToolResponse> => {
        try {
          return formatToMCPToolResponse(
            await simplifiedApi.moveFolder(
              args.id,
              args,
              setCarbonVoiceAuthHeader(authInfo?.token),
            ),
          );
        } catch (error) {
          logger.error('Error moving folder:', { error });
          return formatToMCPToolResponse(error);
        }
      },
    );
  • TypeScript type definition for the input of the move_folder tool, combining path and body parameters.
    export type MoveFolderInput = z.infer<typeof moveFolderParams> &
      z.infer<typeof moveFolderBody>;
  • Generated API helper function that performs the actual HTTP PATCH request to move the folder to a target workspace or folder.
    const moveFolder = (
      id: string,
      moveFolderPayload: MoveFolderPayload,
      options?: SecondParameter<typeof mutator>,
    ) => {
      return mutator<Folder>(
        {
          url: `/simplified/folders/${id}/move`,
          method: 'PATCH',
          headers: { 'Content-Type': 'application/json' },
          data: moveFolderPayload,
        },
        options,
      );
    };
  • Interface defining the payload for the move_folder operation, specifying the target workspace_id or folder_id.
    export interface MoveFolderPayload {
      /** Workspace ID */
      workspace_id?: string;
      /** Folder ID */
      folder_id?: string;
    }

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