get_folder
Retrieve a specific folder by ID from Carbon Voice to access conversations and voice memos, with options to include first-level subfolders and filter by update date.
Instructions
Get a folder by its ID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| include_first_level_tree | No | Defines if the first level of the folder tree should be returned | |
| direction | No | Direction of the results (newer or older) | newer |
| date | No | Return only Subfolders updated based on the date and direction (must inform include_first_level_tree = true) |
Implementation Reference
- src/server.ts:649-662 (handler)The execution handler for the MCP 'get_folder' tool. It calls the simplified API's getFolderById method with authentication header and formats the response.async (args: GetFolderInput, { authInfo }): Promise<McpToolResponse> => { try { return formatToMCPToolResponse( await simplifiedApi.getFolderById( args.id, args, setCarbonVoiceAuthHeader(authInfo?.token), ), ); } catch (error) { logger.error('Error getting folder by id:', { error }); return formatToMCPToolResponse(error); } },
- Zod schema definitions for getFolderByIdParams (path param: id) and getFolderByIdQueryParams (query params: include_first_level_tree, direction, date), used in the tool's inputSchema.export const getFolderByIdParams = zod.object({ "id": zod.string() }) export const getFolderByIdQueryIncludeFirstLevelTreeDefault = false;export const getFolderByIdQueryDirectionDefault = "newer"; export const getFolderByIdQueryParams = zod.object({ "include_first_level_tree": zod.boolean().optional().describe('Defines if the first level of the folder tree should be returned'), "direction": zod.enum(['older', 'newer']).default(getFolderByIdQueryDirectionDefault).describe('Direction of the results (newer or older)'), "date": zod.string().datetime({}).nullish().describe('Return only Subfolders updated based on the date and direction (must inform include_first_level_tree = true)') })
- src/server.ts:639-648 (registration)MCP server registration of the 'get_folder' tool, including name, description, input schema (merged zod schemas), and annotations.server.registerTool( 'get_folder', { description: 'Get a folder by its ID.', inputSchema: getFolderByIdParams.merge(getFolderByIdQueryParams).shape, annotations: { readOnlyHint: true, destructiveHint: false, }, },
- Generated API client helper function that issues HTTP GET to `/simplified/folders/{id}` with optional query params, called by the MCP handler.const getFolderById = ( id: string, params?: GetFolderByIdParams, options?: SecondParameter<typeof mutator>, ) => { return mutator<Folder>( { url: `/simplified/folders/${id}`, method: 'GET', params }, options, ); };