Skip to main content
Glama
call518

MCP PostgreSQL Operations

by call518

get_database_schema_info

Retrieve schema names, owners, permissions, object lists, and size statistics for a PostgreSQL database to analyze namespace structure and access.

Instructions

[Tool Purpose]: Retrieve detailed information about database schemas (namespaces) and their contents

[Exact Functionality]:

  • Show all schemas in a database with their owners and permissions

  • Display schema-level statistics including table count and total size

  • List all objects (tables, views, functions) within specific schema

  • Show schema access privileges and usage patterns

[Required Use Cases]:

  • When user requests "database schema info", "schema overview", "namespace structure", etc.

  • When analyzing database organization and schema-level permissions

  • When exploring multi-schema database architecture

[Strictly Prohibited Use Cases]:

  • Requests for actual data inside tables

  • Requests for schema structure changes or DDL operations

  • Requests for individual table details (use get_table_schema_info for that)

Input Schema

NameRequiredDescriptionDefault
schema_nameNoSpecific schema name to analyze (if None, shows all schemas)
database_nameYesDatabase name to query (REQUIRED - specify which database to analyze)

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv3.4.3
    • addedInput schema / properties / database_name / description
      Added value: +"Database name to query (REQUIRED - specify which database to analyze)"
    • addedInput schema / properties / schema_name / description
      Added value: +"Specific schema name to analyze (if None, shows all schemas)"
  2. Changed7 schema fields changedv3.4.2
    • addedInput schema / additionalProperties
      Added value: +false
    • removedInput schema / properties / database_name / title
      Removed value: -"Database Name"
    • addedInput schema / properties / schema_name / anyOf
      Added value: +[
      +  {
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • removedInput schema / properties / schema_name / title
      Removed value: -"Schema Name"
    • removedInput schema / properties / schema_name / type
      Removed value: -"string"
    • removedOutput schema / properties / result / title
      Removed value: -"Result"
    • removedOutput schema / title
      Removed value: -"_WrappedResult"
  3. Addedv1.0.0

TDQS

A4.3/5.0
Behavior4/5

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

No annotations are supplied, so the description carries the load; it does so reasonably by framing the tool as a pure read/introspection call and enumerating the categories of metadata surfaced (owners, privileges, statistics, objects). It stops short of stating explicitly that the call is read-only and side-effect free, and says nothing about cost or permission requirements for reading schema metadata.

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?

Front-loaded with the purpose and organized under labeled sections, so an agent can skim to the relevant block. It is somewhat over-formatted and repetitive — 'Exact Functionality' bullets overlap the 'Required Use Cases' bullets, and 'usage patterns' is vague filler — but nothing is seriously off-topic.

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 two-parameter introspection tool with a full output schema, the description covers scope, contents, and boundaries well enough to call it correctly. The only real gap, given zero annotations, is the absence of an explicit read-only/no-side-effects statement and any note on the permissions needed to view schema metadata.

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 both parameters are already documented in the schema, including the null-means-all-schemas default. The description confirms the all-vs-specific scope behavior in prose but adds no format, syntax, or naming details beyond what the schema supplies.

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+resource (retrieve schema/namespace info and their contents) and enumerates exactly what is returned: schemas, owners, permissions, table counts, sizes, contained objects. It explicitly separates itself from get_table_schema_info, so an agent can distinguish it from that sibling without opening either schema.

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?

Provides explicit 'Required Use Cases' (schema overview, namespace structure, org/permission analysis) and explicit 'Strictly Prohibited Use Cases', including a named alternative for table-level detail. This is the when-to-use/when-not/alternative triad stated outright.

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