move_folder
Relocate folders by ID within Carbon Voice, enabling users to move them into another folder or workspace. Simplify folder organization and management.
Instructions
Move a folder by its ID. Move a Folder into another Folder or into a Workspace.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| folder_id | No | Folder ID | |
| id | Yes | ||
| workspace_id | No | Workspace ID |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"folder_id": {
"description": "Folder ID",
"type": "string"
},
"id": {
"type": "string"
},
"workspace_id": {
"description": "Workspace ID",
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
}
Implementation Reference
- src/server.ts:758-771 (handler)The handler function for the MCP 'move_folder' tool. It calls simplifiedApi.moveFolder with the provided args and auth token, formats the response, and handles errors.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' MCP tool with the server, specifying the name, description, input schema (merged zod schemas), annotations, and the 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 MoveFolderInput used in the handler signature, inferred from the zod schemas moveFolderParams and moveFolderBody.export type MoveFolderInput = z.infer<typeof moveFolderParams> & z.infer<typeof moveFolderBody>;
- The underlying generated API helper function 'moveFolder' that sends a PATCH request to move the folder to the specified workspace_id or folder_id.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, ); };
- Type definition for the payload sent to the moveFolder API endpoint, containing optional workspace_id or folder_id.export interface MoveFolderPayload { /** Workspace ID */ workspace_id?: string; /** Folder ID */ folder_id?: string; }