Skip to main content
Glama

bulkUpdateComponents

Update multiple Adobe Experience Manager components simultaneously with built-in validation and rollback capabilities to maintain system integrity during batch operations.

Instructions

Update multiple components in a single operation with validation and rollback support

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
updatesYes
validateFirstNo
continueOnErrorNo

Implementation Reference

  • Primary handler implementation for the bulkUpdateComponents tool. Handles validation phase (optional), performs sequential updates via updateComponent method, supports continueOnError, and returns comprehensive results with per-component status.
    async bulkUpdateComponents(request: BulkUpdateComponentsRequest): Promise<BulkUpdateResponse> {
      return safeExecute<BulkUpdateResponse>(async () => {
        const { updates, validateFirst = true, continueOnError = false } = request;
        
        if (!Array.isArray(updates) || updates.length === 0) {
          throw createAEMError(
            AEM_ERROR_CODES.INVALID_PARAMETERS, 
            'Updates array is required and cannot be empty'
          );
        }
    
        const results: Array<{
          componentPath: string;
          success: boolean;
          result?: unknown;
          error?: string;
          phase: string;
        }> = [];
    
        // Validation phase if requested
        if (validateFirst) {
          for (const update of updates) {
            try {
              await this.httpClient.get(`${update.componentPath}.json`);
            } catch (error: any) {
              if (error.response?.status === 404) {
                results.push({
                  componentPath: update.componentPath,
                  success: false,
                  error: `Component not found: ${update.componentPath}`,
                  phase: 'validation'
                });
                
                if (!continueOnError) {
                  return createSuccessResponse({
                    success: false,
                    message: 'Bulk update failed during validation phase',
                    results,
                    totalUpdates: updates.length,
                    successfulUpdates: 0
                  }, 'bulkUpdateComponents') as BulkUpdateResponse;
                }
              }
            }
          }
        }
    
        // Update phase
        let successCount = 0;
        for (const update of updates) {
          try {
            const result = await this.updateComponent({
              componentPath: update.componentPath,
              properties: update.properties
            });
            
            results.push({
              componentPath: update.componentPath,
              success: true,
              result: result,
              phase: 'update'
            });
            successCount++;
          } catch (error: any) {
            results.push({
              componentPath: update.componentPath,
              success: false,
              error: error.message,
              phase: 'update'
            });
            
            if (!continueOnError) {
              break;
            }
          }
        }
    
        return createSuccessResponse({
          success: successCount === updates.length,
          message: `Bulk update completed: ${successCount}/${updates.length} successful`,
          results,
          totalUpdates: updates.length,
          successfulUpdates: successCount,
          failedUpdates: updates.length - successCount
        }, 'bulkUpdateComponents') as BulkUpdateResponse;
      }, 'bulkUpdateComponents');
    }
  • JSON Schema definition and registration of the bulkUpdateComponents tool in the MCP server tools list, used for listTools request.
    {
      name: 'bulkUpdateComponents',
      description: 'Update multiple components in a single operation with validation and rollback support',
      inputSchema: {
        type: 'object',
        properties: {
          updates: {
            type: 'array',
            items: {
              type: 'object',
              properties: {
                componentPath: { type: 'string' },
                properties: { type: 'object' }
              },
              required: ['componentPath', 'properties']
            }
          },
          validateFirst: { type: 'boolean' },
          continueOnError: { type: 'boolean' }
        },
        required: ['updates'],
      },
    },
  • MCP server CallToolRequestSchema handler registration that invokes the bulkUpdateComponents method on the AEMConnector instance.
    case 'bulkUpdateComponents': {
      const result = await aemConnector.bulkUpdateComponents(args);
      return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
    }
  • Delegation handler in AEMConnector class that forwards bulkUpdateComponents calls to the ComponentOperations module.
    async bulkUpdateComponents(request: any) {
      return this.componentOps.bulkUpdateComponents(request);
    }
  • Tool metadata listing in MCPRequestHandler's getAvailableMethods, providing description and parameters for bulkUpdateComponents.
        { name: 'bulkUpdateComponents', description: 'Update multiple components in a single operation with validation and rollback support', parameters: ['updates', 'validateFirst', 'continueOnError'] },
        { name: 'startWorkflow', description: 'Start a new workflow instance', parameters: ['model', 'payloadPath', 'title', 'comment'] },
        { name: 'listActiveWorkflows', description: 'List all currently running workflow instances', parameters: ['limit'] },
        { name: 'completeWorkflowStep', description: 'Complete a workflow step', parameters: ['workflowId', 'stepName', 'comment'] },
        { name: 'cancelWorkflow', description: 'Cancel a workflow instance', parameters: ['workflowId', 'reason'] },
        { name: 'suspendWorkflow', description: 'Suspend a workflow instance', parameters: ['workflowId', 'reason'] },
        { name: 'resumeWorkflow', description: 'Resume a suspended workflow instance', parameters: ['workflowId'] },
        { name: 'getWorkflowModels', description: 'Get all available workflow models', parameters: [] },
        { name: 'getVersionHistory', description: 'Get version history for a content path', parameters: ['path'] },
        { name: 'createVersion', description: 'Create a new version of content', parameters: ['path', 'label', 'comment'] },
        { name: 'restoreVersion', description: 'Restore content to a specific version', parameters: ['path', 'versionName'] },
        { name: 'compareVersions', description: 'Compare two versions of content', parameters: ['path', 'version1', 'version2'] },
        { name: 'deleteVersion', description: 'Delete a specific version', parameters: ['path', 'versionName'] },
      ];
    }
Behavior4/5

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

With no annotations provided, the description carries the full burden and adds valuable behavioral context: 'with validation and rollback support' discloses safety features (validation prevents errors, rollback enables recovery), which is crucial for a mutation tool. It doesn't detail permissions, rate limits, or response format, but the added safety info is significant.

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 that front-loads the core purpose ('Update multiple components in a single operation') and adds key behavioral traits ('with validation and rollback support'). Every word earns its place with no redundancy or fluff.

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

Completeness3/5

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

For a mutation tool with 3 parameters, 0% schema coverage, no annotations, and no output schema, the description is incomplete. It covers purpose and some safety behaviors but misses parameter explanations, error handling details, and output expectations. It's minimally adequate but has clear gaps given the complexity.

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 fails to do so. It mentions 'validation' and 'rollback' which loosely relate to 'validateFirst' and 'continueOnError', but doesn't explain the three parameters (updates, validateFirst, continueOnError) or their semantics, leaving them undocumented. This is inadequate given the coverage gap.

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 tool's purpose: 'Update multiple components in a single operation' specifies the verb (update) and resource (components), with 'multiple' and 'single operation' distinguishing it from the sibling 'updateComponent'. However, it doesn't explicitly contrast with all potential alternatives like batch operations in other tools.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage when needing to update multiple components at once, as opposed to the sibling 'updateComponent' for single updates. It doesn't provide explicit when-not-to-use guidance, prerequisites, or comparisons to other bulk operations like 'bulkUpdateAssets' if they existed, leaving some context gaps.

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