Create a diagram from Mermaid, or add one to the board
add_elements_from_mermaidCreates diagram elements from a Mermaid definition. Creates a new canvas if room_id is omitted, or adds to the existing canvas if room_id is provided. Preferred over add_elements for new diagrams and large changes to existing diagrams whenever the content can be represented in Mermaid. Supports: flowchart, graph, flowchart-elk, sequenceDiagram, classDiagram, classDiagram-v2, stateDiagram, stateDiagram-v2, erDiagram, journey, gantt, pie, gitGraph, mindmap, timeline, C4Context, C4Container, C4Component, C4Dynamic, C4Deployment, sankey, sankey-beta, quadrantChart, xychart, xychart-beta, requirement, requirementDiagram, kanban, architecture, block, block-beta, packet, packet-beta, radar-beta, treemap, info. Example: "flowchart TD\n A[Start] --> B{Decision}\n B -->|Yes| C[OK]\n B -->|No| D[Cancel]"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| config | No | Optional Mermaid rendering config. flowchart.curve is handled automatically. | |
| mermaid | Yes | Mermaid diagram definition. Prefer converting compatible user requests into Mermaid instead of using add_elements. | |
| room_id | No | Room ID of an existing canvas to add to. If the user is continuing a canvas already referenced in this conversation (by room_id, or a URL like ?room=[room_id] or /gdrive?id=[room_id]), pass it here. Omit to create a new canvas. | |
| timeout | No | Room lifetime in seconds (default: 3600, max: 86400). Only used when creating new canvas |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | Canvas room URL | |
| isNew | Yes | Whether a new canvas was created | |
| room_id | No | Canvas room ID | |
| appState | Yes | Canvas app state (viewBackgroundColor, etc.) | |
| elements | Yes | All elements currently on the canvas | |
| collabUrl | Yes | Collaboration server URL for Socket.IO | |
| pendingMermaid | No | Mermaid definition pending client-side rendering |