Skip to main content
Glama

aem_replicate_content

Activate or deactivate content on AEM publish instances by specifying the content path and replication action.

Instructions

Replicate content to publish instance

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesContent path to replicate
actionNoReplication action (activate/deactivate)activate
hostNoAEM host (default: localhost)localhost
portNoAEM port (default: 4502)
usernameNoAEM username (default: admin)admin
passwordNoAEM password (default: admin)admin

Implementation Reference

  • The MCP tool handler that extracts parameters, validates input, calls the AEMClient to perform replication, and formats the response for MCP.
      async replicateContent(args: any) {
        const config = this.getConfig(args);
        const { path, action = 'activate' } = args;
    
        if (!path) {
          throw new Error('Content path is required');
        }
    
        const result = await this.aemClient.replicateContent(config, path, action);
        
        return {
          content: [
            {
              type: 'text',
              text: `Content Replication Result:
    Success: ${result.success}
    Message: ${result.message}
    Path: ${path}
    Action: ${action}`,
            },
          ],
        };
      }
  • Core implementation that performs the HTTP POST request to AEM's /bin/replicate.json endpoint to activate or deactivate content.
    async replicateContent(config: AEMConfig, contentPath: string, action: string = 'activate'): Promise<any> {
      const baseUrl = this.getBaseUrl(config);
      const authHeader = this.getAuthHeader(config);
    
      const formData = new FormData();
      formData.append('cmd', action);
      formData.append('path', contentPath);
    
      try {
        const response = await this.axiosInstance.post(
          `${baseUrl}/bin/replicate.json`,
          formData,
          {
            headers: {
              'Authorization': authHeader,
              ...formData.getHeaders(),
            },
          }
        );
    
        if (response.status === 200) {
          return {
            success: true,
            message: `Content ${action}d successfully: ${contentPath}`,
            response: response.data,
          };
        } else {
          return {
            success: false,
            message: `Replication failed: HTTP ${response.status}`,
            response: response.data,
          };
        }
      } catch (error) {
        throw new Error(`Replication failed: ${error instanceof Error ? error.message : 'Unknown error'}`);
      }
    }
  • JSON schema defining the input parameters for the aem_replicate_content tool, including path (required), action, and connection details.
    inputSchema: {
      type: 'object',
      properties: {
        path: {
          type: 'string',
          description: 'Content path to replicate'
        },
        action: {
          type: 'string',
          description: 'Replication action (activate/deactivate)',
          enum: ['activate', 'deactivate'],
          default: 'activate'
        },
        host: {
          type: 'string',
          description: 'AEM host (default: localhost)',
          default: 'localhost'
        },
        port: {
          type: 'number',
          description: 'AEM port (default: 4502)',
          default: 4502
        },
        username: {
          type: 'string',
          description: 'AEM username (default: admin)',
          default: 'admin'
        },
        password: {
          type: 'string',
          description: 'AEM password (default: admin)',
          default: 'admin'
        }
      },
      required: ['path']
    }
  • src/index.ts:361-362 (registration)
    Switch case in CallToolRequestSchema handler that dispatches the tool call to the AEMTools.replicateContent method.
    case 'aem_replicate_content':
      return await this.aemTools.replicateContent(args);
  • src/index.ts:191-230 (registration)
    Tool registration in ListToolsRequestSchema response, providing name, description, and schema.
    {
      name: 'aem_replicate_content',
      description: 'Replicate content to publish instance',
      inputSchema: {
        type: 'object',
        properties: {
          path: {
            type: 'string',
            description: 'Content path to replicate'
          },
          action: {
            type: 'string',
            description: 'Replication action (activate/deactivate)',
            enum: ['activate', 'deactivate'],
            default: 'activate'
          },
          host: {
            type: 'string',
            description: 'AEM host (default: localhost)',
            default: 'localhost'
          },
          port: {
            type: 'number',
            description: 'AEM port (default: 4502)',
            default: 4502
          },
          username: {
            type: 'string',
            description: 'AEM username (default: admin)',
            default: 'admin'
          },
          password: {
            type: 'string',
            description: 'AEM password (default: admin)',
            default: 'admin'
          }
        },
        required: ['path']
      }
    },
Behavior2/5

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

With no annotations provided, the description carries full burden but only states the basic action without behavioral details. It doesn't disclose if this is a destructive operation, what permissions are needed, rate limits, or what happens on the publish instance, which is critical for a replication 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 a single, efficient sentence with zero waste. It's front-loaded with the core action and resource, making it easy to parse quickly, which is ideal for conciseness.

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 replication tool with 6 parameters, no annotations, and no output schema, the description is incomplete. It lacks details on behavioral traits, error handling, or return values, which are essential for safe and effective use in an AEM context.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema fully documents all 6 parameters. The description adds no additional meaning beyond the schema, such as explaining the 'activate/deactivate' actions in context or the significance of the path parameter, meeting the baseline for high coverage.

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 ('replicate') and resource ('content to publish instance'), making the purpose understandable. However, it doesn't differentiate from sibling tools like aem_install_package or aem_create_page, which also involve content operations, so it's not fully distinctive.

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, timing, or compare to siblings like aem_clear_cache or aem_query_content, leaving the agent to guess based on context 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/pradeep-moolemane/aem-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server