Skip to main content
Glama
eric-patton

postgres-schema-mcp

by eric-patton

Table relationships

table_relationships
Read-onlyIdempotent

Trace foreign keys in both directions up to a configurable depth to reveal join paths between tables, eliminating guesswork from column names.

Instructions

Follow foreign keys from one table, in both directions, up to a given depth. Outbound keys tell you what a row points at; inbound keys tell you what points at it. Use this to work out how to join instead of guessing from column names.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
depthNoHow many foreign key hops to follow. Defaults to 2.
tableYesTable name, unqualified.
schemaYesSchema name.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.1

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already establish that this is read-only and idempotent. The description adds meaningful behavioral detail beyond that: it traverses foreign keys in both directions up to a depth, and defines what outbound versus inbound keys mean. This gives the agent a real sense of how results will be structured without needing the output schema.

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

Conciseness5/5

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

Three short, purposeful sentences: the first states the core behavior, the second clarifies directional semantics, and the third gives practical guidance. There is no redundant text or repetition of the title.

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

Completeness4/5

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

For a read-only metadata traversal tool with three parameters and fully documented schema fields, the description is complete enough for an agent to decide when and how to call it. The only gap is that there is no output schema or example return shape, so an agent may be unsure exactly what the result payload looks like, though the description's directional explanation mitigates this.

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

Parameters3/5

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

Schema description coverage is 100%, so the input schema already documents schema, table, and depth well. The description reinforces the depth concept and directional behavior but does not add significant new parameter meaning beyond what the schema provides. Baseline 3 is appropriate.

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 uses a specific verb, 'follow', and a precise resource, foreign keys, with direction and depth scoping. It clearly distinguishes this relationship-traversal tool from siblings like describe_table or find_columns by focusing on join discovery rather than table structure or column lookup.

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

Usage Guidelines4/5

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

The description explicitly says 'Use this to work out how to join instead of guessing from column names,' providing clear context for when the tool is appropriate. It gives a when-not condition but does not explicitly name alternative sibling tools, so it stops just short of a full alternative-routing explanation.

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

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/eric-patton/postgres-schema-mcp'

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