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'] },
Behavior2/5

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

With no annotations provided, the description carries full burden but lacks behavioral details. It implies a mutation ('Update'), but doesn't disclose permissions needed, whether changes are reversible, side effects (e.g., versioning, workflows triggered), or error handling. For a mutation tool with zero annotation coverage, this is a significant gap in transparency.

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 a single, efficient sentence with zero waste. It's front-loaded with the core action and resource, making it easy to parse quickly. Every word contributes directly to stating the tool's purpose.

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

Completeness2/5

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

Given a mutation tool with 4 parameters, 0% schema coverage, no annotations, and no output schema, the description is incomplete. It doesn't cover parameter meanings, behavioral traits, usage context, or return values. For this complexity level, the description should provide more guidance to be adequately helpful.

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?

Schema description coverage is 0%, so the description must compensate but adds no parameter information. It doesn't explain what 'assetPath' is, what 'metadata' object should contain, how 'fileContent' and 'mimeType' interact, or which parameters are optional. With 4 parameters and low schema coverage, the description fails to provide needed semantics.

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 verb ('Update') and resource ('an existing asset in AEM DAM'), making the purpose unambiguous. It distinguishes from siblings like 'uploadAsset' (creates new) and 'deleteAsset' (removes), but doesn't explicitly differentiate from other update tools like 'updateComponent' or 'updateImagePath' beyond the asset focus.

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. It doesn't mention prerequisites (e.g., asset must exist), when to use 'uploadAsset' for new assets instead, or how it differs from 'updateComponent' or 'updateImagePath' for related operations. The description only states what it does, not when to choose it.

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