Skip to main content
Glama

Object dependencies

pg_dependencies
Read-onlyIdempotent

Trace what depends on a PostgreSQL object and what it depends on to see what breaks if you drop or change it, including views, foreign keys, functions, indexes and triggers.

Instructions

Show what depends on an object and what it depends on, to answer "what breaks if I drop or change this?".

dependents are the views, materialized views, foreign keys from other tables, functions that take the table's row type, sequences, indexes, triggers and column defaults that use the object, followed through views of views up to max_depth. dependencies are the tables, sequences, functions, types and extensions the object needs. Each row says whether dropping the object needs CASCADE or removes it along with the object. name is name or schema.name; a function needs its signature when it has overloads.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "name": "<name>"
    },
    "name": "pg_dependencies"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindNotable
nameYes
directionNoboth
max_depthNo
connectionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

Annotations already declare readOnly, idempotent, non-destructive, closed-world behavior, but the description adds substantial context beyond them: exactly which object classes appear as dependents, that views-of-views are traversed to `max_depth`, what CASCADE implications each row encodes, and how to qualify a function with a signature. That is precisely the behavioral detail an agent needs before acting on a drop/change decision.

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 purpose is front-loaded before the definitions, and every sentence contributes concrete information. The dense middle sentence listing dependent object types is long but earns its place; minor tightening is possible but nothing is filler.

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 introspection tool with no output schema, the description sufficiently explains what comes back (dependents, dependencies, and per-row CASCADE/drop behavior) and how depth is bounded. Missing only guidance on the `kind` and `connection` parameters, which is a minor gap given the tool's simplicity.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must carry the load, and it does for `direction` (dependents vs dependencies), `max_depth` (view-of-view traversal limit), and `name` (qualified naming plus signature for overloaded functions). The `kind` enum and `connection` parameter get no explanation, leaving a small gap.

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 opens with a specific verb and resource ('Show what depends on an object and what it depends on') and immediately frames the practical question it answers ('what breaks if I drop or change this?'). Both directions of the relationship are named, so an agent can tell this apart from catalog-listing or DDL siblings.

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 'what breaks if I drop or change this?' framing gives a clear usage context, and the definition explains what each `direction` value returns so the agent knows which mode to choose. It does not explicitly name an alternative sibling (e.g. a DDL or relationship tool) or state exclusions, keeping it short of a 5.

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