Inkscape Live
inkscape_liveDrive the open Inkscape document live over D-Bus to edit SVG, run actions, apply effects and manage selections in place without recreating the file.
Instructions
Drive the RUNNING Inkscape GUI — the user's already-open document — live over D-Bus.
Work on the open document IN PLACE; do not recreate it. Prefer Inkscape's own
live tools over hand-writing SVG: use apply_action for actions (it finds the
app, window or document scope itself, so undo/redo work too) and
inkscape_extension run_live WITH NO PARAMS for filters/effects like drop
shadow and blur — select the target first, then call it; that is the only
run_live mode that sees the live document and selection. (Passing params
renders on an empty canvas and suits generator extensions only.)
(The inkscape_gradient tool is headless/file-based — not for the live doc.)
Use edit_xml (raw-SVG set_attr/append/insert_*/remove/replace, targeted by
XPath, multi-node capable) for everything else, e.g. editing gradients on the
live doc — it is the reliable persisting edit path. execute_inkex does NOT
persist mutations; don't use it to edit.
Every op acts on Inkscape's ACTIVE document and reports which one that was in
data.active_document. window_id cannot route — Inkscape 1.4 has no
focus-window action — so it is an assertion: leave it at 0 to accept the active
document, or pass a window number to have the call REFUSE when more than one
document is open and the target is therefore ambiguous. Check
active_document before any destructive edit; auto-save writes to disk.
Operations: ping, get_document_xml, get_selection, set_selection, insert_svg, delete_selected, apply_action, list_actions, open_file, save_snapshot, edit_xml, path_edit, path_offset, inspect_selection/layers/defs/view/pages/element, execute_inkex, rasterize.
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": {
"operation": "<operation>"
},
"name": "inkscape_live"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | No | ||
| payload | No | ||
| operation | Yes | ||
| window_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||