Skip to main content
Glama

List schemas

pg_list_schemas
Read-onlyIdempotent

Lists database schemas with owners, comments, table/view/sequence/function counts, and approximate sizes, excluding system schemas unless requested, to support initial database exploration.

Instructions

List the schemas (namespaces) of the database with owner, comment, how many tables, views, sequences and functions each holds, and approximate size.

The first step when exploring a database. System schemas (pg_catalog, information_schema) are left out unless include_system is true. Sizes come from the planner statistics, so they are instant and slightly behind; pg_sizes measures.

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_list_schemas"
  }
}

Input Schema

NameRequiredDescriptionDefault
connectionNo
include_systemNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, so the safety profile is covered; the description adds genuinely new behavior: sizes derive from planner statistics, so they are instant but slightly stale, and system schemas (pg_catalog, information_schema) are hidden by default. The staleness caveat is exactly the kind of trait annotations cannot express.

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?

Two tight paragraphs: the first front-loads what is returned, the second covers defaults and the size caveat. Every clause carries information, including the pointer to pg_sizes, and nothing is redundant.

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?

With no output schema, the description correctly enumerates the returned fields, and it discloses the default filtering and the accuracy trade-off on sizes. For a two-parameter read-only listing tool, nothing an agent needs before calling is missing apart from the connection param.

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 coverage is 0%, so the description must carry the load; it does explain include_system precisely (system schemas omitted unless true), which is meaningful beyond the bare boolean default in the schema. However, the `connection` parameter gets no mention at all, leaving half the parameters undocumented anywhere, so compensation is only partial.

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?

States a specific verb and resource ("List the schemas (namespaces)") and enumerates exactly what each row contains: owner, comment, table/view/sequence/function counts, and approximate size. The parenthetical gloss on 'namespaces' plus the explicit return-field list makes it distinguishable from object-listing siblings at a glance.

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 first step when exploring a database" gives an unambiguous entry-point role, and the note that pg_sizes provides measured sizes routes the agent to the right tool when exact bytes matter. No explicit exclusion of when NOT to use it, but the default exclusion of system schemas functions as practical scoping guidance.

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