Describe a Postgres table
postgres_describe_tableDescribe a PostgreSQL table or view to inspect columns, types, nullability, defaults, comments, primary keys, and foreign keys before writing correct queries and JOINs.
Instructions
Describe one table or view: columns with types, nullability, defaults and comments, the primary key, foreign keys to other tables, and foreign keys from other tables (use these to write correct JOINs). Call before writing a query against a table you haven't seen.
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": "postgres_describe_table"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | Table or view name, optionally schema-qualified (e.g. orders or public.orders). | |
| schema | No | Schema of the table. Defaults to public. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | ||
| name | Yes | ||
| columns | Yes | ||
| comment | Yes | ||
| row_count | Yes | Number of columns. | |
| primary_key | Yes | ||
| schema_name | Yes | ||
| foreign_keys | Yes | Keys in this table referencing other tables. | |
| referenced_by | Yes | Keys in other tables referencing this one (columns are in the other table). |