List Constraints
kb_list_constraintsList all constraints (primary key, foreign key, unique, check) on a database table, including constraint name, type, columns, and referenced table for foreign keys.
Instructions
List all constraints (PK, FK, UNIQUE, CHECK) on a table.
Args:
table (string): Table name
schema (string, optional): Schema name, defaults to DB_SCHEMA env or 'public'
Returns: List of constraints with name, type, columns, and referenced table (for FK).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | Table name to list constraints for | |
| schema | No | Schema name (default: from DB_SCHEMA env or 'public') |