bulkUpdateComponents
Update multiple Adobe Experience Manager components in bulk with validation, rollback, and error-handling options using the AEM MCP Server.
Instructions
Update multiple components in a single operation with validation and rollback support
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| continueOnError | No | ||
| updates | Yes | ||
| validateFirst | No |
Implementation Reference
- Core handler implementation for bulkUpdateComponents tool. Performs optional pre-validation of components, sequential updates using the updateComponent method, supports continueOnError flag, aggregates results with success/failure stats.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'); }
- src/mcp-server.ts:416-437 (registration)MCP tool registration for bulkUpdateComponents, including full input schema definition for validation.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'], }, },
- src/mcp-server.ts:755-758 (handler)Dispatch handler in MCP server that invokes aemConnector.bulkUpdateComponents on tool call.case 'bulkUpdateComponents': { const result = await aemConnector.bulkUpdateComponents(args); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; }
- src/interfaces/index.ts:271-275 (schema)TypeScript interface defining the input structure for BulkUpdateComponentsRequest used for type safety and validation.export interface BulkUpdateComponentsRequest { updates: Array<{ componentPath: string; properties: Record<string, unknown>; }>;
- src/mcp-handler.ts:83-84 (handler)Handler dispatch in MCPRequestHandler class that delegates to AEMConnector.case 'bulkUpdateComponents': return await this.aemConnector.bulkUpdateComponents(params);