Skip to main content
Glama

deleteComponent

Remove components from Adobe Experience Manager using the component path, with an optional force parameter for deletion.

Instructions

Delete a component from AEM

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
componentPathYes
forceNo

Implementation Reference

  • Core implementation of deleteComponent: performs HTTP DELETE on componentPath, falls back to POST with :operation=delete if 405, with validation and error handling.
    async deleteComponent(request: DeleteComponentRequest): Promise<DeleteResponse> { return safeExecute<DeleteResponse>(async () => { const { componentPath, force = false } = request; if (!isValidContentPath(componentPath)) { throw createAEMError( AEM_ERROR_CODES.INVALID_PARAMETERS, `Invalid component path: ${String(componentPath)}`, { componentPath } ); } let deleted = false; try { await this.httpClient.delete(componentPath); deleted = true; } catch (err: any) { if (err.response && err.response.status === 405) { try { await this.httpClient.post(componentPath, { ':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: componentPath, timestamp: new Date().toISOString(), }, 'deleteComponent') as DeleteResponse; }, 'deleteComponent'); }
  • MCP tool registration including name, description, and input schema for deleteComponent.
    name: 'deleteComponent', description: 'Delete a component from AEM', inputSchema: { type: 'object', properties: { componentPath: { type: 'string' }, force: { type: 'boolean' }, }, required: ['componentPath'], }, },
  • MCP server dispatch handler that calls aemConnector.deleteComponent on tool invocation.
    case 'deleteComponent': { const result = await aemConnector.deleteComponent(args); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
  • Wrapper in AEMConnector that delegates deleteComponent to ComponentOperations instance.
    async deleteComponent(request: any) { return this.componentOps.deleteComponent(request); }
  • TypeScript interface imports for DeleteComponentRequest and DeleteResponse used in the handler.
    CreateComponentRequest, UpdateComponentRequest, DeleteComponentRequest, ValidateComponentRequest,

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