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
| Name | Required | Description | Default |
|---|---|---|---|
| jobId | Yes |
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'); }
- src/mcp-server.ts:55-65 (schema)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'], }, },
- src/mcp-server.ts:607-610 (handler)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) }] }; }
- src/aem-connector-new.ts:293-295 (handler)Delegation of undoChanges request from AEMConnector to the VersionOperations module.async undoChanges(request: any) { return this.versionOps.undoChanges(request); }
- src/mcp-handler.ts:122-122 (registration)Tool registration entry in MCP handler's available methods list.{ name: 'undoChanges', description: 'Undo the last component changes', parameters: ['job_id'] },