Skip to main content
Glama

Describe table

describe
Read-onlyIdempotent

Inspect a table's columns, types, keys, defaults, foreign keys, indexes, and referencing tables before writing SQL.

Instructions

Show the structure of one known table: columns with type, nullability, key, default, foreign-key target (fk = table.column — use it to write JOINs) and comment, plus indexes and the tables that reference it. Use it before writing SQL against a table; use search_schema if you don't know the table name yet. Returns table, sql_name (properly quoted name for SQL), columns[N]{name,type,nullable,key,default,fk,comment}, indexes[N]{name,unique,columns} and referenced_by[N]{table,column,ref_column}. On failure returns isError with 'error: ' (e.g. refused statement, unknown table, SQL error).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
tableYesTable or view name as returned by `tables`. PostgreSQL tables outside `public` are written schema.table.
databaseNoOptional database to use instead of the connection's default (names from `databases`). Omit to use the default.
connectionYesConnection name exactly as returned by `connections` (e.g. "shop"). Unknown or unexposed names return an error.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.2.2
    • changedInput schema / properties / connection / description
      Previous value: -"Connection name (from `connections`)"New value: +"Connection name exactly as returned by `connections` (e.g. \"shop\"). Unknown or unexposed names return an error."
    • changedInput schema / properties / database / description
      Previous value: -"Database name to use instead of the connection's default (optional)"New value: +"Optional database to use instead of the connection's default (names from `databases`). Omit to use the default."
    • changedInput schema / properties / table / description
      Previous value: -"Table name (PostgreSQL: schema.table outside public)"New value: +"Table or view name as returned by `tables`. PostgreSQL tables outside `public` are written schema.table."
  2. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare the safe read/idempotent profile, and the description goes further by disclosing the failure contract (isError with 'error: <reason>', e.g. refused statement, unknown table) and the meaning of the fk field for JOIN authoring — behavioral context beyond the structured fields.

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 purpose, then usage, then return shape, then error semantics — every sentence carries information. It is dense and the return-shape clause is long, but nothing is redundant enough to cut.

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?

With no output schema, the description takes on the return-value burden itself by spelling out the payload fields, and it also covers the error path. An agent has everything needed to call it and interpret the result.

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%, so the schema already documents table/database/connection (including the schema.table and default-connection conventions). The description only lightly reinforces this via 'one known table'; baseline 3 is appropriate.

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 and resource ('Show the structure of one known table') and enumerates exactly what is returned (columns, indexes, referenced_by), which lets an agent distinguish it from search_schema and tables without opening the schema.

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

Usage Guidelines5/5

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

Gives explicit when-to-use ('Use it before writing SQL against a table') and names the alternative plus its selecting condition ('use search_schema if you don't know the table name yet'), leaving nothing to inference.

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