Skip to main content
Glama

List database objects of one kind

pg_list_objects
Read-onlyIdempotent

List PostgreSQL objects of one kind—views, functions, indexes, sequences, types, policies, and more—with schema and name filters, returning compact, kind-specific columns.

Instructions

List objects of ONE kind: views, materialized views, sequences, functions, procedures, aggregates, triggers, indexes, types, enums, domains, extensions, foreign tables and servers, operators, casts, collations, languages, tablespaces, rules, policies, statistics, publications, subscriptions, text search configs, access methods or databases.

Each kind returns its own compact columns (a function: arguments, returns, language, volatility; a sequence: type, last value, owning column; an index: table, method, size). Filter by schema and by a name pattern (* and ? wildcards; plain text matches any name containing it). Kinds the server version does not have return an empty list with a note. Tables are listed by pg_list_tables.

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": {
      "kind": "<kind>"
    },
    "name": "pg_list_objects"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindYes
limitNo
offsetNo
schemaNo
patternNo
connectionNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare read-only, idempotent, non-destructive, closed-world behavior, and the description still adds useful traits: per-kind column shapes (function arguments/returns/volatility, sequence type/last value/owning column, index table/method/size) and the version-mismatch behavior of returning an empty list with a note. It does not mention permissions, pagination defaults, or result ordering, which keeps it short of a 5.

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

Conciseness3/5

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

The opening constraint is front-loaded and the per-kind column examples are efficient, but the full 29-item kind enumeration largely restates the enum already present in the input schema, consuming roughly half the text for little added information. The remainder is tight and well organized.

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?

For a 6-parameter tool with no output schema and 0% schema coverage, the description covers selection semantics well but leaves pagination (limit/offset), the connection parameter, and any notion of result ordering or default limits undocumented. An agent can call it correctly for the common case but must guess at paging behavior.

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 0%, so the description must carry the parameter burden, and it covers only three of six: kind (enumerated), schema (filter), and pattern (with explicit `*`/`?` wildcard and substring-match semantics, which is genuine added value). The limit, offset, and connection parameters are entirely unexplained in both schema and description.

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?

Uses a specific verb and resource ('List objects of ONE kind') and immediately enumerates the kinds covered, so an agent knows the scope precisely. It also explicitly excludes tables and points to the sibling pg_list_tables, which removes the main ambiguity among the catalog-listing tools.

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?

Gives clear when-to-use context: pick exactly one kind, optionally narrow with schema and pattern, and use pg_list_tables instead for tables. It does not address overlap with other siblings that surface the same objects in richer form (e.g. pg_extensions vs the 'extension' kind, pg_policy vs 'policy', pg_index_stats vs 'index'), so the routing guidance is good but not exhaustive.

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