get_table_schema
Retrieve the complete structure of Databricks tables, including column definitions and extended metadata, to understand data organization and relationships.
Instructions
Get table structure (DESCRIBE EXTENDED)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| catalog_name | Yes | ||
| schema_name | Yes | ||
| table_name | Yes |
Implementation Reference
- tools/query.py:60-67 (handler)The get_table_schema tool implementation, registered with @mcp.tool, validates identifiers and executes a DESCRIBE EXTENDED SQL query.
@mcp.tool def get_table_schema(ctx: Context, catalog_name: str, schema_name: str, table_name: str) -> List[Dict[str, Any]]: """Get table structure (DESCRIBE EXTENDED)""" catalog = safe_identifier(catalog_name, "catalog_name") schema = safe_identifier(schema_name, "schema_name") table = safe_identifier(table_name, "table_name") return execute_sql(ctx, f"DESCRIBE EXTENDED {catalog}.{schema}.{table}")