Skip to main content
Glama

ER diagram from schema

schema_er

Generate a Mermaid ER diagram from a live PostgreSQL schema, ranking tables by size and optionally rendering or saving the diagram.

Instructions

Build a Mermaid erDiagram from the live database schema (tables ranked by size), optionally render and save it.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "schema_er"
  }
}

Input Schema

NameRequiredDescriptionDefault
saveNo
titleNo
tablesNo
max_entitiesNo
include_columnsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

B3.1/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses the data source (live schema) and the ranking behavior (by size), which is genuinely useful context. It does not state whether the operation is read-only, where a saved diagram is written, or what happens when limits are hit, so the behavioral picture is incomplete.

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

Conciseness4/5

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

A single front-loaded sentence with the core output stated first and the optional step trailing. The parenthetical about table ranking is efficient. Nothing is wasted, though the extreme brevity leaves little room for the parameter context that is missing elsewhere.

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

Completeness2/5

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

Five undocumented parameters, no annotations, and no output schema mean the description should be doing much more work. It covers the high-level purpose but leaves the agent without the information needed to set table filters, entity caps, or column inclusion correctly.

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

Parameters2/5

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

Schema description coverage is 0% across five parameters, so the description must compensate and largely fails to. Only the save behavior is indirectly referenced ('optionally render and save'); title, tables, max_entities, and include_columns are never explained, leaving an agent to guess at filtering, sizing, and column-inclusion semantics.

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?

States a specific verb and artifact: 'Build a Mermaid erDiagram from the live database schema', which tells an agent exactly what is produced and from what source. It also notes tables are ranked by size, a useful distinguishing detail. It does not explicitly contrast with siblings like arch_diagram or schema_tables, so the differentiation is implied rather than stated.

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?

'optionally render and save it' hints at a workflow (build first, then optionally render/save), which suggests when the save path applies. However, there is no explicit guidance on when to choose this over schema_tables or arch_diagram, and no prerequisites or exclusions are given.

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