Skip to main content
Glama

restoreVersion

Restore content to a specific version in Adobe Experience Manager by providing the content path and version name.

Instructions

Restore content to a specific version

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
versionNameYes

Implementation Reference

  • MCP tool registration for 'restoreVersion' including schema definition
    {
      name: 'restoreVersion',
      description: 'Restore content to a specific version',
      inputSchema: {
        type: 'object',
        properties: {
          path: { type: 'string' },
          versionName: { type: 'string' }
        },
        required: ['path', 'versionName'],
      },
    },
  • MCP server CallToolRequestSchema handler that calls AEMConnector.restoreVersion with extracted parameters
    case 'restoreVersion': {
      const { path, versionName } = args as { path: string; versionName: string };
      const result = await aemConnector.restoreVersion(path, versionName);
      return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
    }
  • AEMConnector method that delegates restoreVersion call to VersionOperations module
    async restoreVersion(path: string, versionName: string) {
      return this.versionOps.restoreVersion(path, versionName);
    }
  • Core implementation of restoreVersion: validates inputs, fetches current version, executes POST to AEM /bin/wcm/versioning/restoreVersion, logs action, returns formatted response
    async restoreVersion(path: string, versionName: string): Promise<RestoreVersionResponse> {
      return safeExecute<RestoreVersionResponse>(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 {
          // Get current version before restore
          const versionHistory = await this.getVersionHistory(path);
          const currentVersion = versionHistory.data.baseVersion;
    
          // Restore version using AEM's versioning API
          const formData = new URLSearchParams();
          formData.append('cmd', 'restoreVersion');
          formData.append('path', path);
          formData.append('version', versionName);
    
          await this.httpClient.post('/bin/wcm/versioning/restoreVersion', formData, {
            headers: {
              'Content-Type': 'application/x-www-form-urlencoded',
            },
          });
    
          this.logger.info(`Restored version for path: ${path}`, {
            versionName,
            previousVersion: currentVersion
          });
    
          return createSuccessResponse({
            path,
            restoredVersion: versionName,
            previousVersion: currentVersion,
            restoredAt: new Date().toISOString(),
            restoredBy: this.config.serviceUser.username
          }, 'restoreVersion') as RestoreVersionResponse;
    
        } catch (error: any) {
          throw handleAEMHttpError(error, 'restoreVersion');
        }
      }, 'restoreVersion');
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It implies a mutation operation ('restore'), but doesn't specify critical details like whether this overwrites current content, requires permissions, is reversible, or has side effects (e.g., affecting workflows). This is inadequate for a tool that likely modifies data.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's function without unnecessary words. It's appropriately front-loaded but could be more informative; however, it earns high marks for brevity and clarity within its limited scope.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a restore operation, no annotations, no output schema, and poor parameter documentation, the description is incomplete. It doesn't explain what 'content' entails, the restoration process, or expected outcomes, making it insufficient for safe and effective use by an AI agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0% description coverage, so parameters 'path' and 'versionName' are undocumented. The description adds no semantic information about these parameters (e.g., what 'path' refers to, how 'versionName' is formatted), failing to compensate for the schema gap. This leaves the agent guessing about input requirements.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Restore content to a specific version' clearly states the action (restore) and target (content), but it's vague about what 'content' refers to (e.g., pages, assets, components) and doesn't distinguish it from sibling tools like 'undoChanges' or 'compareVersions', which might involve version-related operations. It avoids tautology but lacks specificity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention prerequisites (e.g., needing a version history), exclusions, or comparisons to siblings like 'undoChanges' or 'getVersionHistory', leaving the agent to infer usage context from the tool name alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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