detect_anomalies
Scan a table for unusual patterns: volume drops/spikes, data gaps, value concentration, high null rates, stale data. Severity-ranked alerts. Tables > 100k rows use a sampled path (~5%) — when a finding has sampled:true, surface it to the user with a hedge like 'based on a ~5% sample' rather than presenting the number as exact. Dialect-aware: TABLESAMPLE SYSTEM on postgres, TABLESAMPLE PERCENT on mssql, WHERE RAND() on mysql.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | Table to scan for anomalies | |
| connection | No | Target connection name from this tenant's inventory. Call `list_connections` to see every name + dialect, then match semantically to the user's intent (e.g. 'analytics' → a connection named `*-analytics-*`; 'prod' → a connection with `prod-` prefix). If the user didn't specify, use the tenant's default (first added). Do not invent names — resolve from `list_connections` output. | |
| date_column | No | Date column for trend analysis (auto-detected if omitted) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | ||
| meta | No | ||
| display | No | ||
| summary | No | ||
| insights | No |