Skip to content

Fix get_active_document_info to return actual layer data#49

Open
bbible3 wants to merge 1 commit intoloonghao:mainfrom
bbible3:fix/active-document-layer-reporting
Open

Fix get_active_document_info to return actual layer data#49
bbible3 wants to merge 1 commit intoloonghao:mainfrom
bbible3:fix/active-document-layer-reporting

Conversation

@bbible3
Copy link
Copy Markdown

@bbible3 bbible3 commented Mar 25, 2026

This PR fixes get_active_document_info so it returns real layer information instead of always returning empty layers and layer_sets arrays.

What changed

  • Added layer extraction from the active Photoshop document via the DOM API (doc.artLayers).
  • Added layer set extraction via doc.layerSets.
  • Kept existing Action Manager-based document metadata logic intact.
  • Excluded background layer from the returned layers list so the count matches visible/user content layers in typical workflows.

Why

The session tool get_active_document_info was reporting zero layers even when layers existed in the active document, which made layer-related diagnostics and automation unreliable.

Validation

  • Before fix: MCP response returned empty layers on a document known to contain layers.
  • After fix: MCP response correctly returned the layer list and count (validated against an active document with expected layers).

Notes

  • This change is scoped to active document info reporting only.
  • No behavior changes to document creation/editing tools.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant