Skip to main content
Glama
PhononX

Carbon Voice

by PhononX

get_root_folders

Retrieve root folder listings for voice memo or prerecorded content in a Carbon Voice workspace, providing names, IDs, and basic structure information.

Instructions

Lists all root folders for a given workspace, including their names, IDs, and basic structure, but does not provide aggregate counts.(Required to inform message type:voicememo,prerecorded)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
typeYesFolder Type
include_all_treeNoReturn all folders tree
workspace_idNoWorkspace ID
sort_directionNoSort order directionASC
sort_byNoField to sort byname

Implementation Reference

  • The MCP tool registration includes the inline handler function for 'get_root_folders'. The handler takes args and authInfo, calls simplifiedApi.getAllRootFolders with authentication header, formats the response, and handles errors.
    server.registerTool(
      'get_root_folders',
      {
        description:
          'Lists all root folders for a given workspace, including their names, IDs, and basic structure, ' +
          'but does not provide aggregate counts.(Required to inform message type:voicememo,prerecorded)',
        inputSchema: getAllRootFoldersQueryParams.shape,
        annotations: {
          readOnlyHint: true,
          destructiveHint: false,
        },
      },
      async (
        args: GetAllRootFoldersParams,
        { authInfo },
      ): Promise<McpToolResponse> => {
        try {
          return formatToMCPToolResponse(
            await simplifiedApi.getAllRootFolders(
              args,
              setCarbonVoiceAuthHeader(authInfo?.token),
            ),
          );
        } catch (error) {
          logger.error('Error listing root folders:', { error });
          return formatToMCPToolResponse(error);
        }
      },
    );
  • Zod schema definition for input parameters to getAllRootFolders, used as inputSchema in the tool registration. Defines required 'type' and optional fields for filtering and sorting root folders.
    export const getAllRootFoldersQueryParams = zod.object({
      "type": zod.enum(['voicememo', 'prerecorded']).describe('Folder Type'),
      "include_all_tree": zod.boolean().optional().describe('Return all folders tree'),
      "workspace_id": zod.string().optional().describe('Workspace ID'),
      "sort_direction": zod.enum(['ASC', 'DESC']).default(getAllRootFoldersQuerySortDirectionDefault).describe('Sort order direction'),
      "sort_by": zod.enum(['created_at', 'last_updated_at', 'name']).default(getAllRootFoldersQuerySortByDefault).describe('Field to sort by')
    })
  • Generated API helper function that performs the HTTP GET request to '/simplified/folders' with query params to fetch root folders, called by the MCP tool handler.
    const getAllRootFolders = (
      params: GetAllRootFoldersParams,
      options?: SecondParameter<typeof mutator>,
    ) => {
      return mutator<ListFoldersResponse>(
        { url: `/simplified/folders`, method: 'GET', params },
        options,
      );
    };
  • TypeScript type definition for GetAllRootFoldersParams, used in the handler signature and API function.
    export type GetAllRootFoldersParams = {
      /**
       * Folder Type
       */
      type: GetAllRootFoldersType;
      /**
       * Return all folders tree
       */
      include_all_tree?: boolean;
      /**
       * Workspace ID
       */
      workspace_id?: string;
      /**
       * Sort order direction
       */
      sort_direction?: GetAllRootFoldersSortDirection;
      /**
       * Field to sort by
       */
      sort_by?: GetAllRootFoldersSortBy;
    };

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