Skip to main content
Glama

Get Mermaid ER Diagram

get_mermaid_diagram

Generate Mermaid ER diagrams from SQL Server databases to visualize tables, columns, primary keys, and foreign key relationships with smart cardinality, saving diagrams to files for documentation and analysis.

Instructions

Generate a Mermaid ER diagram saved to a file. Shows tables, columns, PKs, and FK relationships with smart cardinality.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
serverNameYesServer name from list_servers
databaseNameYesDatabase name from list_databases
outputPathYesFile path for output (e.g. '/tmp/diagram.mmd')
includeSchemasNoOptional comma-separated schemas to include (e.g. 'dbo,sales'). Overrides excludeSchemas.
excludeSchemasNoOptional comma-separated schemas to exclude (e.g. 'audit,staging'). Ignored if includeSchemas set.
includeTablesNoOptional comma-separated tables to include (e.g. 'Users,Orders'). Overrides excludeTables.
excludeTablesNoOptional comma-separated tables to exclude. Ignored if includeTables set.
maxTablesNoMax tables to include (1-200, default 50)
compactNotrue/false. Show only PK/FK columns without non-key columns
Behavior4/5

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

Annotations provide readOnlyHint=false and idempotentHint=false, indicating it's a write operation with side effects. The description adds valuable context beyond annotations: it specifies that output is saved to a file (a side effect), describes the diagram content (tables, columns, PKs, FKs with smart cardinality), and implies generation behavior. No contradiction with annotations.

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?

The description is a single, efficient sentence that front-loads the core action and key details (output format, file saving, diagram content). Every word contributes value without redundancy, making it easy to parse quickly.

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?

Given the tool's moderate complexity (9 parameters, write operation) and lack of output schema, the description is reasonably complete. It covers the core purpose, output behavior, and diagram content. However, it could better address error conditions, file overwriting, or dependencies on sibling tools like list_servers and list_databases.

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

Parameters3/5

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

Schema description coverage is 100%, so parameters are fully documented in the schema. The description adds minimal param semantics beyond the schema, only implying filtering via include/exclude parameters and output path usage. It doesn't explain parameter interactions or provide additional syntax details, meeting the baseline for high schema coverage.

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

Purpose5/5

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

The description clearly states the specific action ('Generate a Mermaid ER diagram saved to a file') and resource (database schema), and distinguishes it from siblings by specifying the output format (Mermaid vs PlantUML in get_plantuml_diagram) and content focus (ER diagram showing tables, columns, PKs, FKs with cardinality).

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 for generating ER diagrams from databases, but provides no explicit guidance on when to use this tool versus alternatives like get_plantuml_diagram or get_schema_overview. It mentions the output format and content, but lacks context about prerequisites or comparison with sibling tools.

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/mbentham/sql-augur'

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