Skip to main content
Glama

deletePage

Remove a specific page from Adobe Experience Manager by specifying the page path, with an optional force flag to bypass restrictions. Streamlines page deletion using REST/JSON-RPC APIs.

Instructions

Delete a page from AEM

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceNo
pagePathYes

Implementation Reference

  • Core implementation of deletePage tool. Performs HTTP DELETE on the page path with fallback mechanisms using WCM command and Sling POST delete operations. Includes validation and error handling.
    async deletePage(request) { return safeExecute(async () => { const { pagePath, force = false } = request; if (!isValidContentPath(pagePath)) { throw createAEMError(AEM_ERROR_CODES.INVALID_PARAMETERS, `Invalid page path: ${String(pagePath)}`, { pagePath }); } let deleted = false; try { await this.httpClient.delete(pagePath); deleted = true; } catch (err) { if (err.response && err.response.status === 405) { try { await this.httpClient.post('/bin/wcmcommand', { cmd: 'deletePage', path: pagePath, force: force.toString(), }); deleted = true; } catch (postErr) { try { await this.httpClient.post(pagePath, { ':operation': 'delete' }); deleted = true; } catch (slingErr) { this.logger.error('Sling POST delete failed', { error: slingErr.response?.status, data: slingErr.response?.data }); throw slingErr; } } } else { this.logger.error('DELETE failed', { status: err.response?.status, data: err.response?.data }); throw err; } } return createSuccessResponse({ success: deleted, deletedPath: pagePath, timestamp: new Date().toISOString(), }, 'deletePage'); }, 'deletePage'); }
  • Tool registration in the MCP server's tools list, including name, description, and input schema for listTools request.
    { name: 'deletePage', description: 'Delete a page from AEM', inputSchema: { type: 'object', properties: { pagePath: { type: 'string' }, force: { type: 'boolean' }, }, required: ['pagePath'], }, },
  • MCP CallToolRequestSchema handler dispatch for deletePage, forwarding arguments to AEMConnector.deletePage.
    case 'deletePage': { const result = await aemConnector.deletePage(args); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
  • TypeScript interface defining the input parameters for deletePage request.
    export interface DeletePageRequest { pagePath: string; force?: boolean; }
  • Delegation handler in AEMConnector that routes deletePage calls to the PageOperations module.
    async deletePage(request) { return this.pageOps.deletePage(request);

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