Skip to main content
Glama

schema_to_erd

Turn any database schema into a Mermaid ER diagram. Accepts SQL DDL, Prisma, Drizzle, TypeORM, or SQLAlchemy schemas.

Instructions

Turn a database schema into a Mermaid erDiagram. Accepts SQL DDL, Prisma, Drizzle, TypeORM, or SQLAlchemy — pass a file path or the text directly. Returns the Mermaid source plus a ```mermaid fenced block you can paste straight into markdown.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
source_pathNoPath to a schema file (.sql, schema.prisma, *.ts, models.py).
source_textNoSchema source as text (alternative to source_path).
source_typeNoDefaults to auto-detect.
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description fully carries the transparency burden. It clearly states the tool is read-only (converts input to output) and details the output format. It does not cover error handling or limitations, but for a simple conversion tool, the level of disclosure is adequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, zero waste. The first sentence states the purpose, the second covers input options and output format. Information is front-loaded and efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 3 parameters and no output schema, the description covers the core purpose, input formats, and output. Missing details like behavior when both source_path and source_text are provided, or error handling for invalid schemas, but overall it's sufficient for typical usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, setting baseline to 3. The description adds value by explaining the relationship between source_path and source_text as alternative inputs, and listing the supported schema formats, which goes beyond the schema's individual parameter descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool converts a database schema to a Mermaid erDiagram, with specific input formats. However, it does not explicitly differentiate from sibling tools like render_erd, which might have overlapping functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage (when you have a schema and need an ERD diagram) but provides no explicit guidance on when to use this tool versus siblings like render_erd or drift_check, and no when-not-to-use or alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ryanda9910/erdlens'

If you have feedback or need assistance with the MCP directory API, please join our Discord server