opencode-skills-collection 2.0.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/bundled-skills/.antigravity-install-manifest.json +6 -1
  2. package/bundled-skills/docs/integrations/jetski-cortex.md +3 -3
  3. package/bundled-skills/docs/integrations/jetski-gemini-loader/README.md +1 -1
  4. package/bundled-skills/docs/maintainers/repo-growth-seo.md +3 -3
  5. package/bundled-skills/docs/maintainers/skills-update-guide.md +1 -1
  6. package/bundled-skills/docs/users/bundles.md +1 -1
  7. package/bundled-skills/docs/users/claude-code-skills.md +1 -1
  8. package/bundled-skills/docs/users/gemini-cli-skills.md +1 -1
  9. package/bundled-skills/docs/users/getting-started.md +1 -1
  10. package/bundled-skills/docs/users/kiro-integration.md +1 -1
  11. package/bundled-skills/docs/users/usage.md +4 -4
  12. package/bundled-skills/docs/users/visual-guide.md +4 -4
  13. package/bundled-skills/manage-skills/SKILL.md +187 -0
  14. package/bundled-skills/monte-carlo-monitor-creation/SKILL.md +222 -0
  15. package/bundled-skills/monte-carlo-monitor-creation/references/comparison-monitor.md +426 -0
  16. package/bundled-skills/monte-carlo-monitor-creation/references/custom-sql-monitor.md +207 -0
  17. package/bundled-skills/monte-carlo-monitor-creation/references/metric-monitor.md +292 -0
  18. package/bundled-skills/monte-carlo-monitor-creation/references/table-monitor.md +231 -0
  19. package/bundled-skills/monte-carlo-monitor-creation/references/validation-monitor.md +404 -0
  20. package/bundled-skills/monte-carlo-prevent/SKILL.md +252 -0
  21. package/bundled-skills/monte-carlo-prevent/references/TROUBLESHOOTING.md +23 -0
  22. package/bundled-skills/monte-carlo-prevent/references/parameters.md +32 -0
  23. package/bundled-skills/monte-carlo-prevent/references/workflows.md +478 -0
  24. package/bundled-skills/monte-carlo-push-ingestion/SKILL.md +363 -0
  25. package/bundled-skills/monte-carlo-push-ingestion/references/anomaly-detection.md +87 -0
  26. package/bundled-skills/monte-carlo-push-ingestion/references/custom-lineage.md +203 -0
  27. package/bundled-skills/monte-carlo-push-ingestion/references/direct-http-api.md +207 -0
  28. package/bundled-skills/monte-carlo-push-ingestion/references/prerequisites.md +150 -0
  29. package/bundled-skills/monte-carlo-push-ingestion/references/push-lineage.md +160 -0
  30. package/bundled-skills/monte-carlo-push-ingestion/references/push-metadata.md +158 -0
  31. package/bundled-skills/monte-carlo-push-ingestion/references/push-query-logs.md +219 -0
  32. package/bundled-skills/monte-carlo-push-ingestion/references/validation.md +257 -0
  33. package/bundled-skills/monte-carlo-push-ingestion/scripts/sample_verify.py +357 -0
  34. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/bigquery/collect_and_push_lineage.py +70 -0
  35. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/bigquery/collect_and_push_metadata.py +65 -0
  36. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/bigquery/collect_and_push_query_logs.py +70 -0
  37. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/bigquery/collect_lineage.py +214 -0
  38. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/bigquery/collect_metadata.py +160 -0
  39. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/bigquery/collect_query_logs.py +164 -0
  40. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/bigquery/push_lineage.py +198 -0
  41. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/bigquery/push_metadata.py +193 -0
  42. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/bigquery/push_query_logs.py +207 -0
  43. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/bigquery-iceberg/collect_and_push_metadata.py +71 -0
  44. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/bigquery-iceberg/collect_and_push_query_logs.py +64 -0
  45. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/bigquery-iceberg/collect_metadata.py +253 -0
  46. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/bigquery-iceberg/collect_query_logs.py +149 -0
  47. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/bigquery-iceberg/push_metadata.py +190 -0
  48. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/bigquery-iceberg/push_query_logs.py +208 -0
  49. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/databricks/collect_and_push_lineage.py +83 -0
  50. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/databricks/collect_and_push_metadata.py +77 -0
  51. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/databricks/collect_and_push_query_logs.py +83 -0
  52. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/databricks/collect_lineage.py +240 -0
  53. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/databricks/collect_metadata.py +212 -0
  54. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/databricks/collect_query_logs.py +204 -0
  55. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/databricks/push_lineage.py +192 -0
  56. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/databricks/push_metadata.py +178 -0
  57. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/databricks/push_query_logs.py +200 -0
  58. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/hive/collect_and_push_lineage.py +119 -0
  59. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/hive/collect_and_push_metadata.py +119 -0
  60. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/hive/collect_and_push_query_logs.py +117 -0
  61. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/hive/collect_lineage.py +265 -0
  62. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/hive/collect_metadata.py +313 -0
  63. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/hive/collect_query_logs.py +284 -0
  64. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/hive/push_lineage.py +309 -0
  65. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/hive/push_metadata.py +245 -0
  66. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/hive/push_query_logs.py +255 -0
  67. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/redshift/collect_and_push_lineage.py +78 -0
  68. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/redshift/collect_and_push_metadata.py +80 -0
  69. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/redshift/collect_and_push_query_logs.py +88 -0
  70. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/redshift/collect_lineage.py +235 -0
  71. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/redshift/collect_metadata.py +219 -0
  72. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/redshift/collect_query_logs.py +239 -0
  73. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/redshift/push_lineage.py +178 -0
  74. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/redshift/push_metadata.py +178 -0
  75. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/redshift/push_query_logs.py +196 -0
  76. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/snowflake/collect_and_push_lineage.py +154 -0
  77. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/snowflake/collect_and_push_metadata.py +137 -0
  78. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/snowflake/collect_and_push_query_logs.py +137 -0
  79. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/snowflake/collect_lineage.py +349 -0
  80. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/snowflake/collect_metadata.py +329 -0
  81. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/snowflake/collect_query_logs.py +254 -0
  82. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/snowflake/push_lineage.py +307 -0
  83. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/snowflake/push_metadata.py +228 -0
  84. package/bundled-skills/monte-carlo-push-ingestion/scripts/templates/snowflake/push_query_logs.py +248 -0
  85. package/bundled-skills/monte-carlo-push-ingestion/scripts/test_template_sdk_usage.py +340 -0
  86. package/bundled-skills/monte-carlo-validation-notebook/SKILL.md +685 -0
  87. package/bundled-skills/monte-carlo-validation-notebook/scripts/generate_notebook_url.py +141 -0
  88. package/bundled-skills/monte-carlo-validation-notebook/scripts/resolve_dbt_schema.py +161 -0
  89. package/package.json +1 -1
  90. package/skills_index.json +503 -61
@@ -0,0 +1,292 @@
1
+ # Metric Monitor Reference
2
+
3
+ Detailed reference for building `createMetricMonitorMac` tool calls.
4
+
5
+ ## When to Use
6
+
7
+ Use a metric monitor when the user wants to:
8
+
9
+ - Track row count changes over time
10
+ - Monitor null rates, unique counts, or other statistical metrics on specific fields
11
+ - Detect anomalies in numeric distributions (mean, max, min, percentiles)
12
+ - Monitor data freshness (time since last row count change)
13
+ - Segment metrics by dimensions (e.g., by country, status)
14
+
15
+ ---
16
+
17
+ ## Required Parameters
18
+
19
+ | Parameter | Type | Description |
20
+ |-----------|------|-------------|
21
+ | `name` | string | Unique identifier for the monitor. Use a descriptive slug (e.g., `orders_null_check`). |
22
+ | `description` | string | Human-readable description of what the monitor checks. |
23
+ | `table` | string | Table MCON (preferred) or `database:schema.table` format. If not MCON, also pass `warehouse`. |
24
+ | `aggregate_time_field` | string | **MUST be a real timestamp/datetime column from the table.** NEVER guess this value. |
25
+ | `alert_conditions` | array | List of alert condition objects (see Alert Conditions below). |
26
+
27
+ ## Optional Parameters
28
+
29
+ | Parameter | Type | Default | Description |
30
+ |-----------|------|---------|-------------|
31
+ | `warehouse` | string | auto-resolved | Warehouse name or UUID. Required if `table` is not an MCON. |
32
+ | `segment_fields` | array of string | none | Fields to group/segment metrics by (e.g., `["country", "status"]`). |
33
+ | `aggregate_by` | string | `"day"` | Time interval: `"hour"`, `"day"`, `"week"`, `"month"`. |
34
+ | `where_condition` | string | none | SQL WHERE clause (without `WHERE` keyword) to filter rows before computing metrics. |
35
+ | `interval_minutes` | int | auto | Schedule interval in minutes. Must be compatible with `aggregate_by` (see note below). If not specified, the tool defaults to the minimum valid interval for the chosen `aggregate_by`. |
36
+ | `domain_id` | string (uuid) | none | Domain UUID (use `getDomains` to list). |
37
+
38
+ ---
39
+
40
+ ## Schedule and Aggregation Compatibility
41
+
42
+ The schedule interval must be compatible with `aggregate_by`. Daily aggregation requires an interval that is a multiple of 1440 minutes (24 hours), weekly requires a multiple of 10080, etc. If you pass `interval_minutes`, make sure it satisfies this constraint. If you omit it, the tool picks a sensible default.
43
+
44
+ | `aggregate_by` | Minimum `interval_minutes` | Default if omitted |
45
+ |---|---|---|
46
+ | `hour` | 60 | 60 |
47
+ | `day` | 1440 | 1440 |
48
+ | `week` | 10080 | 10080 |
49
+ | `month` | 43200 | 43200 |
50
+
51
+ For example, to run a daily-aggregated monitor every other day, pass `aggregate_by: "day"` and `interval_minutes: 2880`.
52
+
53
+ ---
54
+
55
+ ## Choosing the Timestamp Field
56
+
57
+ The `aggregate_time_field` is the most critical parameter. It MUST be a real column from the table that contains timestamp or datetime values. This is the number one source of monitor creation failures.
58
+
59
+ ### How to pick it
60
+
61
+ 1. You should already have the column names from `getTable` with `include_fields: true` (done in Step 2 of the main skill).
62
+ 2. Look for columns whose names suggest a timestamp: `created_at`, `updated_at`, `modified_at`, `timestamp`, `event_timestamp`, or columns with `_ts`, `_dt`, `_time` suffixes, or `date`, `datetime`.
63
+ 3. If the user specified one, verify it exists in the column list.
64
+ 4. If exactly one obvious candidate exists, suggest it.
65
+ 5. If multiple candidates exist, present them and ask the user.
66
+ 6. If NO obvious timestamp columns exist, suggest a custom SQL monitor instead (which does not need a timestamp field).
67
+
68
+ **NEVER** proceed without confirming the timestamp field exists in the table schema.
69
+
70
+ ### Common timestamp field mistakes
71
+
72
+ - **Using a DATE column (not TIMESTAMP):** This may work, but aggregation granularity is limited. For example, `aggregate_by: "hour"` is meaningless on a DATE column because the time component is always midnight. Warn the user and default to `aggregate_by: "day"` or coarser.
73
+ - **Using a field that contains many nulls:** If the timestamp column has significant null values, rows with null timestamps are excluded from aggregation windows, producing unreliable or misleading results. Check the column's null rate from `getTable` field stats if available, and warn the user if it is high.
74
+ - **Guessing a field name that does not exist:** Always verify the column name against the `getTable` output. A typo or assumed name (e.g., `created_date` when the actual column is `created_at`) causes the monitor creation to fail silently or error.
75
+
76
+ ---
77
+
78
+ ## Field-Type-to-Metric Compatibility Matrix
79
+
80
+ **Before selecting a metric, check the column's data type from `getTable` results.** Passing a metric incompatible with the column type is the most common source of creation failures after timestamp issues.
81
+
82
+ | Column Type | Compatible Metrics |
83
+ |-------------|-------------------|
84
+ | **Numeric** (int, float, decimal, bigint) | `NUMERIC_MEAN`, `NUMERIC_MEDIAN`, `NUMERIC_MIN`, `NUMERIC_MAX`, `NUMERIC_STDDEV`, `SUM`, `ZERO_COUNT`, `ZERO_RATE`, `NEGATIVE_COUNT`, `NEGATIVE_RATE`, `NULL_COUNT`, `NULL_RATE`, `UNIQUE_COUNT`, `UNIQUE_RATE`, `DUPLICATE_COUNT` |
85
+ | **String / Text** (varchar, char, text) | `TEXT_MAX_LENGTH`, `TEXT_MIN_LENGTH`, `TEXT_MEAN_LENGTH`, `TEXT_INT_RATE`, `TEXT_NUMBER_RATE`, `TEXT_UUID_RATE`, `TEXT_EMAIL_ADDRESS_RATE`, `EMPTY_STRING_COUNT`, `EMPTY_STRING_RATE`, `NULL_COUNT`, `NULL_RATE`, `UNIQUE_COUNT`, `UNIQUE_RATE`, `DUPLICATE_COUNT` |
86
+ | **Boolean** | `TRUE_COUNT`, `FALSE_COUNT`, `NULL_COUNT`, `NULL_RATE` |
87
+ | **Timestamp / Date** | `FUTURE_TIMESTAMP_COUNT`, `PAST_TIMESTAMP_COUNT`, `UNIX_ZERO_TIMESTAMP_COUNT`, `NULL_COUNT`, `NULL_RATE`, `UNIQUE_COUNT`, `UNIQUE_RATE` |
88
+ | **Any type** | `NULL_COUNT`, `NULL_RATE`, `UNIQUE_COUNT`, `UNIQUE_RATE`, `DUPLICATE_COUNT` |
89
+
90
+ ### Rules
91
+
92
+ - **NEVER** apply `NUMERIC_*`, `SUM`, `ZERO_*`, or `NEGATIVE_*` metrics to string, boolean, or timestamp columns.
93
+ - **NEVER** apply `TEXT_*` or `EMPTY_STRING_*` metrics to numeric, boolean, or timestamp columns.
94
+ - **NEVER** apply `TRUE_COUNT` or `FALSE_COUNT` to non-boolean columns.
95
+ - **NEVER** apply `FUTURE_TIMESTAMP_COUNT`, `PAST_TIMESTAMP_COUNT`, or `UNIX_ZERO_TIMESTAMP_COUNT` to non-timestamp columns.
96
+ - When in doubt, `NULL_COUNT`, `NULL_RATE`, `UNIQUE_COUNT`, and `UNIQUE_RATE` are safe for any column type.
97
+
98
+ ---
99
+
100
+ ## Alert Conditions
101
+
102
+ Each alert condition has:
103
+
104
+ | Field | Type | Required | Description |
105
+ |-------|------|----------|-------------|
106
+ | `metric` | string | Yes | The metric to monitor (see Metrics Reference below). |
107
+ | `operator` | string | Yes | `"AUTO"` (anomaly detection), `"GT"`, `"LT"`, `"EQ"`, `"GTE"`, `"LTE"`, `"NE"`. |
108
+ | `threshold` | number | For explicit operators | The threshold value. Required when using `GT`, `LT`, `EQ`, `GTE`, `LTE`, or `NE`. Not used with `AUTO`. |
109
+ | `fields` | array of string | Depends | Column names to apply the metric to. Required for field-level metrics. Not needed for table-level metrics. |
110
+
111
+ ---
112
+
113
+ ## Operator Guidance
114
+
115
+ ### When to use `AUTO` (anomaly detection)
116
+
117
+ - Best when you do not know the expected range of values and want Monte Carlo's ML to learn normal patterns and alert on deviations.
118
+ - Works well for organic metrics that vary day-to-day (row counts, null rates on evolving data, numeric distributions).
119
+ - Some metrics **require** `AUTO` -- see the table below.
120
+
121
+ ### When to use explicit thresholds (`GT`, `LT`, `EQ`, `GTE`, `LTE`, `NE`)
122
+
123
+ - Use when there is a known business rule or data contract (e.g., "null rate on `email` should never exceed 5%", "order amount must always be greater than 0").
124
+ - Provides deterministic alerting -- no training period needed, alerts fire immediately when the condition is met.
125
+ - Requires a `threshold` value in the alert condition.
126
+
127
+ ### Operator restrictions by metric
128
+
129
+ | Metric | Allowed Operators | Notes |
130
+ |--------|-------------------|-------|
131
+ | `ROW_COUNT_CHANGE` | `AUTO` only | Anomaly detection on row count delta. |
132
+ | `TIME_SINCE_LAST_ROW_COUNT_CHANGE` | `AUTO` only | Anomaly detection on staleness duration. |
133
+ | `RELATIVE_ROW_COUNT` | `AUTO` only | Anomaly detection on segment distribution. Requires `segment_fields`. |
134
+ | All other metrics | `AUTO`, `GT`, `LT`, `EQ`, `GTE`, `LTE`, `NE` | Any operator is valid. |
135
+
136
+ ---
137
+
138
+ ## Metrics Reference
139
+
140
+ ### Table-level metrics (no `fields` needed)
141
+
142
+ | Metric | Operator | Description |
143
+ |--------|----------|-------------|
144
+ | `ROW_COUNT_CHANGE` | Must use `AUTO` | Alert on anomalous changes in total row count. |
145
+ | `TIME_SINCE_LAST_ROW_COUNT_CHANGE` | Must use `AUTO` | Alert when the table has not been updated for an unusual duration. |
146
+
147
+ ### Field-level metrics (must specify `fields`)
148
+
149
+ | Metric | Column Types | Description |
150
+ |--------|-------------|-------------|
151
+ | `NULL_COUNT` | Any | Count of null values. |
152
+ | `NULL_RATE` | Any | Rate of null values (0.0 to 1.0). |
153
+ | `UNIQUE_COUNT` | Any | Count of distinct values. |
154
+ | `UNIQUE_RATE` | Any | Rate of distinct values (0.0 to 1.0). |
155
+ | `DUPLICATE_COUNT` | Any | Count of duplicate (non-unique) values. |
156
+ | `EMPTY_STRING_COUNT` | String/Text | Count of empty string values. |
157
+ | `EMPTY_STRING_RATE` | String/Text | Rate of empty string values. |
158
+ | `NUMERIC_MEAN` | Numeric | Mean of numeric field. |
159
+ | `NUMERIC_MEDIAN` | Numeric | Median of numeric field. |
160
+ | `NUMERIC_MIN` | Numeric | Minimum value of numeric field. |
161
+ | `NUMERIC_MAX` | Numeric | Maximum value of numeric field. |
162
+ | `NUMERIC_STDDEV` | Numeric | Standard deviation of numeric field. |
163
+ | `SUM` | Numeric | Sum of numeric field. |
164
+ | `ZERO_COUNT` | Numeric | Count of zero values. |
165
+ | `ZERO_RATE` | Numeric | Rate of zero values. |
166
+ | `NEGATIVE_COUNT` | Numeric | Count of negative values. |
167
+ | `NEGATIVE_RATE` | Numeric | Rate of negative values. |
168
+ | `TRUE_COUNT` | Boolean | Count of true values. |
169
+ | `FALSE_COUNT` | Boolean | Count of false values. |
170
+ | `TEXT_MAX_LENGTH` | String/Text | Maximum string length. |
171
+ | `TEXT_MIN_LENGTH` | String/Text | Minimum string length. |
172
+ | `TEXT_MEAN_LENGTH` | String/Text | Mean string length. |
173
+ | `TEXT_INT_RATE` | String/Text | Rate of values parseable as integers. |
174
+ | `TEXT_NUMBER_RATE` | String/Text | Rate of values parseable as numbers. |
175
+ | `TEXT_UUID_RATE` | String/Text | Rate of values matching UUID format. |
176
+ | `TEXT_EMAIL_ADDRESS_RATE` | String/Text | Rate of values matching email format. |
177
+ | `FUTURE_TIMESTAMP_COUNT` | Timestamp/Date | Count of timestamps in the future. |
178
+ | `PAST_TIMESTAMP_COUNT` | Timestamp/Date | Count of timestamps unreasonably far in the past. |
179
+ | `UNIX_ZERO_TIMESTAMP_COUNT` | Timestamp/Date | Count of timestamps equal to Unix epoch zero (1970-01-01). |
180
+
181
+ ### Segmentation metric
182
+
183
+ | Metric | Operator | Description |
184
+ |--------|----------|-------------|
185
+ | `RELATIVE_ROW_COUNT` | Must use `AUTO` | Alert on anomalous changes in distribution across segments. MUST use `segment_fields`. |
186
+
187
+ ---
188
+
189
+ ## Examples
190
+
191
+ ### Row count anomaly detection
192
+
193
+ ```json
194
+ {
195
+ "name": "orders_row_count",
196
+ "description": "Detect anomalous changes in daily order volume",
197
+ "table": "MCON++a1b2c3d4-e5f6-7890-abcd-ef1234567890++1++1++analytics:core.orders",
198
+ "aggregate_time_field": "created_at",
199
+ "aggregate_by": "day",
200
+ "alert_conditions": [
201
+ {
202
+ "metric": "ROW_COUNT_CHANGE",
203
+ "operator": "AUTO"
204
+ }
205
+ ]
206
+ }
207
+ ```
208
+
209
+ ### Null monitoring on specific fields
210
+
211
+ ```json
212
+ {
213
+ "name": "orders_null_check",
214
+ "description": "Alert when email or user_id nulls exceed 50 per day",
215
+ "table": "MCON++a1b2c3d4-e5f6-7890-abcd-ef1234567890++1++1++analytics:core.orders",
216
+ "aggregate_time_field": "created_at",
217
+ "aggregate_by": "day",
218
+ "alert_conditions": [
219
+ {
220
+ "metric": "NULL_COUNT",
221
+ "operator": "GT",
222
+ "threshold": 50,
223
+ "fields": ["email", "user_id"]
224
+ }
225
+ ]
226
+ }
227
+ ```
228
+
229
+ ### Segmented monitoring
230
+
231
+ ```json
232
+ {
233
+ "name": "orders_by_country_distribution",
234
+ "description": "Detect anomalous shifts in order distribution across countries",
235
+ "table": "MCON++a1b2c3d4-e5f6-7890-abcd-ef1234567890++1++1++analytics:core.orders",
236
+ "aggregate_time_field": "created_at",
237
+ "aggregate_by": "day",
238
+ "segment_fields": ["country"],
239
+ "alert_conditions": [
240
+ {
241
+ "metric": "RELATIVE_ROW_COUNT",
242
+ "operator": "AUTO"
243
+ }
244
+ ]
245
+ }
246
+ ```
247
+
248
+ ### Numeric range monitoring with filter
249
+
250
+ ```json
251
+ {
252
+ "name": "completed_orders_amount_check",
253
+ "description": "Detect anomalous max order amounts for completed orders",
254
+ "table": "MCON++a1b2c3d4-e5f6-7890-abcd-ef1234567890++1++1++analytics:core.orders",
255
+ "aggregate_time_field": "created_at",
256
+ "aggregate_by": "day",
257
+ "where_condition": "status = 'completed'",
258
+ "alert_conditions": [
259
+ {
260
+ "metric": "NUMERIC_MAX",
261
+ "operator": "AUTO",
262
+ "fields": ["amount"]
263
+ }
264
+ ]
265
+ }
266
+ ```
267
+
268
+ ### Multiple alert conditions in one monitor
269
+
270
+ ```json
271
+ {
272
+ "name": "payments_quality_check",
273
+ "description": "Monitor payment amount stats and null rate on transaction_id",
274
+ "table": "MCON++a1b2c3d4-e5f6-7890-abcd-ef1234567890++1++1++warehouse:billing.payments",
275
+ "aggregate_time_field": "processed_at",
276
+ "aggregate_by": "day",
277
+ "domain_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
278
+ "alert_conditions": [
279
+ {
280
+ "metric": "NUMERIC_MEAN",
281
+ "operator": "AUTO",
282
+ "fields": ["amount"]
283
+ },
284
+ {
285
+ "metric": "NULL_RATE",
286
+ "operator": "GT",
287
+ "threshold": 0.01,
288
+ "fields": ["transaction_id"]
289
+ }
290
+ ]
291
+ }
292
+ ```
@@ -0,0 +1,231 @@
1
+ # Table Monitor Reference
2
+
3
+ Detailed reference for building `createTableMonitorMac` tool calls.
4
+
5
+ ## When to Use
6
+
7
+ Use a table monitor when the user wants to:
8
+
9
+ - Monitor many tables at once across an entire database or schema
10
+ - Track freshness (when was each table last updated?)
11
+ - Detect schema changes (columns added, removed, or type-changed)
12
+ - Monitor volume changes (row count anomalies) across a broad set of tables
13
+ - Apply broad coverage with anomaly detection (no custom thresholds needed)
14
+
15
+ **Do NOT use a table monitor when the user wants to:**
16
+
17
+ - Track field-level metrics on a single table (use a metric monitor)
18
+ - Apply custom thresholds or explicit operators like GT/LT (use a metric monitor)
19
+ - Validate row-level business rules or referential integrity (use a validation monitor)
20
+
21
+ ---
22
+
23
+ ## Required Parameters
24
+
25
+ | Parameter | Type | Description |
26
+ |-----------|------|-------------|
27
+ | `name` | string | Unique identifier for the table monitor. Must be unique across all table monitors in the same namespace. |
28
+ | `description` | string | Human-readable description of what the monitor checks (max 512 characters). |
29
+ | `warehouse` | string | Warehouse name or UUID. Use `getTable` or `search` to find it. |
30
+ | `asset_selection` | object | Asset selection config defining which tables to monitor (see Asset Selection below). |
31
+
32
+ ## Optional Parameters
33
+
34
+ | Parameter | Type | Default | Description |
35
+ |-----------|------|---------|-------------|
36
+ | `alert_conditions` | array of strings | `["last_updated_on", "schema", "total_row_count", "total_row_count_last_changed_on"]` | Metric names to monitor (see Alert Conditions below). |
37
+ | `domain_id` | string (uuid) | none | Domain UUID (use `getDomains` to list). |
38
+
39
+ ---
40
+
41
+ ## Pre-Step: Verify Warehouse
42
+
43
+ Before creating a table monitor, resolve the warehouse name or UUID. The `warehouse` parameter is required and must match an existing warehouse in the Monte Carlo account.
44
+
45
+ 1. If the user provides a table name, call `getTable` to retrieve the table details -- the response includes the warehouse name and UUID.
46
+ 2. If the user provides a database or schema name without a specific table, call `search` with the database or schema name to find assets and identify the warehouse.
47
+ 3. Use either the warehouse name or UUID in the `warehouse` parameter.
48
+
49
+ **NEVER guess the warehouse value.** If you cannot resolve it, ask the user.
50
+
51
+ ---
52
+
53
+ ## Asset Selection
54
+
55
+ The `asset_selection` object defines which tables the monitor covers. It must include a `databases` list.
56
+
57
+ **Use database and schema scoping to select which tables to monitor.** This is the reliable approach and covers most use cases.
58
+
59
+ > **Known limitation:** The MCP tool supports `filters` and `exclusions` parameters, but the tool's schema describes the wrong format for them. Until this is fixed ([K2-269](https://linear.app/montecarlodata/issue/K2-269)), **do not pass `filters` or `exclusions`** — they will cause errors. Use database/schema scoping instead to narrow the set of monitored tables. If the user needs regex or pattern-based filtering, explain this limitation and suggest either (a) using schema-level scoping to get close, or (b) creating individual metric monitors for specific tables.
60
+
61
+ ### Database-Level Selection
62
+
63
+ To monitor all tables in an entire database, specify only the database name with no `schemas` list:
64
+
65
+ ```json
66
+ {
67
+ "databases": [
68
+ {"name": "analytics"}
69
+ ]
70
+ }
71
+ ```
72
+
73
+ This monitors every table in every schema within the `analytics` database.
74
+
75
+ ### Schema-Level Selection
76
+
77
+ To monitor all tables in specific schemas, include the `schemas` list:
78
+
79
+ ```json
80
+ {
81
+ "databases": [
82
+ {
83
+ "name": "analytics",
84
+ "schemas": ["core", "staging"]
85
+ }
86
+ ]
87
+ }
88
+ ```
89
+
90
+ This monitors every table in the `core` and `staging` schemas within `analytics`, but not tables in other schemas.
91
+
92
+ ### Multiple Databases
93
+
94
+ You can monitor tables across multiple databases in a single monitor:
95
+
96
+ ```json
97
+ {
98
+ "databases": [
99
+ {"name": "analytics", "schemas": ["core"]},
100
+ {"name": "raw_data"},
101
+ {"name": "reporting", "schemas": ["public", "internal"]}
102
+ ]
103
+ }
104
+ ```
105
+
106
+ ---
107
+
108
+ ## Alert Conditions
109
+
110
+ Alert conditions define which metrics the table monitor tracks. The operator is always AUTO (anomaly detection) -- custom thresholds are not available for table monitors.
111
+
112
+ | Metric | Description |
113
+ |--------|-------------|
114
+ | `last_updated_on` | Freshness monitoring. Alerts when a table has not been updated within its normal cadence. |
115
+ | `schema` | Any schema change. Alerts when columns are added, removed, or their types change. |
116
+ | `schema_fields_added` | New columns detected. Alerts only when new columns appear in the table. |
117
+ | `schema_fields_removed` | Columns removed. Alerts only when existing columns are dropped from the table. |
118
+ | `schema_fields_type_change` | Column type changes. Alerts only when a column's data type changes. |
119
+ | `total_row_count` | Row count changes. Alerts on anomalous changes in total row count. |
120
+ | `total_row_count_last_changed_on` | Time since last volume change. Alerts when the row count has not changed for an unusual duration. |
121
+
122
+ ### Notes
123
+
124
+ - **All operators are AUTO (anomaly detection).** Table monitors do not support custom thresholds like GT, LT, or explicit operators. If the user needs custom thresholds, use a metric monitor instead.
125
+ - **No `schedule` field.** Table monitors do not support the `schedule` field in MaC YAML. Adding it will cause a validation error on `montecarlo monitors apply`. Table monitor scheduling is managed automatically by Monte Carlo. Do NOT add a schedule block to the generated YAML.
126
+ - The default set (`last_updated_on`, `schema`, `total_row_count`, `total_row_count_last_changed_on`) provides broad coverage and is appropriate for most use cases. Only override the defaults when the user specifically requests a subset.
127
+ - `schema` is a superset of `schema_fields_added`, `schema_fields_removed`, and `schema_fields_type_change`. If using `schema`, there is no need to also include the granular schema metrics.
128
+
129
+ ---
130
+
131
+ ## Examples
132
+
133
+ ### Monitor all tables in a database (minimal config)
134
+
135
+ ```json
136
+ {
137
+ "name": "analytics_db_monitor",
138
+ "description": "Monitor all tables in the analytics database for freshness, schema changes, and volume",
139
+ "warehouse": "production_warehouse",
140
+ "asset_selection": {
141
+ "databases": [
142
+ {"name": "analytics"}
143
+ ]
144
+ }
145
+ }
146
+ ```
147
+
148
+ Uses the default alert conditions (`last_updated_on`, `schema`, `total_row_count`, `total_row_count_last_changed_on`).
149
+
150
+ ### Monitor specific schemas with default alerts
151
+
152
+ ```json
153
+ {
154
+ "name": "core_schemas_monitor",
155
+ "description": "Monitor all tables in core and reporting schemas",
156
+ "warehouse": "production_warehouse",
157
+ "asset_selection": {
158
+ "databases": [
159
+ {
160
+ "name": "analytics",
161
+ "schemas": ["core", "reporting"]
162
+ }
163
+ ]
164
+ }
165
+ }
166
+ ```
167
+
168
+ Monitors every table in the `core` and `reporting` schemas, leaving other schemas unmonitored.
169
+
170
+ ### Monitor multiple schemas across databases
171
+
172
+ ```json
173
+ {
174
+ "name": "prod_tables_monitor",
175
+ "description": "Monitor production tables across analytics and raw_data databases",
176
+ "warehouse": "production_warehouse",
177
+ "asset_selection": {
178
+ "databases": [
179
+ {
180
+ "name": "analytics",
181
+ "schemas": ["core", "reporting"]
182
+ },
183
+ {
184
+ "name": "raw_data",
185
+ "schemas": ["ingestion"]
186
+ }
187
+ ]
188
+ }
189
+ }
190
+ ```
191
+
192
+ Monitors tables in specific production schemas, leaving development and staging schemas unmonitored.
193
+
194
+ ### Schema change monitoring only
195
+
196
+ ```json
197
+ {
198
+ "name": "warehouse_schema_watch",
199
+ "description": "Track schema changes across the entire data warehouse",
200
+ "warehouse": "production_warehouse",
201
+ "asset_selection": {
202
+ "databases": [
203
+ {"name": "analytics"},
204
+ {"name": "raw_data"}
205
+ ]
206
+ },
207
+ "alert_conditions": [
208
+ "schema_fields_added",
209
+ "schema_fields_removed",
210
+ "schema_fields_type_change"
211
+ ]
212
+ }
213
+ ```
214
+
215
+ Monitors only schema changes (not freshness or volume) across multiple databases. Uses the granular schema metrics instead of `schema` to allow selectively enabling/disabling each type.
216
+
217
+ ---
218
+
219
+ ## Table Monitor vs Metric Monitor
220
+
221
+ | Aspect | Table Monitor | Metric Monitor |
222
+ |--------|---------------|----------------|
223
+ | **Scope** | Multiple tables (database/schema level) | Single table |
224
+ | **Metrics** | Freshness, schema changes, row count | Field-level metrics (null rate, mean, sum, etc.) |
225
+ | **Operator** | AUTO only (anomaly detection) | AUTO or explicit thresholds (GT, LT, EQ, etc.) |
226
+ | **Asset selection** | Database/schema with filters and exclusions | Single table specified by MCON or name |
227
+ | **Timestamp field** | Not required | Required (`aggregate_time_field`) |
228
+ | **Segmentation** | Not available | Available via `segment_fields` |
229
+ | **Best for** | Broad coverage, freshness, schema drift | Targeted field-level data quality checks |
230
+
231
+ **Rule of thumb:** If the user wants to monitor a specific field on a specific table with specific thresholds, use a metric monitor. If the user wants broad monitoring across many tables with automatic anomaly detection, use a table monitor.