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.
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 targeted by THIS call. ACTUALLY targets this project instead of the session project. Refused without changing anything if access is not granted. |