Skip to main content
Glama
aradhyas8
by aradhyas8

describe_tables

Retrieve schema and planner statistics for multiple PostgreSQL tables in one call, including columns, primary and foreign keys, indexes, null fractions, and distinct counts.

Instructions

Describe several tables in one call: columns (name, type, nullable), primary key, outgoing and incoming foreign keys (constraint, from_table/from_columns, to_table/to_columns, paired by position), and indexes. Each column carries planner statistics (no scans): stats_available, and when true null_frac, n_distinct (negative = minus the distinct fraction of rows, -1 = unique) and, for enum-like non-sensitive columns, common_values with frequencies. Columns matching a redaction pattern get stats_available: false, redacted: true. Unknown tables get a per-table error; the rest still succeed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tablesYesSchema-qualified table names, e.g. public.users

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses that stats come from the planner with 'no scans' (critical safety/performance detail), explains redaction behavior (stats_available: false, redacted: true), and details partial-failure semantics (unknown tables error, rest succeed). It does not describe authentication or permission requirements.

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?

A single dense sentence front-loads the output structure, but it is quite long and packs a lot of detail on stats semantics and constraint pairing. Appropriate for the complexity yet could be broken into clearer segments.

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?

Given no output schema, the description fully explains the return shape (columns, PK, FKs, indexes, stats), redaction behavior, and partial-failure handling. An agent has everything needed to call it and interpret results correctly.

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

Parameters4/5

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

Schema coverage is 100% so baseline is 3, and the description adds real value by explaining the per-table output semantics (column/constraint pairing by position, negative n_distinct meaning, common_values only for enum-like non-sensitive columns) that an agent otherwise could not infer. This goes beyond the single schema-documented parameter.

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 (describe) and resource (tables) with a clear batch scope ('several tables in one call'), and enumerates exactly what is returned: columns, PK, foreign keys, indexes, stats. Distinguishable from siblings like list_tables or query by its metadata-inspection focus.

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 rather than explicit: 'in one call' suggests batching over calling repeatedly, and the unknown-table error behavior is noted. But there is no explicit when-to-use-this-vs-alternative guidance relative to list_tables or query.

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