Skip to main content
Glama

aem_create_page

Create a new page in Adobe Experience Manager by specifying parent path, page name, title, and template using the AEM MCP Server tool.

Instructions

Create a new page in AEM

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
hostNoAEM host (default: localhost)localhost
pageNameYesName of the new page
pageTitleYesTitle of the new page
parentPathYesParent path where to create the page
passwordNoAEM password (default: admin)admin
portNoAEM port (default: 4502)
templateYesTemplate path for the page
usernameNoAEM username (default: admin)admin

Implementation Reference

  • Main handler function for aem_create_page tool. Extracts parameters, validates inputs, calls AEMClient.createPage, and formats the MCP response.
    async createPage(args: any) { const config = this.getConfig(args); const { parentPath, pageName, pageTitle, template } = args; if (!parentPath || !pageName || !pageTitle || !template) { throw new Error('parentPath, pageName, pageTitle, and template are required'); } const result = await this.aemClient.createPage(config, parentPath, pageName, pageTitle, template); return { content: [ { type: 'text', text: `Page Creation Result: Success: ${result.success} Message: ${result.message} ${result.path ? `Path: ${result.path}` : ''} Parent: ${parentPath} Name: ${pageName} Title: ${pageTitle} Template: ${template}`, }, ], }; }
  • Tool schema definition including input schema, returned in ListTools request.
    { name: 'aem_create_page', description: 'Create a new page in AEM', inputSchema: { type: 'object', properties: { parentPath: { type: 'string', description: 'Parent path where to create the page' }, pageName: { type: 'string', description: 'Name of the new page' }, pageTitle: { type: 'string', description: 'Title of the new page' }, template: { type: 'string', description: 'Template path for the page' }, 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: ['parentPath', 'pageName', 'pageTitle', 'template'] } },
  • src/index.ts:359-360 (registration)
    Registration of the tool handler in the CallToolRequest switch statement.
    case 'aem_create_page': return await this.aemTools.createPage(args);
  • Helper function in AEMClient that performs the actual HTTP POST request to AEM's /bin/wcmcommand endpoint to create the page.
    async createPage(config: AEMConfig, parentPath: string, pageName: string, pageTitle: string, template: string): Promise<any> { const baseUrl = this.getBaseUrl(config); const authHeader = this.getAuthHeader(config); const formData = new FormData(); formData.append('cmd', 'createPage'); formData.append('parentPath', parentPath); formData.append('title', pageTitle); formData.append('label', pageName); formData.append('template', template); try { const response = await this.axiosInstance.post( `${baseUrl}/bin/wcmcommand`, formData, { headers: { 'Authorization': authHeader, ...formData.getHeaders(), }, } ); if (response.status === 200 || response.status === 201) { return { success: true, message: `Page created successfully at ${parentPath}/${pageName}`, path: `${parentPath}/${pageName}`, }; } else { return { success: false, message: `Page creation failed: HTTP ${response.status}`, response: response.data, }; } } catch (error) { throw new Error(`Page creation failed: ${error instanceof Error ? error.message : 'Unknown error'}`); } }

Other Tools

Related 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