Skip to main content
Glama
pg-readonly-mcp

pg-readonly-mcp

by vinit1009

describe_table

Read-onlyIdempotent

Inspect an allow-listed PostgreSQL table or view to retrieve column names, types, nullability, defaults, comments, primary keys, and foreign keys before writing queries.

Instructions

Show the columns (name, type, nullable, default, comment), primary key and foreign keys of one allow-listed table or view. Pass schema.table, or just the table name for the default schema.

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": {
      "table": "<table>"
    },
    "name": "describe_table"
  }
}

Input Schema

NameRequiredDescriptionDefault
tableYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, non-destructive and closed-world, so the safety profile is covered. The description adds genuine context beyond that: only allow-listed tables or views can be described, which tells the agent a failure mode exists that annotations don't convey. It does not describe error behavior or output shape, but the output schema covers the latter.

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 sentences, both earning their place: the first defines the returned structure, the second defines the input format. The most important information (what is returned) is front-loaded with zero filler.

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?

For a single-parameter introspection tool with a full output schema and rich annotations, the description covers the remaining gaps: the returned field list, the allow-list restriction, and the qualified-name syntax. Nothing an agent needs to invoke it correctly is missing.

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

Parameters5/5

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

Schema description coverage is 0% and the single 'table' parameter is bare in the schema, so the description carries the full burden. It does so cleanly by specifying the accepted forms: 'schema.table' or a bare table name resolving to the default schema. This is exactly the meaning an agent needs and cannot get from the schema.

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?

The description states a specific verb and resource ('Show the columns ... primary key and foreign keys of one allow-listed table or view') and enumerates the exact attributes returned, so an agent knows precisely what it gets back. It doesn't explicitly contrast itself with list_tables or run_query, so differentiation is inferred from the introspection content rather than stated.

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 nature of the operation (inspect a table's structure before querying), and the 'allow-listed table or view' phrase signals a scoping constraint. However, there is no explicit statement of when to prefer this over list_tables or run_query, and no mention of what happens for a non-allow-listed table.

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