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

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes what the tool does (analyzes relationships, shows foreign keys, displays dependencies, analyzes inheritance, identifies orphaned tables) and clarifies it's a read-only analysis tool (prohibits 'relationship modifications or DDL operations'). However, it doesn't mention potential limitations like query performance impact or authentication requirements.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections ([Tool Purpose], [Exact Functionality], etc.) and front-loaded key information. While comprehensive, some sections could be more concise (e.g., the bullet points in [Exact Functionality] are slightly repetitive). Every sentence earns its place by adding value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (4 parameters, 0% schema coverage, no annotations) and the presence of an output schema, the description is complete. It covers purpose, functionality, usage guidelines, parameter semantics, and return value description ('Detailed relationship information including foreign keys, dependencies, and metadata'), leaving no significant gaps for agent understanding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Given 0% schema description coverage, the description compensates fully by explaining each parameter's purpose in the 'Args' section: '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)', etc. This adds crucial meaning beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states the tool's purpose as 'Analyze table relationships including foreign keys, dependencies, and inheritance' with a clear verb ('analyze') and resource ('table relationships'). It distinguishes from siblings like 'get_table_schema_info' or 'get_table_list' by focusing specifically on relationship analysis rather than general schema or listing functions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance with '[Required Use Cases]' listing specific scenarios (e.g., 'When user requests "table relationships", "foreign keys", "dependencies", etc.') and '[Strictly Prohibited Use Cases]' clearly stating what not to use it for (e.g., 'Requests for actual data inside tables'). It also mentions alternatives ('use other tools for that') for performance statistics.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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