Graphite: inspect the active document
graphite_get_documentRetrieve the active document's id, name, layers, and open documents to verify SVG insert success after a timeout or confirm content before export.
Instructions
Return the active document's id and name, all its layers (id, name, kind, visibility, parent) and the list of open documents. Read-only. Use it to verify that a graphite_insert_svg reported as BRIDGE_TIMEOUT did or did not land (look for the layer_id in layer_ids) before deciding to retry, and to confirm a document is not empty before exporting. Fails with NO_ACTIVE_DOCUMENT when nothing is open.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Tab name of the active document, when known. | |
| layers | Yes | Per-layer details: display name, node kind, visibility and parent (null = document root). | |
| layer_ids | Yes | Every layer id in the active document (decimal strings), nested groups included. | |
| document_id | Yes | Graphite DocumentId of the active document, as a decimal string. | |
| layer_count | Yes | ||
| open_documents | Yes | All open documents; switch with graphite_select_document. |