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
| Name | Required | Description | Default |
|---|---|---|---|
| database | Yes | 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. | |
| output_dir | No | 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. |