Skip to main content
Glama

Get Mermaid ER Diagram

get_mermaid_diagram

Generates a Mermaid ER diagram for a SQL Server database, showing tables, columns, primary keys, and foreign key relationships with cardinality. Supports filtering by schemas and tables.

Instructions

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

Input Schema

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

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv1.4.0
    • changedInput schema / properties / excludeSchemas / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedInput schema / properties / excludeTables / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedInput schema / properties / includeSchemas / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
    • changedInput schema / properties / includeTables / type
      Previous value: -"string"New value: +[
      +  "string",
      +  "null"
      +]
  2. First observedv1.3.1

TDQS

A3.5/5.0
Behavior3/5

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

Annotations indicate readOnlyHint=false and idempotentHint=false, which aligns with the description's mention of saving a file (write operation). However, the description adds no further behavioral details, such as overwrite behavior or prerequisites.

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 sentence that is concise, front-loaded, and contains no unnecessary words. It efficiently conveys the core functionality.

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

Completeness3/5

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

Given the complexity (9 parameters, no output schema), the description is adequate but not comprehensive. It lacks details about the output format, error conditions, or behavior with omitted parameters.

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 the input schema fully documents all 9 parameters with descriptions. The tool's description does not add any additional semantics beyond what is already in the schema.

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 explicitly states the tool generates a Mermaid ER diagram, saves it to a file, and shows tables, columns, PKs, and FK relationships. It clearly distinguishes from sibling tools like get_plantuml_diagram.

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

Usage Guidelines2/5

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

No explicit guidance on when to use this tool versus alternatives (e.g., PlantUML diagram). The description implies its purpose but does not provide usage context or exclusions.

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