get_root_folders
List root folders in a Carbon Voice workspace, including names, IDs, and structure, for voicememo or prerecorded message types. Supports sorting and optional folder tree inclusion.
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
| Name | Required | Description | Default |
|---|---|---|---|
| include_all_tree | No | Return all folders tree | |
| sort_by | No | Field to sort by | name |
| sort_direction | No | Sort order direction | ASC |
| type | Yes | Folder Type | |
| workspace_id | No | Workspace ID |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"include_all_tree": {
"description": "Return all folders tree",
"type": "boolean"
},
"sort_by": {
"default": "name",
"description": "Field to sort by",
"enum": [
"created_at",
"last_updated_at",
"name"
],
"type": "string"
},
"sort_direction": {
"default": "ASC",
"description": "Sort order direction",
"enum": [
"ASC",
"DESC"
],
"type": "string"
},
"type": {
"description": "Folder Type",
"enum": [
"voicememo",
"prerecorded"
],
"type": "string"
},
"workspace_id": {
"description": "Workspace ID",
"type": "string"
}
},
"required": [
"type"
],
"type": "object"
}
Implementation Reference
- src/server.ts:584-612 (handler)The registration and inline handler for the MCP 'get_root_folders' tool. It takes input params, authenticates with token, calls the simplified API, 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 input schema (getAllRootFoldersQueryParams) used by the tool for validation, defining parameters like type, workspace_id, sorting, etc.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 helper function getAllRootFolders in simplified API that makes the actual HTTP GET request to `/simplified/folders` with params.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./** * Generated by orval v7.9.0 🍺 * Do not edit manually. * Carbon Voice Simplified API * # Introduction The simplified version of the Carbon Voice API is designed to enhance usability for third-party clients looking to seamlessly integrate with our application. By streamlining authentication methods, providing clear error handling guidelines, and implementing straightforward rate limiting policies, we ensure that developers can quickly and efficiently connect to our services. This user-friendly approach minimizes complexity, making it easier for external applications to leverage the powerful communication features of Carbon Voice without extensive technical overhead. This API is designed for people who feel comfortable integrating with RESTful APIs. ## Full API Version We also have a full version of the API. You can find it [here](/docs). ## Terminology * **Workspace**: An area that groups together people and Conversations.