Skip to main content
Glama

describe_table

Inspect a PostgreSQL table or view to retrieve columns, primary key, foreign keys, indexes, and an estimated row count; returns an explicit error if the relation is missing.

Instructions

Describe one table or view: columns, primary key, foreign keys, indexes and an instant row-count estimate. Fails with an explicit error if the relation does not exist.

Input Schema

NameRequiredDescriptionDefault
tableYesTable name.
schemaNoSchema name; defaults to "public".
connection_idYesConnection id. See list_connections.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/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 reasonably well: it discloses the error contract ('fails with an explicit error if the relation does not exist') and flags that the row count is an 'instant estimate' rather than an exact count, which prevents misreading results. It does not mention permissions or that the operation is a pure read.

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, zero filler, with the output contents front-loaded and the failure mode appended as a secondary caveat. Every clause earns its place.

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?

An output schema exists, so return values need no prose explanation, and the inputs are fully documented in the schema. The remaining gap is that, with no annotations present, the description never states this is a non-mutating read or what access it requires.

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 100%, with defaults and a pointer to list_connections already documented, so the schema does the heavy lifting. The description only adds that the target may be a view, which is a small but real clarification.

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?

Specific verb plus resource ('Describe one table or view') followed by an enumeration of exactly what is returned (columns, primary key, foreign keys, indexes, row-count estimate). This clearly separates it from list_tables and search_schema, though it never names those siblings 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?

There is no explicit 'use this when...' statement or exclusion of alternatives; usage is only implied by the word 'one' versus the collection-oriented siblings. An agent can infer the intent (inspect a single relation's structure) but must reason about it.

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