get_drawing_guide | Return the drawing guide: XML format, layout, edge routing, style and editing rules. start_session already returns it; call this only if the guide is | |
get_shape_library | Get the style syntax and shape names of a draw.io icon library. Call this BEFORE drawing with cloud, network or other icon shapes, and use the exact n | |
start_session | Start a new diagram session, or continue a saved one with session_id, and open the browser for real-time preview. Call it once per conversation: later | |
list_saved_diagrams | List the diagrams saved by earlier sessions (auto-save files), newest first, with their pages. Continue one with start_session session_id=<id>; the fi | |
create_new_diagram | Create a NEW diagram, REPLACING the whole document: every page and any unsaved user changes (the previous state stays in History). To add a tab use ad | |
load_diagram | Load a .drawio diagram into the current session, REPLACING the entire diagram (all pages). To change an existing file, load it here, edit with edit_di | |
edit_diagram | Edit a specific page in the current diagram by ID-based operations (update/add/delete cells).
All-or-nothing: if any operation fails, nothing is appl | |
get_diagram | Get the current diagram XML (fetches latest from browser, including user's manual edits). Call this when you don't know the current diagram content (c | |
get_selection | Return the cells the user has selected in the preview: their ids and labels, for edges the source and target ids, for shapes the position and size, an | |
screenshot_diagram | Render the diagram in the preview and return it as a PNG image, so you can see your own result. Call this once after drawing or heavily editing a comp | |
export_diagram | Export the current diagram to a file. Supports .drawio (XML), .png, .svg, and .drawio.svg (an SVG with the diagram embedded, which draw.io and load_di | |
list_pages | List every page (tab) in the current diagram. Returns each page's id, name, 0-based index, and cell count. Use this to discover what pages exist befor | |
add_page | Append a new page (tab) to the current diagram WITHOUT touching existing pages or unsaved user changes. Use this when the user wants "another diagram | |
rename_page | Rename an existing page (tab). At least one of page_id / page_name / page_index is required to identify which page to rename. The new_name becomes the | |
delete_page | Delete a page (tab) from the current diagram. At least one of page_id / page_name / page_index is required. Refuses to delete the last remaining page | |
restore_version | Undo: put an earlier version of the diagram from History back on the canvas (the current canvas is kept in History, so this can be undone too). Use it | |