SchemaSketch

v1.3.1
dev.schemasketch/mcp-server Checked 2 hours ago Published 13 days ago

Design database diagrams in DBML: create, edit, validate, export SQL, Laravel, Mermaid.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_dbml_syntax_guide

Read this before writing or editing any DBML — the exact syntax SchemaSketch accepts, with a full example.

list_diagrams

List the signed-in user's saved diagrams (id, name, last updated).

get_diagram

Fetch one diagram by id, including its full DBML source and table positions.

ParameterTypeDescription
diagram_id *stringThe diagram id (a UUID), from list_diagrams.

validate_dbml

Parse DBML and report syntax errors plus semantic warnings (duplicate names, dangling refs, unrecognized/mismatched types) before saving it. Read-only — never touches the server.

ParameterTypeDescription
dbml_source *stringThe DBML text to check.

create_diagram

Create a new diagram. The DBML is validated first: syntax errors or relationships to missing tables/columns mean nothing is saved; warnings are returned with the result.

ParameterTypeDescription
name *stringDiagram title, shown on the dashboard.
dbml_sourcestringInitial DBML text. Empty diagram if omitted.

update_diagram

Replace a diagram's DBML source (and/or rename it). This overwrites the whole source — fetch it with get_diagram first if you need to edit rather than replace it outright, and pass its version as base_version so you never overwrite someone else's newer change. New DBML is validated first: errors mean nothing is saved; warnings are returned with the result.

ParameterTypeDescription
diagram_id *stringThe diagram id (a UUID), from list_diagrams.
base_versionintegerThe diagram's `version` from get_diagram. When given, the update is refused if someone else saved since, instead of overwriting their change. Recommended whenever you edit.
dbml_sourcestringNew full DBML text. Omit to leave unchanged.
namestringNew title. Omit to leave unchanged.
renamesarrayTables, columns, enums and table groups this edit renames. Always list them: without it a rename can look like a removed column plus a new one, and a migration generated from the diagram would drop th…

delete_diagram

Permanently delete a diagram. This cannot be undone — confirm with the user before calling it.

ParameterTypeDescription
diagram_id *stringThe diagram id (a UUID), from list_diagrams.

export_sql

Generate CREATE TABLE / ALTER TABLE SQL DDL for a diagram, in a given dialect.

ParameterTypeDescription
dbml_sourcestringOr export unsaved DBML text directly instead of a saved diagram.
diagram_idstringA saved diagram to export (its UUID).
dialectstring

export_laravel_migrations

Generate Laravel migration files (one per table, plus a foreign-keys migration) for a diagram.

ParameterTypeDescription
dbml_sourcestringOr export unsaved DBML text directly instead of a saved diagram.
diagram_idstringA saved diagram to export (its UUID).

export_laravel_models

Generate Laravel Eloquent model files (fillable, casts, and inferred relationships including belongsToMany through plain pivot tables) for a diagram.

ParameterTypeDescription
dbml_sourcestringOr export unsaved DBML text directly instead of a saved diagram.
diagram_idstringA saved diagram to export (its UUID).
laravel_versionintegerTarget Laravel major version. 10 emits the legacy `protected $casts` property; 11+ emits the newer `casts(): array` method (not recognized by Eloquent 10).

export_mermaid

Generate Mermaid erDiagram syntax for a diagram.

ParameterTypeDescription
dbml_sourcestringOr export unsaved DBML text directly instead of a saved diagram.
diagram_idstringA saved diagram to export (its UUID).

export_plantuml

Generate PlantUML entity syntax for a diagram.

ParameterTypeDescription
dbml_sourcestringOr export unsaved DBML text directly instead of a saved diagram.
diagram_idstringA saved diagram to export (its UUID).

import_sql

Convert CREATE TABLE / ALTER TABLE SQL DDL into DBML text. Read-only — never touches the server; pass the result to create_diagram or update_diagram to actually save it.

ParameterTypeDescription
sql *stringThe SQL text to convert (CREATE TABLE / ALTER TABLE ... FOREIGN KEY statements).

import_mermaid

Convert Mermaid erDiagram syntax into DBML text. Read-only — never touches the server; pass the result to create_diagram or update_diagram to actually save it.

ParameterTypeDescription
mermaid *stringThe Mermaid erDiagram source to convert.

import_plantuml

Convert PlantUML entity syntax into DBML text. Read-only — never touches the server; pass the result to create_diagram or update_diagram to actually save it.

ParameterTypeDescription
plantuml *stringThe PlantUML entity source to convert.