get_table_schema
Retrieve detailed schema metadata for a specific table, including columns, data types, constraints, indexes, and foreign key relationships.
Instructions
Get detailed schema for a specific table.
Returns complete table metadata including columns, data types, constraints, indexes, and declared foreign key relationships.
Args: connection_id: Connection ID from connect_database table_name: Name of the table. May be dotted (e.g. 'schema.table' or 'catalog.schema.table') and is resolved against the dialect. schema_name: Schema name. Defaults to the dialect's default schema (e.g. 'dbo' on MSSQL) when omitted. include_indexes: Include index information (default: True) include_relationships: Include declared foreign keys (default: True) catalog: Optional Databricks catalog name. Overrides the connection's default catalog. Rejected on non-Databricks dialects (raises an error).
Returns: TOON-encoded string with table schema details:
status: "success" | "error"
table: object // on success only
table_name: string
schema_name: string
columns: list
column_name: string
ordinal_position: int
data_type: string
max_length: int | null
is_nullable: bool
default_value: string | null
is_identity: bool
is_computed: bool
is_primary_key: bool
is_foreign_key: bool
indexes: list // if include_indexes=True
index_name: string
is_unique: bool
is_primary_key: bool
is_clustered: bool
columns: list of string
included_columns: list of string
foreign_keys: list // if include_relationships=True
constraint_name: string | null
source_columns: list of string
target_schema: string
target_table: string
target_columns: list of string
error_message: string // on error only
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| catalog | No | ||
| table_name | Yes | ||
| schema_name | No | ||
| connection_id | Yes | ||
| include_indexes | No | ||
| include_relationships | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |