HG Data Warehouse Catalog
The v2 MCP API is in preview and not yet generally available. These pages document its tools and request/response shapes; live data access is limited to enrolled organizations until v2 is released.
Browse the HG Insights data warehouse SCHEMA (table/column names and types, join keys, indexing hints, sql_qualifier) to plan an hg_data_query — returns schema metadata, NOT data rows. This is the required first step before writing SQL. The schema is stable — call once per session and cache it.
TWO MODES: (1) ORIENTATION (default, table_names OMITTED): a lightweight index of ALL tables, each as {name, sql_qualifier, description} only — no columns, join keys, sample queries, or relationships. The cheap first call; use it to discover which tables exist, then drill in. (2) DETAIL (table_names SET): full metadata for the named tables (columns, order_by, primary_key, join_keys, common_filters, mandatory_predicate, sample_queries) plus the relationship edges touching them. The columns and include_sample_queries params apply in DETAIL mode only.
Use this when:
- Discovering which tables and columns exist before writing SQL for hg_data_query.
- Confirming a column's exact name, type, or join key, or a table's sql_qualifier, before referencing it.
- Mapping table relationships to plan a multi-table join.
Do NOT use this when:
- You want to RUN a query and get rows back — call hg_data_query (this tool returns schema only).
- You need product/technology taxonomy VALUES (category, vendor, attribute, or product names/IDs) — call get_product_category, get_vendor_information, or get_product_attribute; those describe HG's product catalog, not warehouse table schemas.
Credits
Free — No credits consumed. See the full credit table for how AI Credits work.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
table_names | array | - | Exact table names from a prior orientation call (lowercase, underscores; e.g. ["install_global", "company_locations"]). Returns FULL detail for them (columns, join keys, sample queries) plus the relationship edges that touch any of them — an edge is included when EITHER endpoint is in the requested set, not only when both are. Omit for a lightweight ORIENTATION index of all tables ({name, sql_qualifier, description} only, empty relationships[]). An unknown name errors (422) and names the bad entries — call with no table_names first to see valid names. |
columns | string | important | Column verbosity. Applies only when table_names is set — an unscoped call always returns the compact orientation index (name/sql_qualifier/description only). none=strips column definitions AND projection/index blocks (projection_details, skip_indexes, indexed_filters); order_by/primary_key/mandatory_predicate kept. important=curated most-important columns with full indexing metadata (default). full=every column live from ClickHouse system.columns (many have no description). |
include_sample_queries | boolean | true | Include curated worked SQL examples per table. Applies only when table_names is set. Set false to reduce token usage. |
Required Integrations
This tool is only available when your organization has the following integration configured in the Phoenix Integrations settings:
- HG Insights (Data API) (
hginsights_v2__data_api)
Use Cases
- List every table in the HG data warehouse before deciding what to query
- Get the exact columns and types on company_spend to build a SQL SELECT for hg_data_query
- Confirm the join keys and grain of install_global before joining it to company_locations
- Look up a cross-db table's sql_qualifier (e.g. products) to write a correct FROM clause
- Discover the relationship edges around a table to plan a multi-table join
Example Usage
Orientation: list all tables (cheap first call)
{
"tool": "hg_catalog",
"arguments": {}
}
Full detail for one table with sample queries
{
"tool": "hg_catalog",
"arguments": {
"table_names": [
"company_spend"
]
}
}
Compact detail for a join: columns only, no sample queries
{
"tool": "hg_catalog",
"arguments": {
"table_names": [
"install_global",
"company_locations"
],
"columns": "none",
"include_sample_queries": false
}
}
Response Format
| Field | Type | Description |
|---|---|---|
tables | array | Available tables in the HG Insights data warehouse. In ORIENTATION mode (no table_names) each entry carries only name, sql_qualifier, and description; pass table_names for the full per-table metadata (columns, join_keys, sample_queries, etc.). |
tables[].name | string | |
tables[].sql_qualifier | any | Database prefix required in FROM, or null for default-database tables. Build the full reference as: sql_qualifier ? ${sql_qualifier}.${name} : name. Example: products → sql_qualifier="hg_statics" → FROM hg_statics.products. |
tables[].description | string | |
tables[].row_count_approx | string | Approximate row count, e.g. "426M". |
tables[].engine | string | ClickHouse storage engine. |
tables[].order_by | array | ORDER BY sort key columns (primary sort key for ClickHouse MergeTree). |
tables[].primary_key | array | |
tables[].projections | array | Alternate sort-order projection names that can accelerate specific query patterns. |
tables[].mandatory_predicate | any | If set, every query touching this table must include a WHERE predicate on this column to avoid a full-table scan. |
tables[].columns | array | Column definitions (empty when columns=none). |
tables[].columns[].name | string | |
tables[].columns[].type | string | ClickHouse column type. |
tables[].columns[].description | string | |
tables[].columns[].important | boolean | |
tables[].join_keys | array | Columns typically used to join this table to other tables. |
tables[].common_filters | array | Columns most commonly used in WHERE predicates. |
tables[].sample_queries | array | Curated worked SQL examples (empty when include_sample_queries=false). |
tables[].sample_queries[].description | string | |
tables[].sample_queries[].sql | string | |
relationships | array | Join graph edges. When table_names is set, scoped to edges where from_table OR to_table is in the requested set (an edge touching any requested table is included). When table_names is omitted (orientation mode), this is EMPTY — pass table_names to get the join graph. Use this to discover how tables relate before writing multi-table queries. |
relationships[].from_table | string | |
relationships[].from_column | string | |
relationships[].to_table | string | |
relationships[].to_column | string | |
relationships[].type | string | Cardinality, e.g. "many_to_one". |
Related Tools
hg_data_query, get_product_category, get_vendor_information, get_product_attribute