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
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| workspace_id | No | Workspace ID | |
| folder_id | No | Folder ID |
Implementation Reference
- src/server.ts:758-771 (handler)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; }