Skip to main content
Glama
call518

MCP PostgreSQL Operations

get_table_relationships

Analyze PostgreSQL table relationships including foreign keys, dependencies, and inheritance to understand database schema design and plan data migrations.

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)

Args: database_name: Database name to query (REQUIRED - specify which database to analyze) table_name: Specific table name to analyze (if None, shows database-wide relationship overview) schema_name: Schema name to search in (default: "public") relationship_type: Type of relationships to show ("all", "foreign_keys", "dependencies", "inheritance")

Returns: Detailed relationship information including foreign keys, dependencies, and metadata

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
database_nameYes
table_nameNo
schema_nameNopublic
relationship_typeNoall

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/call518/MCP-PostgreSQL-Ops'

If you have feedback or need assistance with the MCP directory API, please join our Discord server