Mermaid scope

Zindex reads two kinds of Mermaid: flowchart (or graph) and erDiagram. It converts them with the official Mermaid parser, version 12.1.0, and no model, so the same text always gives the same diagram. Every other Mermaid type is refused.

Mermaid works wherever a scene does:

The text can be up to 64 KB. If it holds fenced code blocks tagged mermaid, as a chat answer often does, the first one is the diagram. A title in front matter becomes the diagram’s title; other front matter is ignored.

What the conversion draws differently or leaves out comes back in warnings, each with a code and one line saying what happened, and doesn’t stop the save. A response lists at most 10 warnings, and the lines Zindex ignores (below) get none. Validation rules: Mermaid notes lists every code. The converted diagram is then checked like any scene: if it breaks a rule, such as more than 1,000 elements (edges included), nothing is saved and the answer is VALIDATION_FAILED. A flowchart with more than 1,000 edges gets the same answer as soon as the parser reaches the 1,001st, and its error says the scene has more than 1,000 elements without counting them.

IDs

A node’s ID is its Mermaid ID. An edge written with an ID, such as a e1@--> b, keeps it; any other edge gets an ID made from its ends, such as a--b. An ID Zindex can’t use as written (anything but letters, digits, ., _, : and -, or longer than 200 characters) becomes a readable slug with a short hash.

Flowcharts

A flowchart becomes an architecture diagram in the direction its text gives (TB, TD, BT, LR or RL; top to bottom when it gives none).

Entity-relationship diagrams

An erDiagram becomes an entityRelationship diagram, laid out left to right whatever direction the text gives.

Left out, with a warning

The diagram is saved without these, and each comes back in warnings:

MermaidWhat happensCode
A flowchart subgraphLeft out; its nodes are keptSUBGRAPH_DROPPED
An edge to or from a subgraphLeft out; connect it to a node in the subgraph to keep itCONSTRUCT_DROPPED
style, classDef, class and clickLeft out; set styles on the elements insteadSTYLE_DROPPED

Zindex doesn’t draw Mermaid subgraphs, so a flowchart that relies on them for grouping loses that grouping. To group nodes, add frames with operations after saving (Operations: createFrame).

Refused

Nothing is saved, and the answer names the problem:

SentAnswer
Any other Mermaid type, such as sequenceDiagram, classDiagram, stateDiagram or gantt422 UNSUPPORTED_DIAGRAM_TYPE
Text with a syntax error422 PARSE_ERROR, with line, and column counted from 0. Zindex never repairs the text
Text over 64 KB413 INPUT_TOO_LARGE. Over MCP, the tool’s input schema refuses it first
Text the parser takes more than 15 seconds on, or stops on422 IMPORT_TIMEOUT or IMPORT_FAILED; send shorter text, or a scene
Empty text; both scene and mermaid, or neither; mermaid with ops or restoreRevision400 INVALID_REQUEST

Reading as Mermaid

A read with view=mermaid writes the diagram as Mermaid you can edit and send back, with its title in front matter. Entity-relationship diagrams come back as an erDiagram, every other family as a flowchart. Sequence diagrams have no Mermaid view: the read answers VIEW_UNAVAILABLE. The read lists what the text leaves out or writes approximately: in notes over REST, on a note: line over MCP (Notes on a Mermaid view).

In a flowchart:

In an erDiagram:

Edits

Send the whole diagram as mermaid with baseRevision, usually text you read with view=mermaid and changed. Zindex compares it with the baseRevision version and applies only the differences, as operations, making the next version: