get_table_relationships
Analyze table relationships by mapping foreign keys, view dependencies, inheritance, and partitions. Use it to review schema design, spot orphaned tables, and plan migrations or schema changes.
Instructions
[Tool Purpose]: Analyze table relationships including foreign keys, dependencies, and inheritance
[Exact Functionality]:
Show foreign key relationships (inbound and outbound)
Display view dependencies and table references
Analyze inheritance and partition relationships
Identify orphaned tables and relationship patterns
[Required Use Cases]:
When user requests "table relationships", "foreign keys", "dependencies", etc.
When analyzing database schema design and data model
When planning data migration or schema changes
[Strictly Prohibited Use Cases]:
Requests for actual data inside tables
Requests for relationship modifications or DDL operations
Requests for performance statistics (use other tools for that)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table_name | No | Specific table name to analyze (if None, shows database-wide relationship overview) | |
| schema_name | No | Schema name to search in (default: "public") | public |
| database_name | Yes | Database name to query (REQUIRED - specify which database to analyze) | |
| relationship_type | No | Type of relationships to show ("all", "foreign_keys", "dependencies", "inheritance") | all |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |