Skip to main content
Glama
platypus-db

platypus-db

Official

get_er_diagram

Generate a Mermaid ER diagram of a schema's tables, columns, primary keys and foreign keys, or an SVG image, scoped to chosen tables and their foreign-key neighbors.

Instructions

Returns a Mermaid erDiagram of a schema's tables (columns, primary keys) and the foreign keys between them, as text. Without tables the whole schema; with tables, those and the tables within depth foreign-key hops of them (default 1, at most 3). A diagram too long for one answer is cut with a note: pass tables to choose. With format: "svg" the answer is the SVG image PlatypusDB draws for its own export (it needs the app open, asks the user nothing, and is refused rather than cut when it is over the byte limit); the default mermaid works without the app.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "connection": "<connection>",
      "schema": "<schema>"
    },
    "name": "get_er_diagram"
  }
}

Input Schema

NameRequiredDescriptionDefault
depthNoWith `tables`: how many foreign-key hops from them to follow, in both directions (default 1, at most 3).
formatNo`mermaid` (the default: text, works without the app) or `svg` (an image drawn by the open PlatypusDB app, as its diagram export; an error when the app is closed).
schemaYesThe schema (a database in MySQL, `main` in SQLite and DuckDB).
tablesNoTables to draw, as `list_objects` shows them; left out, the whole schema.
connectionYesThe connection's name, as `list_connections` shows it.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.2

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations, the description carries the full load and does substantial work: it discloses that long output is cut with an explanatory note, that `svg` requires the open PlatypusDB app and asks the user nothing, and that oversized SVG is refused outright rather than truncated. Those are non-obvious failure modes an agent could not infer from the schema. It does not explicitly frame the operation as read-only, though that is strongly implied by 'returns'.

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?

The purpose is front-loaded in the first clause, and the remaining sentences cover scoping, truncation, and format without filler. It is dense to the point of being run-on, with several nested parentheticals in a single sentence, which slightly hurts scanability but wastes no words.

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 five-parameter read tool with no annotations and no output schema, the description covers the output form, scoping behavior, truncation risk, and the app-dependency of the SVG path. Nothing essential for a correct first call appears missing. Minor gap: it does not say how large a diagram can get before truncation, so an agent cannot predict when to pre-scope.

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%, and the parameter descriptions already state the depth default of 1, the cap of 3, the format options, and the list_objects/list_connections reference sources. The description largely restates these; its only genuine addition is the operational link between truncation and passing `tables`. Baseline 3 is appropriate where the schema does the heavy lifting.

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 names a specific verb and artifact: it returns a Mermaid erDiagram of a schema's tables, columns, primary keys, and inter-table foreign keys, and it states the output is text. An agent can tell this is a diagram-generation tool rather than a raw DDL or row-query tool. It stops short of naming a sibling (e.g. get_ddl or describe_table) as the contrasting option, so it does not reach a 5.

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?

Usage is implied through scoping rules: omit `tables` for the whole schema, pass `tables` to focus, and pass `tables` to recover from a truncated answer. It also gives a clear condition for choosing `svg` (needs the app open) versus `mermaid` (works without it). However, there is no explicit statement of when to prefer this over alternative tools such as get_ddl or describe_table, so routing guidance is left to inference.

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