Skip to main content
Glama

pg_inspect_schema

Inspect PostgreSQL tables, columns, data types, and indexes for a schema to understand database structure before writing or reviewing SQL.

Instructions

Inspect PostgreSQL tables, columns, data types, and indexes for a schema.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

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

Input Schema

NameRequiredDescriptionDefault
schema_nameNopublic

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3/5.0
Behavior3/5

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

No annotations are provided, so the description carries the full burden; "Inspect" reasonably signals a non-mutating read operation, which is the key behavioral fact for this tool. However, it never states that it is read-only, whether special privileges are required, or how it behaves for a nonexistent schema, leaving meaningful gaps.

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?

A single front-loaded sentence with no filler; the resource enumeration is packed efficiently. It is arguably under-specified rather than verbose, which is penalized elsewhere rather than here.

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

Completeness3/5

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

An output schema exists, so return values need not be explained, and the tool is simple with one optional parameter. Still missing is any note on default schema behavior, system/catalog schema handling, or error behavior when the schema does not exist.

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

Parameters2/5

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

Schema description coverage is 0% for the single parameter, and the description never mentions schema_name or its default of "public". The most important invocation detail — that omitting the parameter inspects the public schema — is only discoverable by reading the raw schema JSON.

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

Purpose4/5

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

States a specific verb ("Inspect") and enumerates the exact resources returned (tables, columns, data types, indexes) scoped to a schema, which is far more informative than a tautology. It does not explicitly contrast itself with siblings like pg_safe_query or pg_explain_query, so an agent must infer that this is structural metadata retrieval rather than query execution.

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

Usage Guidelines2/5

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

There is no when-to-use guidance, no prerequisites, and no named alternative. The agent is left to infer that this tool should precede query-writing or be used instead of pg_safe_query when the goal is understanding structure rather than retrieving rows.

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