photoshop_get_state
Retrieve a read-only snapshot of the active Photoshop document, layer, and selection. Use before operations that require an active target or after an error to regain context.
Instructions
Return a cheap read-only snapshot of Photoshop session state (active document, layer, selection).
Use when: before any tool that needs an active document/layer, or after an error to recover context. Do NOT use when: you only need a visual preview — use photoshop_get_preview instead.
Returns: JSON with hasDocument, document.id/name/dimensions/colorMode, activeLayer kind/name, hasSelection. Capture document.id and pass it as document_id on later mutating calls. Preconditions: none (safe on empty session). Side effects: none.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| document_id | No | Optional Photoshop document id from photoshop_get_state / photoshop_list_documents. When set, the tool activates that document before running so a UI tab switch cannot retarget the edit. |