list_constraints
Retrieve all constraints for a PostgreSQL table, including primary keys, foreign keys, unique constraints, and check constraints, to understand table relationships and data integrity rules.
Instructions
List all constraints for a table (PK, FK, UNIQUE, CHECK).
Args:
table_name: Name of the table
schema: Schema name (default: public)
Returns:
List of constraints with type, columns, and references
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_name": "<table_name>"
},
"name": "list_constraints"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table_name | Yes | ||
| schema | No | public |