Skip to main content
Glama

deleteVersion

Remove specific versions of content in Adobe Experience Manager by specifying the path and version name to manage repository space and content history.

Instructions

Delete a specific version

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
versionNameYes

Implementation Reference

  • MCP tool registration for 'deleteVersion' including input schema definition (path and versionName required).
    { name: 'deleteVersion', description: 'Delete a specific version', inputSchema: { type: 'object', properties: { path: { type: 'string' }, versionName: { type: 'string' } }, required: ['path', 'versionName'], }, }, ];
  • Primary MCP server handler for the 'deleteVersion' tool: extracts parameters from MCP request, delegates to AEMConnector.deleteVersion, and formats response.
    case 'deleteVersion': { const { path, versionName } = args as { path: string; versionName: string }; const result = await aemConnector.deleteVersion(path, versionName); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
  • AEMConnector method that delegates deleteVersion call to the VersionOperations module.
    async deleteVersion(path: string, versionName: string) { return this.versionOps.deleteVersion(path, versionName); }
  • Core implementation of deleteVersion: validates inputs, constructs form data with cmd='deleteVersion', posts to AEM versioning endpoint '/bin/wcm/versioning/deleteVersion', logs, and returns structured success response.
    async deleteVersion(path: string, versionName: string): Promise<DeleteVersionResponse> { return safeExecute<DeleteVersionResponse>(async () => { if (!isValidContentPath(path)) { throw createAEMError( AEM_ERROR_CODES.INVALID_PARAMETERS, `Invalid content path: ${path}`, { path } ); } if (!versionName || typeof versionName !== 'string') { throw createAEMError( AEM_ERROR_CODES.INVALID_PARAMETERS, 'Version name is required', { versionName } ); } try { // Delete version using AEM's versioning API const formData = new URLSearchParams(); formData.append('cmd', 'deleteVersion'); formData.append('path', path); formData.append('version', versionName); await this.httpClient.post('/bin/wcm/versioning/deleteVersion', formData, { headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, }); this.logger.info(`Deleted version for path: ${path}`, { versionName }); return createSuccessResponse({ path, deletedVersion: versionName, deletedAt: new Date().toISOString(), deletedBy: this.config.serviceUser.username }, 'deleteVersion') as DeleteVersionResponse; } catch (error: any) { throw handleAEMHttpError(error, 'deleteVersion'); } }, 'deleteVersion'); }

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/indrasishbanerjee/aem-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server