# dbml.db > DBML as a service for AI agents: validate, parse, summarize, review and convert database schemas written in DBML (https://dbml.dbdiagram.io/docs). HTTP API, MCP server and CLI. Free, rate limited, no account. - Site: https://dbml.db.pit.world/ - Docs: https://dbml.db.pit.world/docs - MCP (streamable HTTP): https://dbml.db.pit.world/mcp tools: validate_dbml, parse_dbml, summarize_dbml, review_dbml, format_dbml, dbml_to_sql, sql_to_dbml, list_review_rules, dbml_syntax - API index: https://dbml.db.pit.world/api/v1 - CLI: npm i -g @profullstack/dbml (dbml validate|parse|summary|review|format|to-sql|from-sql|rules|syntax|mcp) ## API (POST JSON, or a raw text body with ?dialect=) - /api/v1/validate {dbml} -> {valid, errors:[{message,line,column,end_line,end_column,code}]} - /api/v1/parse {dbml} -> {valid, errors, model:{project,tables,refs,enums,table_groups}} - /api/v1/summary {dbml} -> {valid, summary:{counts,tables,refs,enums,text}} - /api/v1/review {dbml, rules?} -> {valid, score, counts, findings:[{rule,severity,message,table,column,line}]} - /api/v1/format {dbml} -> {ok, dbml} - /api/v1/dbml-to-sql {dbml, dialect: postgres|mysql|mssql|oracle} -> {ok, sql} - /api/v1/sql-to-dbml {sql, dialect: postgres|mysql|mssql|oracle|snowflake|schemarb|json} -> {ok, dbml} - /api/v1/convert {from, to, input} - GET /api/v1/rules, GET /api/v1/syntax Invalid DBML answers 422 with errors carrying line and column (validate answers 200 with valid:false). Inputs up to 512 KiB. 60 requests/minute per caller. ## Review rules - missing_primary_key (error): A table has no primary key (no [pk] column and no pk index). - ref_target_not_unique (error): A ref points at columns that are not a primary key or unique, so the foreign key cannot be created. - fk_type_mismatch (warning): A foreign key column type differs from the column it references. - unindexed_foreign_key (warning): A foreign key column is not the leading column of any index or the primary key; joins and cascading deletes scan the table. - nullable_foreign_key (warning): A foreign key column allows NULL. Fine for an optional relationship; otherwise add [not null]. - many_to_many_ref (warning): A many-to-many ref (<>) needs a junction table in SQL; model it explicitly. - duplicate_index (warning): Two indexes on the same table cover the same columns in the same order. - reserved_word (warning): A table or column is named with an SQL reserved word and needs quoting everywhere. - float_for_money (warning): A money-like column (price, amount, total, balance, cost) uses a floating-point type; use decimal/numeric or integer cents. - varchar_without_length (warning): MySQL and SQL Server need a length on varchar. - table_naming_inconsistent (info): Table names mix naming styles (snake_case, camelCase, PascalCase) or singular and plural. - column_naming_inconsistent (info): Column names mix naming styles across the schema. - redundant_index (info): An index is a leading prefix of another index on the same table. - possible_missing_ref (info): A column named like _id matches a table but has no ref. - isolated_table (info): A table has no refs in or out while the schema has other tables. - missing_timestamps (info): A table has no created_at/updated_at style column. - unused_enum (info): An enum is declared but no column uses it. - wide_table (info): A table has more than 40 columns. ## Credits Parsing and SQL conversion: @dbml/core by Holistics (Apache-2.0), https://github.com/holistics/dbml