photoshop_set_layer_locked
Locks or unlocks the active layer to block or allow edits. Use when the user requests locking or unlocking the current layer.
Instructions
Set the all-lock flag on the active layer. locked: true blocks further edits to that layer; false clears the lock.
Use when: the user asks to lock or unlock the current layer. Do NOT use when: the layer should only be hidden — use photoshop_set_layer_visibility. Do NOT use when: a different layer is the target — use photoshop_select_layer_by_name first.
Returns: confirmation of the lock state. Preconditions: active document and active layer. Side effects: sets layer.allLocked. The same boolean is idempotent. Reversible with photoshop_undo or by calling again with the opposite value.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"locked": "<locked>",
"document_id": "<document_id>"
},
"name": "photoshop_set_layer_locked"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| locked | Yes | Whether the layer should be locked | |
| document_id | Yes | Photoshop document id from photoshop_get_state / photoshop_list_documents. Send null or 0 to use the active document. A positive number activates that document before the tool runs. When no document is open, a stale id does not block the call. |