deleteAsset
Remove assets from Adobe Experience Manager's Digital Asset Management system by specifying the asset path, with an optional force parameter for immediate deletion.
Instructions
Delete an asset from AEM DAM
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| assetPath | Yes | ||
| force | No |
Implementation Reference
- Core handler function that validates the asset path, performs HTTP DELETE request to AEM DAM, and returns success response.async deleteAsset(request: DeleteAssetRequest): Promise<DeleteResponse> { return safeExecute<DeleteResponse>(async () => { const { assetPath, force = false } = request; if (!isValidContentPath(assetPath)) { throw createAEMError( AEM_ERROR_CODES.INVALID_PARAMETERS, `Invalid asset path: ${String(assetPath)}`, { assetPath } ); } await this.httpClient.delete(assetPath); return createSuccessResponse({ success: true, deletedPath: assetPath, force, timestamp: new Date().toISOString(), }, 'deleteAsset') as DeleteResponse; }, 'deleteAsset'); }
- src/mcp-server.ts:387-397 (registration)Tool registration in the MCP tools array, including name, description, and input schema.name: 'deleteAsset', description: 'Delete an asset from AEM DAM', inputSchema: { type: 'object', properties: { assetPath: { type: 'string' }, force: { type: 'boolean' }, }, required: ['assetPath'], }, },
- src/mcp-server.ts:741-744 (handler)MCP server request handler that delegates to AEMConnector.deleteAsset and formats response for MCP protocol.case 'deleteAsset': { const result = await aemConnector.deleteAsset(args); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- src/interfaces/index.ts:295-298 (schema)TypeScript interface defining the input parameters for deleteAsset.export interface DeleteAssetRequest { assetPath: string; force?: boolean; }
- src/interfaces/index.ts:350-356 (schema)TypeScript interface defining the response structure for delete operations, used by deleteAsset.export interface DeleteResponse extends BaseResponse { data: { success: boolean; deletedPath: string; timestamp: string; }; }