describeTable
describeTableInspect a table or view to retrieve its columns, types, nullability, defaults, comments, keys, indexes, constraints, and triggers. Returns complete metadata for one database object.
Instructions
Inspect one known table or view. Use for its fields/columns, types, nullability, defaults, comments, keys, indexes, constraints or triggers. Returns full metadata for that object only; use tableContext when nearby relationships or joins are also needed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | ||
| schema | No | ||
| connection | Yes | Database to run against. Call listConnections for valid names; do not guess. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | ||
| type | No | Described object type, such as TABLE, VIEW, or MATERIALIZED VIEW. | |
| schema | No | ||
| columns | No | Column list in database order; for keys, indexes, and joins the order is significant. | |
| indexes | No | Indexes available on the table or returned by an index-statistics scan. | |
| remarks | No | Database comment or description attached to the object, when the driver exposes it. | |
| triggers | No | Triggers attached to the table, usually without full body unless requested (opaque). | |
| primaryKey | No | ||
| foreignKeys | No | Outgoing foreign keys declared by the table. | |
| referencedBy | No | Incoming foreign keys from other tables that reference this table (opaque). | |
| checkConstraints | No | CHECK constraints declared on the table, with raw expression and parsed allowed values when available. | |
| uniqueConstraints | No | Unique constraints declared on the table. |