Skip to main content
Glama

dq_explain_metric_change

Read-onlyIdempotent

Explains why a metric changed by comparing a window with its baseline and attributing the shift to dimension segments, so you can distinguish data problems like missing feeds from business changes.

Instructions

Explain why a metric moved: compare a window with its baseline, then attribute the change to segments.

For "revenue dropped 35% yesterday": gives the overall change and, per dimension, which segments account for it. A segment flagged 'missing in current window' usually means a feed did not load, which is a data problem rather than a business one.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "table": "<table>",
      "time_column": "<time_column>"
    },
    "name": "dq_explain_metric_change"
  }
}

Input Schema

NameRequiredDescriptionDefault
topNoSegments to return per dimension.
tableYesTable name from dq_list_sources, e.g. 'orders' or 'warehouse.main.orders'.
metricNo'count', or 'sum:col', 'avg:col', 'min:col', 'max:col', 'count_distinct:col'. E.g. 'sum:revenue'.count
dimensionsNoColumns to segment by, e.g. ['country', 'channel', 'source_system']. Each is analysed separately.
current_endNoISO date/time where it ends (exclusive). Defaults to one day after current_start.
time_columnYesTimestamp/date column that defines the windows.
current_startNoISO date/time where the window under investigation starts. Defaults to the latest day in the data.
baseline_windowsNoBaseline = mean of this many preceding windows of the same length. Use 7 with a 1-day window for a weekly-smoothed baseline.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior3/5

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

Annotations already declare readOnly, idempotent, non-destructive, closed-world, so the safety profile is covered. The description adds genuine interpretive value with the note that a segment 'missing in current window' usually signals a failed feed rather than a business change. It does not discuss cost, runtime, or how the baseline mean is computed beyond the schema's own wording.

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

Conciseness4/5

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

Two paragraphs, front-loaded with the core action, and the worked example earns its place by making the output shape concrete. The final sentence about feeds is useful but slightly tangential to invoking the tool.

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

Completeness4/5

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

With 8 parameters, full schema coverage, an output schema, and read-only annotations, the description supplies what the structured fields cannot: the analytical intent and how to read the 'missing in current window' signal. Only the absence of explicit alternative-routing guidance keeps it from being fully complete.

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

Parameters3/5

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

Schema description coverage is 100%, so every parameter including top, metric, dimensions, and baseline_windows is already documented in the schema. The description echoes the window-vs-baseline concept but adds no syntax, format, or edge-case detail beyond that, so the baseline of 3 applies.

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

Purpose4/5

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

The description states a specific verb and resource ('Explain why a metric moved') and then unpacks the mechanism: compare a window against a baseline, then attribute the change to segments. That distinguishes it in spirit from the check-style siblings (freshness, nulls, duplicates), though it never names an alternative explicitly.

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

Usage Guidelines3/5

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

Usage is conveyed by example only ('For "revenue dropped 35% yesterday"'), which effectively tells an agent the trigger scenario but never states when not to use this tool or which sibling to pick instead. No prerequisites or data-availability requirements are given.

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