Skip to main content
Glama

Unity Catalog metric views

manage_metric_views
Destructive

Create, 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

TableJSON Schema
NameRequiredDescriptionDefault
limitNoquery: max rows.
actionYescreate / update (CREATE OR REPLACE) / delete a metric view from YAML; get: definition + metadata; list: metric views in a schema; query: SELECT dimensions + MEASURE(measures).
confirmNoSet 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_runNoIf true, validate and return the planned change without executing it.
filtersNoquery: [{dimension, op, value}] combined with AND; op in =, !=, <>, <, <=, >, >=, LIKE, NOT LIKE, IS NULL, IS NOT NULL. Values are bound as parameters.
measuresNoquery: measure names (wrapped in MEASURE()).
full_nameNoMetric view name catalog.schema.view.
page_sizeNoMax items to return (server caps this).
dimensionsNoquery: dimension names to group by.
page_tokenNonext_page_token from a previous response.
schema_nameNolist: schema.
catalog_nameNolist: catalog.
warehouse_idNoSQL warehouse (default: configured/auto-selected).
yaml_definitionNocreate/update: the metric view YAML (e.g. version, source, dimensions[{name, expr}], measures[{name, expr}], optional filter/joins). Must not contain '$$'.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNo
pageNo
planNo
toolYes
actionNo
safetyNo
statusNosuccess
summaryYes
warningsNo
next_stepsNoSuggested follow-up calls.
request_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Goes well beyond the aggregate annotations by disambiguating per-action safety: create=WRITE; get/list=READ_ONLY; update/delete=DESTRUCTIVE+WRITE; query=EXECUTION+READ_ONLY. It also discloses that update is CREATE OR REPLACE with a plan showing old vs new, that delete requires confirm, and that DDL/queries execute on a SQL warehouse. This is exactly the added context annotations cannot provide.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loads the purpose in one line, then uses a tight per-action bullet list, ending with a compact safety classification line. Every sentence carries signal with no repetition of schema text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With 14 params, a full output schema, and annotations present, the description fills all remaining gaps: action semantics, per-action safety, confirmation flow, and execution target. Nothing needed to invoke the tool correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3, but the description adds value by mapping parameters to actions (e.g., create(full_name, yaml_definition), query(full_name, dimensions, measures, filters?, limit?)) and noting warehouse_id is optional. This clarifies which params apply to which action beyond the per-param schema text.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource (managing Unity Catalog metric views / semantic layer) and enumerates every action with its signature, so an agent knows exactly what the tool operates on and which actions exist. It is clearly distinguishable from generic siblings like execute_sql or manage_uc_objects.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Each action is annotated with its intent (create/update/delete from YAML, get returns definition+metadata, list enumerates, query runs SELECT dims + MEASURE). It also states that confirm is required for destructive actions, giving clear per-action context. It stops short of naming when to prefer this over sibling tools like execute_sql, so not a full 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.