Skip to main content
Glama

deletePage

Remove pages from Adobe Experience Manager by specifying the page path, with an optional force parameter for immediate deletion.

Instructions

Delete a page from AEM

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pagePathYes
forceNo

Implementation Reference

  • Core handler implementation for deletePage tool. Performs page deletion using primary HTTP DELETE method with fallbacks to /bin/wcmcommand and Sling POST. Includes path validation and comprehensive error handling.
    async deletePage(request: DeletePageRequest): Promise<DeleteResponse> {
      return safeExecute<DeleteResponse>(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: any) {
          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: any) {
              try {
                await this.httpClient.post(pagePath, { ':operation': 'delete' });
                deleted = true;
              } catch (slingErr: any) {
                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') as DeleteResponse;
      }, 'deletePage');
    }
  • MCP tool registration where the list of tools including deletePage is provided via ListToolsRequestSchema handler.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return { tools };
    });
  • Tool schema definition specifying input parameters pagePath (required) and force (optional boolean).
    {
      name: 'deletePage',
      description: 'Delete a page from AEM',
      inputSchema: {
        type: 'object',
        properties: {
          pagePath: { type: 'string' },
          force: { type: 'boolean' },
        },
        required: ['pagePath'],
      },
    },
  • MCP server dispatch handler for deletePage tool call, delegating to AEMConnector.deletePage.
    case 'deletePage': {
      const result = await aemConnector.deletePage(args);
      return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
    }
  • Delegation helper in AEMConnector that forwards deletePage request to PageOperations module.
    async deletePage(request: any) {
      return this.pageOps.deletePage(request);
    }
Behavior1/5

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

The description lacks any behavioral disclosure beyond the basic action. With no annotations provided, it fails to address critical aspects like permissions required, whether deletion is permanent or reversible, impact on linked content, or error conditions. For a destructive operation, this is a significant gap.

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 maximally concise with a single, direct sentence that states the core functionality without unnecessary words. Every element ('Delete', 'a page', 'from AEM') contributes essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a destructive tool with 2 parameters, 0% schema coverage, no annotations, and no output schema, the description is completely inadequate. It doesn't address safety concerns, parameter meanings, expected outcomes, or error handling that are crucial for proper tool invocation.

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

Parameters2/5

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

With 0% schema description coverage for both parameters, the description provides no information about what 'pagePath' should contain or what the 'force' boolean does. It doesn't explain path format expectations, what 'force' overrides, or any parameter constraints beyond what's in the bare schema.

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 ('Delete') and resource ('a page from AEM'), making the purpose immediately understandable. It distinguishes from siblings like 'deleteAsset' or 'deleteComponent' by specifying 'page', but doesn't explicitly contrast with similar tools like 'deactivatePage' or 'unpublishContent'.

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?

No guidance is provided on when to use this tool versus alternatives. With siblings like 'deactivatePage', 'unpublishContent', and 'deleteVersion', there's no indication of prerequisites, consequences, or appropriate contexts for deletion versus other page-modification operations.

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/indrasishbanerjee/aem-mcp-server'

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