Skip to main content
Glama

activatePage

Publish a single page in Adobe Experience Manager to make it live on your website. Use this tool to activate specific content pages for public viewing.

Instructions

Activate (publish) a single page

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pagePathYes
activateTreeNo

Implementation Reference

  • Core handler function that executes the page activation by posting to AEM replication endpoints (/bin/replicate.json or fallback /bin/wcmcommand). Handles parameters pagePath and activateTree.
    async activatePage(request) {
        return safeExecute(async () => {
            const { pagePath, activateTree = false } = request;
            if (!isValidContentPath(pagePath)) {
                throw createAEMError(AEM_ERROR_CODES.INVALID_PARAMETERS, `Invalid page path: ${String(pagePath)}`, { pagePath });
            }
            try {
                // Use the correct AEM replication servlet endpoint
                const formData = new URLSearchParams();
                formData.append('cmd', 'Activate');
                formData.append('path', pagePath);
                formData.append('ignoredeactivated', 'false');
                formData.append('onlymodified', 'false');
                if (activateTree) {
                    formData.append('deep', 'true');
                }
                const response = await this.httpClient.post('/bin/replicate.json', formData, {
                    headers: {
                        'Content-Type': 'application/x-www-form-urlencoded',
                    },
                });
                return createSuccessResponse({
                    success: true,
                    activatedPath: pagePath,
                    activateTree,
                    response: response.data,
                    timestamp: new Date().toISOString(),
                }, 'activatePage');
            }
            catch (error) {
                // Fallback to alternative replication methods
                try {
                    const wcmResponse = await this.httpClient.post('/bin/wcmcommand', {
                        cmd: 'activate',
                        path: pagePath,
                        ignoredeactivated: false,
                        onlymodified: false,
                    });
                    return createSuccessResponse({
                        success: true,
                        activatedPath: pagePath,
                        activateTree,
                        response: wcmResponse.data,
                        fallbackUsed: 'WCM Command',
                        timestamp: new Date().toISOString(),
                    }, 'activatePage');
                }
                catch (fallbackError) {
                    throw handleAEMHttpError(error, 'activatePage');
                }
            }
        }, 'activatePage');
  • MCP tool schema definition including input schema for parameters pagePath (required) and activateTree (optional boolean).
        name: 'activatePage',
        description: 'Activate (publish) a single page',
        inputSchema: {
            type: 'object',
            properties: {
                pagePath: { type: 'string' },
                activateTree: { type: 'boolean' },
            },
            required: ['pagePath'],
        },
    },
  • MCP server registration: the callToolRequest handler switch case that invokes aemConnector.activatePage with tool arguments.
    case 'activatePage': {
        const result = await aemConnector.activatePage(args);
        return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
  • Delegation handler in AEMConnector class that forwards activatePage calls to the PageOperations module.
    async activatePage(request) {
        return this.pageOps.activatePage(request);
  • Handler in MCPRequestHandler class switch statement that dispatches to aemConnector.activatePage.
    case 'activatePage':
        return await this.aemConnector.activatePage(params);

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