Skip to main content
Glama

aem_create_page

Create new pages in Adobe Experience Manager by specifying parent path, name, title, and template for structured content management.

Instructions

Create a new page in AEM

Input Schema

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

Implementation Reference

  • Primary MCP tool handler for 'aem_create_page': validates inputs, calls AEMClient.createPage, formats and returns MCP-compatible 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}`, }, ], }; }
  • Core implementation performing HTTP POST to AEM /bin/wcmcommand to create the page with required form parameters.
    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'}`); } }
  • Input schema defining parameters, types, descriptions, defaults, and required fields for the 'aem_create_page' tool.
    { 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)
    Tool dispatcher registration: routes 'aem_create_page' tool calls to the AEMTools.createPage handler.
    case 'aem_create_page': return await this.aemTools.createPage(args);

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