Skip to main content
Glama

createVersion

Create a new version of content in Adobe Experience Manager by specifying the content path, with optional labels and comments for tracking changes.

Instructions

Create a new version of content

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
labelNo
commentNo

Implementation Reference

  • MCP tool handler for 'createVersion': extracts parameters from tool call arguments and invokes AEMConnector.createVersion, formats result as MCP response
    case 'createVersion': {
      const { path, label, comment } = args as { path: string; label?: string; comment?: string };
      const result = await aemConnector.createVersion(path, label, comment);
      return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
    }
  • JSON schema defining input parameters for the createVersion tool: path (required), optional label and comment
      name: 'createVersion',
      description: 'Create a new version of content',
      inputSchema: {
        type: 'object',
        properties: {
          path: { type: 'string' },
          label: { type: 'string' },
          comment: { type: 'string' }
        },
        required: ['path'],
      },
    },
  • Core implementation of createVersion: validates input, checks out node, POSTs form data to AEM's /bin/wcm/versioning/createVersion endpoint with cmd=createVersion, path, optional label/comment; checks in node; constructs and returns standardized success response with version details
    async createVersion(path: string, label?: string, comment?: string): Promise<CreateVersionResponse> {
      return safeExecute<CreateVersionResponse>(async () => {
        if (!isValidContentPath(path)) {
          throw createAEMError(
            AEM_ERROR_CODES.INVALID_PARAMETERS,
            `Invalid content path: ${path}`,
            { path }
          );
        }
    
        try {
          // Check out the content first
          await this.checkOutContent(path);
    
          // Create version using AEM's versioning API
          const formData = new URLSearchParams();
          formData.append('cmd', 'createVersion');
          formData.append('path', path);
          
          if (label) {
            formData.append('label', label);
          }
          
          if (comment) {
            formData.append('comment', comment);
          }
    
          const response = await this.httpClient.post('/bin/wcm/versioning/createVersion', formData, {
            headers: {
              'Content-Type': 'application/x-www-form-urlencoded',
            },
          });
    
          // Check the content back in
          await this.checkInContent(path);
    
          const versionName = response.data?.versionName || `v${Date.now()}`;
    
          this.logger.info(`Created version for path: ${path}`, {
            versionName,
            label,
            comment
          });
    
          return createSuccessResponse({
            path,
            versionName,
            label,
            comment,
            created: new Date().toISOString(),
            createdBy: this.config.serviceUser.username
          }, 'createVersion') as CreateVersionResponse;
    
        } catch (error: any) {
          throw handleAEMHttpError(error, 'createVersion');
        }
      }, 'createVersion');
    }
  • AEMConnector wrapper method that delegates createVersion call to the specialized VersionOperations instance
    async createVersion(path: string, label?: string, comment?: string) {
      return this.versionOps.createVersion(path, label, comment);
    }
  • Registers the listTools handler which returns the full tools array including createVersion tool definition for MCP clients to discover available tools
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools };
    });
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 states 'Create a new version' which implies a write/mutation operation, but doesn't clarify permissions needed, side effects (e.g., if it affects existing versions), or response behavior. This is a significant gap for a mutation tool with zero annotation coverage.

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 with no wasted words. It's front-loaded and to the point, though it could benefit from more detail given the tool's complexity. The brevity is appropriate but borders on under-specification.

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 tool's complexity (mutation with 3 parameters), lack of annotations, 0% schema coverage, and no output schema, the description is incomplete. It doesn't explain parameters, behavior, or output, making it inadequate for an agent to use correctly without additional context.

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?

Schema description coverage is 0%, so the description must compensate for undocumented parameters. It mentions 'content' but doesn't explain the three parameters (path, label, comment) or their roles. The description adds no meaning beyond the schema, failing to address the coverage gap.

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 'Create a new version of content' clearly states the action (create) and resource (version of content), but it's vague about what 'content' refers to and doesn't differentiate from sibling tools like 'restoreVersion' or 'deleteVersion'. It provides a basic purpose but lacks specificity about the domain or scope.

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 offers no guidance on when to use this tool versus alternatives like 'restoreVersion' or 'undoChanges', nor does it mention prerequisites or context. It's a standalone statement with no usage instructions, leaving the agent to infer when this operation is appropriate.

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