get_table_ddl
Retrieves the reconstructed CREATE TABLE DDL for a PostgreSQL table, including constraints and indexes, allowing you to obtain the table definition without direct database access.
Instructions
Return the reconstructed CREATE TABLE DDL for a table (PostgreSQL has no SHOW CREATE TABLE, so this is the closest supported reconstruction from the catalog, including constraints and indexes).
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": {
"table": "<table>"
},
"name": "get_table_ddl"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | Table name. | |
| schema | No | Schema name. Defaults to the server's default schema. |