Skip to content
Get an API key

Create database diagrams (ER diagrams) showing tables, columns, primary keys, foreign keys, and relationships.

Updated 16 Sep 20261 min read

Send "type": "database_diagram".

Create database diagrams (ER diagrams) showing tables, columns, primary keys, foreign keys, and relationships.

Also available as the MCP tool render_database. The same payload works through either surface.

Fields

data
titlestring

A short title for the schema, shown as the frame header (e.g. "E-commerce Database").

classstringrequired

Always 'GraphLinksModel'

categoryenum<string>required

Must be 'database'. One of database.

nodeDataArrayobject[]required

Array of database tables with key, text, color, fillColor, and columns array

Child attributes
keystringrequired

Unique table identifier

textstringrequired

Table display name

colorstring

Header border color

fillColorstring

Header background color

columnsobject[]required

Array of column definitions

linkDataArrayobject[]required

Array of foreign key relationships between tables

Child attributes
fromstringrequired

Source table key (table with FK)

tostringrequired

Target table key (referenced table)

textstring

Relationship label (e.g., "user_id → id")

relationenum<string>required

Cardinality — drives the crow's-foot arrowheads. one-to-many = one row in "from" relates to many rows in "to". One of one-to-one, one-to-many, many-to-one or many-to-many.

Example

{
  "type": "database_diagram",
  "data": {
    "title": "Q4 Launch Planning",
    "class": "string",
    "category": "database",
    "nodeDataArray": [
      {
        "key": "string",
        "text": "Interview 5 users",
        "color": "string",
        "fillColor": "string",
        "columns": [
          {
            "name": "Q4 Launch Planning",
            "type": "string",
            "pk": false,
            "fk": false
          }
        ]
      }
    ],
    "linkDataArray": [
      {
        "from": "string",
        "to": "string",
        "text": "Interview 5 users",
        "relation": "one-to-one"
      }
    ]
  }
}
Was this page helpful?

Sign in to MockFlow

The same account you use in the app and on the API.

Forgot your password?
or
Continue with GoogleContinue with Microsoft