Skip to main content
Glama

updateAsset

Modify existing assets in Adobe Experience Manager's Digital Asset Management system by updating metadata, file content, or MIME types to maintain accurate and current digital resources.

Instructions

Update an existing asset in AEM DAM

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
assetPathYes
metadataNo
fileContentNo
mimeTypeNo

Implementation Reference

  • Core implementation of updateAsset: performs HTTP POST to update asset metadata and/or file content in AEM DAM, with path validation, form data preparation, verification, and comprehensive error handling.
    async updateAsset(request: UpdateAssetRequest): Promise<AssetResponse> { return safeExecute<AssetResponse>(async () => { const { assetPath, metadata, fileContent, mimeType } = request; if (!isValidContentPath(assetPath)) { throw createAEMError( AEM_ERROR_CODES.INVALID_PARAMETERS, `Invalid asset path: ${String(assetPath)}`, { assetPath } ); } const formData = new URLSearchParams(); // Update file content if provided if (fileContent) { formData.append('file', fileContent); if (mimeType) { formData.append('jcr:content/jcr:mimeType', mimeType); } } // Update metadata if provided if (metadata && typeof metadata === 'object') { Object.entries(metadata).forEach(([key, value]) => { formData.append(`jcr:content/metadata/${key}`, String(value)); }); } try { const response = await this.httpClient.post(assetPath, formData, { headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, }); // Verify the update const verificationResponse = await this.httpClient.get(`${assetPath}.json`); return createSuccessResponse({ success: true, assetPath, fileName: assetPath.split('/').pop() || 'unknown', updatedMetadata: metadata, updateResponse: response.data, assetData: verificationResponse.data, timestamp: new Date().toISOString(), }, 'updateAsset') as AssetResponse; } catch (error: any) { throw handleAEMHttpError(error, 'updateAsset'); } }, 'updateAsset'); }
  • MCP tool schema definition specifying input parameters for updateAsset: assetPath (required), metadata, fileContent, mimeType.
    name: 'updateAsset', description: 'Update an existing asset in AEM DAM', inputSchema: { type: 'object', properties: { assetPath: { type: 'string' }, metadata: { type: 'object' }, fileContent: { type: 'string' }, mimeType: { type: 'string' }, }, required: ['assetPath'], }, },
  • MCP server tool dispatch/registration: handles 'updateAsset' tool calls by invoking aemConnector.updateAsset and formatting response.
    case 'updateAsset': { const result = await aemConnector.updateAsset(args); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
  • Delegation helper in AEMConnector: forwards updateAsset calls to the AssetOperations module.
    async updateAsset(request: any) { return this.assetOps.updateAsset(request);
  • Alternative schema listing in MCP handler's available methods.
    { name: 'updateAsset', description: 'Update an existing asset in AEM DAM', parameters: ['assetPath', 'metadata', 'fileContent', 'mimeType'] }, { name: 'deleteAsset', description: 'Delete an asset from AEM DAM', parameters: ['assetPath', 'force'] },

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