Every open_drawio_* tool returns the app.diagrams.net URL and opens it in the default browser; DRAWIO_BROWSER=off only returns it (headless agents, CI, SSH sessions — #94). The result ends, like create_diagram's, with a note that the user sees the diagram in draw.io (with DRAWIO_BROWSER=off: opens it through the URL) and that a reply of at most two sentences besides the URL will do.
Opens the draw.io editor with XML content.
Mechanical slips are repaired, icon names are resolved, the model is normalized, waypoints a pixel or two off a fixed connection point are snapped onto its line and labels outside the shape get labelPerimeter=1 on every call (see create_diagram in docs/app-server-tools.md) — the layout itself never touches the cell hierarchy.
Parameters:
content(required): Draw.io XML contentlightbox(optional): Open in read-only lightbox mode (default: false)dark(optional): Dark mode - "true" or "false" (default: false)postLayout(optional):"elk"runs a server-side ELK re-layout before opening — places the vertices and routes the edges, via the samedrawio-elkElkLayoutbridge the editor and the app server use (loaded from the CDN on first use, cached per user;DRAWIO_ELK_URLoverrides the source). Use for flowcharts and other directional/hierarchical diagrams. Node sizes are never changed, only positions.direction(optional): flow direction forpostLayout—"vertical"(default) or"horizontal".routing(optional):"libavoid"runs a server-side obstacle-avoiding orthogonal edge-routing pass before opening — keeps vertex positions, reroutes connectors around shapes. Use for hand-placed diagrams where edges would otherwise cross boxes. Alternative topostLayout, not a companion.
Example XML:
<mxGraphModel adaptiveColors="auto">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="2" value="Hello" style="rounded=1;" vertex="1" parent="1">
<mxGeometry x="100" y="100" width="120" height="60" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>Opens the draw.io editor with CSV data that gets converted to a diagram.
Parameters:
content(required): CSV contentlightbox(optional): Open in read-only lightbox mode (default: false)dark(optional): Dark mode - "true" or "false" (default: false)
%column% placeholders work in style attributes too (like fillColor=%color%): checked on 2026-11-18 in app.diagrams.net with links encoded as the tool server encodes them. "URI malformed" is what draw.io's decompression (decodeURIComponent after inflating) throws for CSV that was compressed without being URL-encoded first; the tool server encodes it first.
Opens the draw.io editor with a Mermaid.js diagram definition.
Parameters:
content(required): Mermaid.js syntaxlightbox(optional): Open in read-only lightbox mode (default: false)dark(optional): Dark mode - "true" or "false" (default: false)postLayout(optional):"elk"switches a Mermaid flowchart to the layered ELK layout. Nothing is computed server-side — it writes theconfig: { layout: elk }frontmatter (shared/mermaid-elk.js) and draw.io applies the layout while converting the diagram. Ignored for non-flowchart types, which lay themselves out.
Searches the draw.io shape library by keywords (same tool as the app server's search_shapes, sharing shared/shape-search.js and shared/icon-search.js). The ~4.6 MB index is not bundled in the npm package — it is fetched from the CDN on first use through the same ETag-revalidated per-user disk cache as the ELK bundle (src/cdn-cache.js: 20 s timeout, 304 on a warm start, the last cached copy when offline; DRAWIO_SHAPE_INDEX_URL overrides with another URL or a local path), or read locally in an in-repo checkout. Results are supplemented live from the draw.io icon service when the local index has no strong match (overridable via DRAWIO_ICON_SERVICE_URL, set to off to disable).
Parameters:
query(required): Space-separated search keywords (e.g.aws lambda,cisco router,kubernetes pod)limit(optional): Maximum results to return (default: 10, max: 50)
Output: Array of matching shapes with {style, w, h, title} — style strings can be used directly in mxCell style attributes. Use only for diagrams needing industry-specific icons; skip for standard flowcharts, UML, ERD, and org charts.
Page-level access to a local multi-page .drawio file, so a large file doesn't need to be loaded whole into context just to inspect or edit one page.
list_pages:{ path: string }→[{index, id, name, approxSizeBytes}]for every page, without decompressing page contentget_page:{ path: string, page: string }(pageis a zero-based index, exact page name, or page id) → rawmxGraphModelXML for that pageset_page:{ path: string, page: string, content: string }→ replaces that page's content with newmxGraphModelXML (a single<mxGraphModel>element, no<diagram>tags), leaving all other pages untouched
These are the only tools that read/write local files by path; paths must end in .drawio or .xml. Diagrams saved to Google Drive, OneDrive, Dropbox, GitHub or GitLab are out of reach: the server can't read them, and a draw.io link only opens a new diagram, never a stored file. The tool server README documents editing them through Edit Diagram in the open draw.io tab (#94).
Use case: Call list_pages first on any large multi-page file to find the page you need by name/index/id, then get_page/set_page to work on just that page instead of the whole file.
- Input:
{ format: "xml" | "mermaid" } - Output:
shared/xml-reference.mdorshared/mermaid-reference.md, verbatim - Why a tool: the full references made the tool descriptions too long — appended,
open_drawio_xml/open_drawio_mermaidwere ~35k / 14k characters (the XML one ~16k tokens), and VS Code Copilot's tool search, which embeds descriptions in batches, rejected the whole batch, other servers' tools included (#76).open_drawio_xmlnow inlines the condensedshared/xml-essentials.mdand points here only for layers, tags, metadata, tables, cross-functional grids and dark-mode colors;open_drawio_mermaidasks for the Mermaid reference before the first Mermaid diagram.test/tools.test.jscaps every description at 2048 characters
| Need | Use | Reliability |
|---|---|---|
| Flowchart, sequence, ER diagram | open_drawio_mermaid |
High |
| Custom styling, precise positioning | open_drawio_xml |
High |
| Org chart from data | open_drawio_csv |
Medium |
Default to Mermaid — it handles most diagram types reliably.
- Default to Mermaid: It handles flowcharts, sequences, ER diagrams, Gantt charts, and more — all reliably
- Use XML for precision: When you need exact positioning, custom colors, or complex layouts
- Avoid CSV for critical diagrams: CSV processing can fail; prefer Mermaid for org charts when possible
- Validate syntax: Ensure Mermaid/CSV/XML syntax is correct before sending
- Return the URL to users: Always provide the generated URL so users can open the diagram in their browser
| Error | Cause | Solution |
|---|---|---|
| XML comments in output | <!-- --> comments found in generated XML |
Remove all XML comments — they are strictly forbidden |
| "URI malformed" | CSV (or Mermaid) compressed into a #create= link without being URL-encoded first, so draw.io's decodeURIComponent fails on a % |
URL-encode before compressing, as compressData does |
| "Service nicht verfügbar" | draw.io CSV server unavailable | Retry later or use Mermaid instead |
| Blank diagram | Invalid Mermaid/XML syntax | Check syntax, ensure proper escaping |
| Diagram doesn't match expected | Mermaid version differences | Simplify syntax, avoid edge cases |