batch_apply_develop_operations
Apply multiple Lightroom Classic develop operations in sequence to automate photo editing workflows. Run presets, settings, parameters, or groups in a single batch process with configurable error handling.
Instructions
Run multiple preset/settings/parameter/group operations in sequence.
Each operation is a dict with one of: preset, settings, parameter, or group. Examples: [{"preset": "portrait_clean"}, {"settings": {"Exposure": 0.3}}, {"parameter": "Contrast", "value": 20}] Operations run in order. Use stop_on_error=True to halt on first failure. default_local_ids applies to all operations unless overridden per-operation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| operations | Yes | ||
| default_local_ids | No | ||
| strict | No | ||
| clamp | No | ||
| stop_on_error | No |
Implementation Reference
- The implementation of the batch_apply_develop_operations tool, which iterates through a list of operations, resolves them using _resolve_batch_operation, and applies them sequentially via _apply_validated_settings.
async def batch_apply_develop_operations( operations: list[dict[str, Any]], default_local_ids: list[int] | None = None, strict: bool = False, clamp: bool = True, stop_on_error: bool = False, ) -> dict[str, Any]: """Run multiple preset/settings/parameter/group operations in sequence. Each operation is a dict with one of: preset, settings, parameter, or group. Examples: [{"preset": "portrait_clean"}, {"settings": {"Exposure": 0.3}}, {"parameter": "Contrast", "value": 20}] Operations run in order. Use stop_on_error=True to halt on first failure. default_local_ids applies to all operations unless overridden per-operation. """ if not isinstance(operations, list) or not operations: raise ValueError("operations must be a non-empty list") results: list[dict[str, Any]] = [] succeeded = 0 failed = 0 for index, operation in enumerate(operations): if not isinstance(operation, dict): err = "operation must be an object" failed += 1 results.append({"index": index, "success": False, "error": err}) if stop_on_error: break continue try: mode, settings, target = _resolve_batch_operation(operation) op_local_ids = operation.get("local_ids", default_local_ids) op_history = operation.get("history_name") if op_history is not None and not isinstance(op_history, str): raise ValueError("history_name must be a string when provided") response = await _apply_validated_settings( settings, local_ids=op_local_ids, strict=strict, clamp=clamp, history_name=op_history, ) record: dict[str, Any] = { "index": index, "success": True, "mode": mode, "result": response, } if target: record["target"] = target results.append(record) succeeded += 1 except Exception as exc: failed += 1 results.append( { "index": index, "success": False, "error": str(exc), } ) if stop_on_error: break return { "requested": len(operations), "succeeded": succeeded, "failed": failed, "stop_on_error": bool(stop_on_error), "results": results, } - src/lightroom_mcp_custom/server.py:456-456 (registration)Registration of the batch_apply_develop_operations function as an MCP tool.
@mcp.tool()