get_er_diagram
Generate a Mermaid ER diagram of a schema's tables, columns, primary keys and foreign keys, or an SVG image, scoped to chosen tables and their foreign-key neighbors.
Instructions
Returns a Mermaid erDiagram of a schema's tables (columns, primary keys) and the foreign keys between them, as text. Without tables the whole schema; with tables, those and the tables within depth foreign-key hops of them (default 1, at most 3). A diagram too long for one answer is cut with a note: pass tables to choose. With format: "svg" the answer is the SVG image PlatypusDB draws for its own export (it needs the app open, asks the user nothing, and is refused rather than cut when it is over the byte limit); the default mermaid works without the app.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"connection": "<connection>",
"schema": "<schema>"
},
"name": "get_er_diagram"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| depth | No | With `tables`: how many foreign-key hops from them to follow, in both directions (default 1, at most 3). | |
| format | No | `mermaid` (the default: text, works without the app) or `svg` (an image drawn by the open PlatypusDB app, as its diagram export; an error when the app is closed). | |
| schema | Yes | The schema (a database in MySQL, `main` in SQLite and DuckDB). | |
| tables | No | Tables to draw, as `list_objects` shows them; left out, the whole schema. | |
| connection | Yes | The connection's name, as `list_connections` shows it. |