Skip to main content
Glama
MCPg - Production-grade PostgreSQL MCP Server

MCPg - Production-grade PostgreSQL MCP Server

List generated columns

list_generated_columns
Read-only

Lists every GENERATED ALWAYS AS (...) STORED column in a PostgreSQL schema, returning its data type, expression, and kind so you can inspect computed columns and plan schema changes.

Instructions

List every GENERATED ALWAYS AS (...) STORED column in a schema, with its data type, the underlying expression, and whether it's stored or virtual. PostgreSQL today supports only the stored form; the kind field is reported anyway so the response shape is forward-compatible when PG adds virtual columns. Returns a list of objects with schema, table, column, data_type, expression, kind ('stored' today; reserved for 'virtual').

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": {
      "schema": "<schema>"
    },
    "name": "list_generated_columns"
  }
}

Input Schema

NameRequiredDescriptionDefault
schemaYes
databaseNoOptional: a database id from list_databases, to target a configured secondary (read-only) database; omit for the primary. Database names that are not configured ids are rejected.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.8.4
    • changedInput schema / properties / database / description
      Previous value: -"Optional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids."New value: +"Optional: a database id from list_databases, to target a configured secondary (read-only) database; omit for the primary. Database names that are not configured ids are rejected."
  2. First observedv0.6.8

TDQS

A3.7/5.0
Behavior3/5

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

Annotations already declare this a read-only, closed-world operation, so the safety profile is covered. The description adds genuine context the annotations cannot: PG currently only supports the stored form and the `kind` field is forward-compatible. It does not mention anything about the secondary read-only database targeting behavior, which is left entirely to the schema.

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 action and scope, and the two explanatory sentences are short. The final sentence enumerating returned fields is largely redundant given an output schema exists, which is the only real waste.

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 read-only list tool with an output schema, this is essentially complete: the agent knows what it returns and the notable PostgreSQL limitation. The explicit field enumeration is redundant given the output schema, and the multi-database aspect is only handled in the schema.

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 50%: the trickier `database` parameter carries a thorough schema description covering configured-id validation and read-only targeting, while the required `schema` parameter is undocumented but self-evident. The description adds 'in a schema' as scope but no syntax or meaning beyond that, so the baseline 3 is right.

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 precise verb ('List') and a very specific resource: 'every GENERATED ALWAYS AS (...) STORED column in a schema', plus the fields returned. This is clearly distinguishable from the many sibling list_* tools (list_tables, list_indexes, list_constraints) because the column class is named explicitly.

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

Usage Guidelines3/5

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

Usage is implied by the narrow resource definition — an agent knows to call it when it wants generated/computed column inventory — but there is no explicit 'use this instead of describe_table' routing, no prerequisites, and no mention of when not to use it. Adequate, not guiding.

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

Deploy Server

Other Tools