Skip to main content
Glama
db-conn-mcp

db-conn-mcp

dump_schema_faithful

Export a database schema as byte-faithful DDL using the database's own pg_dump -s, covering sequences, identity columns and partitioning. Returns the SQL inline or saves it to a file.

Instructions

Produce a byte-faithful schema dump using the database's own tool (pg_dump -s).

The most complete/runnable schema export (handles sequences, identity, partitioning, etc.) but REQUIRES the pg_dump binary on the machine running this server. Returns the DDL inline (or writes {database}_schema_{UTC}.sql when output_dir is set). If pg_dump isn't installed it returns {status: "pg_dump_not_found", message}: offer to install pg_dump for the user (see the faithful_schema_export prompt), then retry — or use get_database_schema(format="sql") which needs no extra tools.

Returns meta, status, database, generated_utc and ddl (or saved_to), or meta, status and message when pg_dump is missing or fails.

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": {
      "database": "<database>"
    },
    "name": "dump_schema_faithful"
  }
}

Input Schema

NameRequiredDescriptionDefault
databaseYesName of a configured database, exactly as list_databases returns it (case-sensitive). Not a DSN, host or server-side database name. An unknown name is an error that lists the configured names.
output_dirNoDirectory on the machine running this server to write the export file into (created if missing), instead of returning it inline. Omit to return it inline.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.8.1
    • addedInput schema / properties / database / description
      Added value: +"Name of a configured database, exactly as list_databases returns it (case-sensitive). Not a DSN, host or server-side database name. An unknown name is an error that lists the configured names."
    • addedInput schema / properties / output_dir / description
      Added value: +"Directory on the machine running this server to write the export file into (created if missing), instead of returning it inline. Omit to return it inline."
  2. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations declare readOnlyHint=false and destructiveHint=false but say nothing about why or what side effect occurs; the description supplies that context by explaining a file is written only when output_dir is set. It further discloses the failure mode and its literal return shape ({status: "pg_dump_not_found", message}) and the external dependency, which is exactly the behavioral context annotations cannot convey.

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 capability and its hard dependency are front-loaded, and the fallback comes before the return-value detail. It is slightly long — the closing enumeration of return keys restates part of the earlier sentence about inline vs. saved output — but every block carries information an agent needs.

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

Completeness5/5

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

With no output schema, the description must describe return values and it does, covering both the success shape (meta, status, database, generated_utc, ddl or saved_to) and the failure shape (meta, status, message). Combined with the dependency and fallback notes, an agent has everything needed to call this and handle the result.

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%, so the baseline is 3, and the schema already explains both parameters thoroughly. The description adds marginal value by giving the concrete filename pattern `{database}_schema_{UTC}.sql` and restating that omitting output_dir returns DDL inline, which reinforces rather than duplicates the schema wording.

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?

States a specific verb and resource ('Produce a byte-faithful schema dump using the database's own tool (pg_dump -s)') and immediately characterizes the output as the most complete/runnable schema export. It also names the sibling alternative get_database_schema(format="sql"), so an agent can distinguish the two without opening either schema.

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

Usage Guidelines5/5

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

Gives explicit when-to-use (want byte-faithful/most complete export), an explicit precondition (pg_dump binary must exist on the server host), a fallback (get_database_schema(format="sql")), and a remediation path (offer to install pg_dump, see the faithful_schema_export prompt, then retry). Both the selection decision and the failure-recovery decision are covered.

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