export_data_model
Exports the current project's data model (MCD/ERD) in a universal format. Supported formats: 'dbml' (DBML / dbdiagram.io), 'sql-postgres' (PostgreSQL DDL — CREATE TABLE + ALTER TABLE FK), 'json-schema' (JSON Schema Draft 2020-12 with a vendor extension for relations), 'mermaid' (Mermaid ERD for documentation). Returns the serialized content + metadata (mimeType, extension, stats). 'dbml' is for transferring to dbdiagram.io, 'sql-postgres' for bootstrapping a database, 'json-schema' for driving a REST API. ⚠️ ROUND TRIP: only 'dbml', 'sql-postgres' and 'json-schema' can be re-imported (import_data_model). 'mermaid' is OUTBOUND-ONLY — it has no parser: a data model that leaves in this format does not come back, and a file edited elsewhere cannot be fed back in.
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": {
"format": "<format>"
},
"name": "export_data_model"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | Yes | Output format. Recommended: 'dbml' (DBML / dbdiagram.io), 'sql-postgres' (PostgreSQL DDL), 'json-schema' (Draft 2020-12), 'mermaid' (ERD). | |
| expectedProjectId | No | UUID of the project THIS call targets (overrides the session project). |