Unity Catalog metric views
manage_metric_viewsCreate, get, list, update, delete, or query Unity Catalog metric views from YAML. Run dimension/measure queries on a SQL warehouse.
Instructions
Manage Unity Catalog metric views (semantic layer) - implemented with documented SQL DDL.
create(full_name, yaml_definition): CREATE VIEW ... WITH METRICS LANGUAGE YAML AS $$...$$
get(full_name): YAML definition, columns and metadata.
list(catalog_name, schema_name): metric views in a schema.
update(full_name, yaml_definition): CREATE OR REPLACE - destructive, plan shows old vs new definition.
delete(full_name): DROP VIEW - destructive, needs confirm.
query(full_name, dimensions, measures, filters?, limit?): SELECT dims, MEASURE(m) ... GROUP BY dims. DDL and queries run on a SQL warehouse (warehouse_id optional).
Safety classification: create = WRITE; get, list = READ_ONLY; update, delete = DESTRUCTIVE+WRITE; query = EXECUTION+READ_ONLY.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | query: max rows. | |
| action | Yes | create / update (CREATE OR REPLACE) / delete a metric view from YAML; get: definition + metadata; list: metric views in a schema; query: SELECT dimensions + MEASURE(measures). | |
| confirm | No | Set to true ONLY after the user has reviewed the plan returned by a previous call with status 'confirmation_required'. Required for destructive/security-sensitive actions. | |
| dry_run | No | If true, validate and return the planned change without executing it. | |
| filters | No | query: [{dimension, op, value}] combined with AND; op in =, !=, <>, <, <=, >, >=, LIKE, NOT LIKE, IS NULL, IS NOT NULL. Values are bound as parameters. | |
| measures | No | query: measure names (wrapped in MEASURE()). | |
| full_name | No | Metric view name catalog.schema.view. | |
| page_size | No | Max items to return (server caps this). | |
| dimensions | No | query: dimension names to group by. | |
| page_token | No | next_page_token from a previous response. | |
| schema_name | No | list: schema. | |
| catalog_name | No | list: catalog. | |
| warehouse_id | No | SQL warehouse (default: configured/auto-selected). | |
| yaml_definition | No | create/update: the metric view YAML (e.g. version, source, dimensions[{name, expr}], measures[{name, expr}], optional filter/joins). Must not contain '$$'. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | ||
| page | No | ||
| plan | No | ||
| tool | Yes | ||
| action | No | ||
| safety | No | ||
| status | No | success | |
| summary | Yes | ||
| warnings | No | ||
| next_steps | No | Suggested follow-up calls. | |
| request_id | No |