Database diagram
Create database diagrams (ER diagrams) showing tables, columns, primary keys, foreign keys, and relationships.
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
titlestringA short title for the schema, shown as the frame header (e.g. "E-commerce Database").
classstringrequiredAlways 'GraphLinksModel'
categoryenum<string>requiredMust be 'database'. One of database.
nodeDataArrayobject[]requiredArray of database tables with key, text, color, fillColor, and columns array
Child attributes
keystringrequiredUnique table identifier
textstringrequiredTable display name
colorstringHeader border color
fillColorstringHeader background color
columnsobject[]requiredArray of column definitions
linkDataArrayobject[]requiredArray of foreign key relationships between tables
Child attributes
fromstringrequiredSource table key (table with FK)
tostringrequiredTarget table key (referenced table)
textstringRelationship label (e.g., "user_id → id")
relationenum<string>requiredCardinality — 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"
}
]
}
}