document_edit
Edit Inkscape document structure headlessly: manage layers, gradients, pages, node paths, fonts, and canvas geometry. Automate SVG changes without opening the GUI.
Instructions
Document structure. area: layers | gradient | pages | nodes | fonts | canvas. Layers, gradients (linear/radial/MESH), multi-page, node-level path editing, font enumeration, and canvas geometry (info, fit-to-drawing, resize, set-viewbox, set-units). Inkscape's 24 layer-* actions are all window-scoped, so this is the only headless route.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | X coordinate. | |
| y | No | Y coordinate. | |
| area | No | Which sub-area of the document to work on. | |
| cols | No | Number of columns. | |
| rows | No | Number of rows. | |
| index | No | Zero-based index. | |
| label | No | Human-readable label. | |
| limit | No | Maximum number of results. | |
| query | No | Search string. | |
| ratio | No | Position along a segment, 0..1. | |
| stops | No | Gradient stops. | |
| units | No | px | pt | pc | mm | cm | in. | |
| width | No | Width. | |
| colors | No | List of colours. | |
| height | No | Height. | |
| locked | No | Whether the layer is locked. | |
| margin | No | Extra space added around the result. | |
| new_id | No | id to give the object this tool creates. | |
| opacity | No | Opacity, 0..1. | |
| visible | No | Whether the layer is visible. | |
| apply_to | No | fill or stroke. | |
| layer_id | No | Layer id to act on. | |
| position | No | Position in the stacking order. | |
| object_id | No | A single SVG element id. | |
| operation | No | Which operation to run. See the tool summary for valid values. | |
| input_path | No | Source file to read. | |
| object_ids | No | SVG element ids to act on. Explicit ids always win over select_all. | |
| output_path | No | File to write. Overwritten if it exists. |