Open document
open_documentOpen an existing SVG file into a tracked workspace document, returning a document ID for use with other tools. The original file remains unmodified.
Instructions
Open an SVG into a tracked workspace document and return its id + summary.
When to use: the entry point for working on an EXISTING file — you need the doc_id before any
other tool. To start from nothing use create_document; to adopt agent-composed SVG use
set_document_svg / insert_svg_fragment; to resync external edits use reload_document.
Key params: path may be workspace-RELATIVE (anchored to the first workspace root, NOT the
server CWD — matching save_document_as / live_sync_to_workspace) or absolute; either is
sandbox-validated and a ../-escape, an absolute path outside the workspace, or a symlink whose
target leaves the sandbox is rejected with path rejected: outside workspace.
WORKING-COPY MODEL: opening copies your source SVG byte-for-byte into a per-document workspace
as an immutable original.svg and seeds a single live WORKING COPY. The returned doc_id
addresses that copy; EVERY subsequent tool operates on it, and your ORIGINAL is NEVER mutated.
Edits are reversible (pre-edit snapshot + Operation Record); restore_snapshot rolls back.
Return shape: OpenDocumentResult — doc_id (opaque, pass to every other tool) and summary
(size, viewBox, units, counts).
Example: open_document("logo.svg")
Risk class: low (opens via working copy; original never mutated).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc_id | Yes | ||
| summary | Yes | Top-level document summary (viewBox / page / size / counts). |