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'] },
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It implies a mutation operation ('undo') but doesn't specify whether this is reversible, what permissions are required, what happens to related data, or what the response looks like. The description lacks critical behavioral context for a mutation tool.

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

Conciseness5/5

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

The description is extremely concise—a single, clear sentence with no wasted words. It's front-loaded with the core purpose and appropriately sized for what it communicates.

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?

For a mutation tool with no annotations, 0% schema description coverage, and no output schema, the description is inadequate. It doesn't explain the parameter, behavioral implications, error conditions, or what constitutes success. Given the complexity of undoing changes in a content system, more context is needed.

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 schema has 0% description coverage, so the single parameter 'jobId' is completely undocumented in the schema. The description provides no information about this parameter—what it represents, where to find it, or its format. This leaves a significant gap in understanding how to invoke the tool correctly.

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

Purpose4/5

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

The description clearly states the action ('undo') and target ('last component changes'), providing a specific verb+resource combination. However, it doesn't distinguish this tool from potential alternatives like 'restoreVersion' or explicitly define what constitutes 'component changes' versus other types of changes in the system.

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 like 'restoreVersion' or 'cancelWorkflow', nor does it mention prerequisites, constraints, or typical scenarios for its application. The agent must infer usage from the 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