Skip to main content
Glama

undoChanges

Revert the last component modifications in Adobe Experience Manager using the specified job ID to restore previous content states.

Instructions

Undo the last component changes

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
jobIdYes

Implementation Reference

  • Core implementation of the undoChanges tool logic. Attempts to restore a specific version using the jobId as version name if it matches version pattern and path is provided; otherwise returns guidance message.
    async undoChanges(request: { jobId: string; path?: string }): Promise<{ success: boolean; operation: string; timestamp: string; data: { message: string; request: { jobId: string; path?: string }; versionInfo?: { restoredVersion: string; path: string; }; timestamp: string; }; }> { return safeExecute(async () => { const { jobId, path } = request; // If jobId looks like a version name, try to restore it if (path && (jobId.startsWith('v') || jobId.includes('.'))) { try { const restoreResult = await this.restoreVersion(path, jobId); return createSuccessResponse({ message: `Successfully restored version ${jobId} for path ${path}`, request, versionInfo: { restoredVersion: restoreResult.data.restoredVersion, path: restoreResult.data.path }, timestamp: new Date().toISOString() }, 'undoChanges'); } catch (error: any) { // If restore fails, fall back to original message } } // Fallback to original implementation return createSuccessResponse({ message: 'undoChanges requires a valid path and version name. Use version operations for proper rollback functionality.', request, timestamp: new Date().toISOString() }, 'undoChanges'); }, 'undoChanges'); }
  • Tool schema definition including input schema requiring 'jobId' parameter, registered in the tools array returned by listTools.
    { name: 'undoChanges', description: 'Undo the last component changes', inputSchema: { type: 'object', properties: { jobId: { type: 'string' }, }, required: ['jobId'], }, },
  • MCP server request handler dispatch for 'undoChanges' tool call, invoking aemConnector.undoChanges and formatting response.
    case 'undoChanges': { const result = await aemConnector.undoChanges(args); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
  • Delegation of undoChanges request from AEMConnector to the VersionOperations module.
    async undoChanges(request: any) { return this.versionOps.undoChanges(request); }
  • Tool registration entry in MCP handler's available methods list.
    { name: 'undoChanges', description: 'Undo the last component changes', parameters: ['job_id'] },

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