Skip to main content

Schema & Exploration Tools

13 tools for exploring database schemas, table structures, column distributions, and relationships — 10 schema/exploration tools plus 3 relationship tools.


list_tables

Compact one-line-per-table overview of all tables in a database.

Parameters:

ParameterTypeRequiredDescription
connectionstringYesConnection name
schemastringNoFilter to a specific schema

Returns: Table name, schema, column count, PK count, FK count, row count.

When to use: First call in any exploration session. Orients you in the schema before drilling in.


describe_table

Full column detail for a single table.

Parameters:

ParameterTypeRequiredDescription
connectionstringYesConnection name
tablestringYesTable name (with schema if needed)

Returns: Per-column: name, data type, nullability, PK/FK flag, any PII annotation.


explore_table

Deep-dive into a table: column details + FK references + sample values + referenced tables.

Parameters:

ParameterTypeRequiredDescription
connectionstringYesConnection name
tablestringYesTable name
sample_rowsintegerNoNumber of sample rows to return (default: 5)

Returns: Full column metadata, FK relationships, sample rows, tables that reference this table.


explore_column

Distinct values with counts and NULL stats for a single column. Supports an optional LIKE filter.

Parameters:

ParameterTypeRequiredDescription
connectionstringYesConnection name
tablestringYesTable name
columnstringYesColumn name
filterstringNoLIKE pattern to filter distinct values
limitintegerNoMax distinct values to return (default: 50)

Returns: Distinct values with row counts, percentages, NULL count, total distinct count.

When to use: Before filtering on a categorical column — understand what values exist.


explore_columns

Multi-column statistics in a single call.

Parameters:

ParameterTypeRequiredDescription
connectionstringYesConnection name
tablestringYesTable name
columnsarrayYesList of column names to profile

Returns: Per-column: distinct count, uniqueness ratio, min/max/avg (numeric), NULL count, sample values.

When to use: Data profiling — understand the shape of multiple columns at once.


schema_overview

Database-wide summary: table count, total rows, FK density, hub tables.

Parameters:

ParameterTypeRequiredDescription
connectionstringYesConnection name

Returns: Table count, total rows, FK density (FKs per table), most-connected tables.


schema_ddl

Full schema as CREATE TABLE DDL statements with FK constraints.

Parameters:

ParameterTypeRequiredDescription
connectionstringYesConnection name
schemastringNoFilter to a specific schema
tablestringNoFilter to a single table

Returns: DDL string. Useful for feeding schema context into prompts or comparing schemas.


schema_statistics

High-level statistics: table sizes and FK connectivity, sorted by row count.

Parameters:

ParameterTypeRequiredDescription
connectionstringYesConnection name

Returns: Per-table row count, size estimate, FK in/out count — sorted largest to smallest.


schema_diff

Compare the current schema against the last cached version. Returns DDL-level changes.

Parameters:

ParameterTypeRequiredDescription
connectionstringYesConnection name

Returns: Added tables, removed tables, modified tables (columns added/removed/changed), FK changes.

When to use: After a migration or dbt model promotion — verify only expected changes landed.


get_date_boundaries

Return MIN/MAX dates across all DATE and TIMESTAMP columns in a table or database.

Parameters:

ParameterTypeRequiredDescription
connectionstringYesConnection name
tablestringNoSpecific table (omit for database-wide scan)

Returns: Per-column MIN/MAX date boundaries.

When to use: Before writing date-range queries — anchor to actual data dates, not current_date.


Relationships

get_relationships

Return the full ERD for a database: all FK relationships as arrows or adjacency list.

Parameters:

ParameterTypeRequiredDescription
connectionstringYesConnection name
formatstringNoarrows or adjacency (default: arrows)

Returns: All FK relationships in the specified format.


find_join_path

Discover FK-based join paths between two tables. Searches up to 6 hops.

Parameters:

ParameterTypeRequiredDescription
connectionstringYesConnection name
from_tablestringYesSource table
to_tablestringYesTarget table
max_hopsintegerNoMaximum join hops (default: 6)

Returns: List of join paths with intermediate tables and join conditions.


Find tables relevant to a natural-language question. Maps NL → schema.

Parameters:

ParameterTypeRequiredDescription
connectionstringYesConnection name
questionstringYesNatural-language question
top_kintegerNoNumber of tables to return (default: 5)

Returns: Ranked list of relevant tables with relevance scores.