Monitoring advisor

From monte-carlo-data/mc-agent-toolkit · View interactive version

Monitoring advisor is an AI agent skill from the GitHub repository monte-carlo-data/mc-agent-toolkit. Analyze data coverage, create monitors for warehouse tables and AI agents. Covers coverage gaps, use-case analysis, data monitor creation, and agent observability.

How to use this skill

Skill file

Monte Carlo Monitoring Advisor Skill

This skill handles all monitoring requests -- coverage analysis, data monitor creation, and AI agent monitoring. It routes to the right reference file based on the user's intent.

Monte Carlo tool routing (required): For Monte Carlo operations such as search, get_asset

and get_monitors, use the tool ID your client exposes on the connection for the intended

account. Proceed when there is one suitable connection and no evidence of an account or source

mismatch. If the choice is ambiguous, ask which connection to use before making a Monte Carlo

call; if you can't get an answer, leave the call pending. Use the selected connection throughout.

If it is unavailable or lacks the operation, follow this skill's fallback where it has one, or

report what is missing.

<!-- plugin-only:start -->

With the Agent Toolkit plugin: When using the toolkit plugin or its installer, prefer the

connection it provides or configures (normally named monte-carlo-mcp) when it is suitable for the

intended account. If you know that connection is missing, confirm the intended alternative before

using another one.

<!-- plugin-only:end -->

Reference files live next to this skill file. Use the Read tool (not MCP resources) to access them:

When to activate this skill

Activate when the user:

"set up performance monitoring for my agent", or asks for an agent latency SLO

When NOT to activate this skill

Do not activate when the user is:


Prerequisites


Available MCP tools

All tools are available via the monte-carlo-mcp MCP server.

Coverage and discovery tools

| Tool | Purpose |

| --- | --- |

| get_warehouses | List accessible warehouses (needed first -- get_use_cases requires warehouse_id) |

| get_use_cases | List use cases with criticality, descriptions, table counts, precomputed tag names |

| get_use_case_table_summary | Criticality distribution (HIGH/MEDIUM/LOW table counts) for a use case |

| get_use_case_tables | Paginated tables with criticality, golden-table status, MCONs |

| get_monitors | Check monitoring status on specific tables via mcons filter |

| get_asset_lineage | Upstream/downstream dependencies for tables (takes MCONs + direction) |

| get_audiences | List notification audiences |

| get_unmonitored_tables_with_anomalies | Tables with muted OOTB anomalies but no monitors (takes ISO 8601 time range) |

| search | Find tables by name; supports is_monitored filter |

| get_asset | Table details, fields, stats, domain membership |

| get_queries | Query logs for a table (source/destination) or an ETL job |

| get_field_metric_definitions | Available metrics per field type for a warehouse |

| get_domains | List Monte Carlo domains |

| get_validation_predicates | Available validation rule types |

Data monitor creation tools

All five tools follow a two-call preview-then-confirm pattern: the first call (with the default dry_run=True) returns rendered MaC YAML for review; the second call (dry_run=False) deploys the monitor live and returns a deep link to it. Pass monitor_uuid on either call to update an existing monitor in place instead of creating a new one. See references/data-monitor-creation.md for the full flow.

| Tool | Purpose |

| --- | --- |

| create_or_update_table_monitor | Create or update a table monitor (preview YAML on dry_run=True, deploy on dry_run=False) |

| create_or_update_metric_monitor | Create or update a metric monitor (preview YAML on dry_run=True, deploy on dry_run=False) |

| create_or_update_validation_monitor | Create or update a validation monitor (preview YAML on dry_run=True, deploy on dry_run=False) |

| create_or_update_sql_monitor | Create or update a custom SQL monitor (preview YAML on dry_run=True, deploy on dry_run=False) |

| create_or_update_comparison_monitor | Create or update a comparison monitor (preview YAML on dry_run=True, deploy on dry_run=False) |

Data product tool

| Tool | Purpose |

| --- | --- |

| create_or_update_data_product | Create or update a data product — a named grouping of warehouse assets with reliability tracking (asset-footprint preview on dry_run=True, live create on dry_run=False). Used by the agent Context pillar to wrap an agent's upstream tables (see references/agent-monitor-creation.md) |

Agent monitoring tools

| Tool | Purpose |

| --- | --- |

| get_agent_metadata | List AI agents -- returns agent names, agentReference values (the agent arg for monitor creation), trace table MCONs, source types, backend classes (backend_class), and each agent's warehouse_uuid/warehouse_name (the warehouse arg -- show the name, pass the uuid) |

| get_agent_conversations | List recent conversations for an agent (newest first; filter by errors/status/turns/tokens/duration; optional inline transcripts) |

| get_agent_conversation | Retrieve one conversation's full prompt/completion thread by conversation_id |

| get_agent_traces | List traces with per-trace workflows, tasks, models, LLM-call counts, tokens, duration, and error counts |

| get_agent_trace | Inspect one execution trace's full span tree |

| get_agent_segments | Enumerate the distinct workflow / task / model values to scope a monitor to a real segment |

| create_or_update_agent_metric_monitor | Create or update monitors for quantitative span-level metrics (preview YAML on dry_run=True, deploy on dry_run=False) |

| create_or_update_agent_evaluation_monitor | Create or update monitors for LLM-evaluated quality metrics (preview YAML on dry_run=True, deploy on dry_run=False) |

| create_or_update_agent_trajectory_monitor | Create or update trajectory monitors for execution pattern alerts (preview YAML on dry_run=True, deploy on dry_run=False) |

| create_or_update_agent_validation_monitor | Create or update validation monitors for logical assertions (preview YAML on dry_run=True, deploy on dry_run=False) |


Routing

When the user's request comes in, determine which workflow to follow:

| User intent | Workflow |

| --- | --- |

| Coverage analysis, use-case exploration, "what should I monitor?" | Coverage workflow (below) |

| Create a specific data monitor for a known table | Read references/data-monitor-creation.md and follow its procedure |

| Monitor AI agents, agent latency, agent quality, agent traces | Read references/agent-monitor-creation.md and follow its procedure — propose coverage across the four POBC pillars (Performance, Output, Behavior, Context) |

| Coverage analysis leads to monitor creation | Complete coverage workflow, then read references/data-monitor-creation.md for creation |

When reading reference files, always use the Read tool with the path relative to this skill file.


Coverage workflow

This is the primary flow when the user asks about monitoring coverage, coverage gaps, or what to monitor.

Step 1: Discover warehouses

Call get_warehouses to list all accessible warehouses.

Step 2: Discover use cases

Call get_use_cases(warehouse_id=<selected>) to discover use cases for the chosen warehouse.

Step 3: Check for database MCP (optional)

Check if the user has a database MCP server available by looking for tools containing snowflake, bigquery, redshift, or databricks in the tool list. If found, note it for the SQL profiling step later. If not found, skip SQL profiling gracefully.


Use-case exploration

This is the primary flow when use cases are defined.

Present use cases

"Create a use case" requests

You cannot create use cases -- they are generated automatically by Monte Carlo (along with their criticality), and there is no tool to author one. When the user asks to "create", "set up", or "define" a use case: briefly say so, and do NOT silently substitute monitor deployment. Then offer what you can do for the table(s) they named -- look up the existing use case / criticality, recommend field monitors, generate monitor previews, or analyze coverage gaps -- and act on the do-able part without expanding to sibling tables.

Analyze coverage

  1. Call get_use_case_table_summary to show how many tables exist at each criticality level (HIGH / MEDIUM / LOW) for the use case.
  2. Call get_use_case_tables to obtain table MCONs, then call get_monitors(mcons=[...]) to report how many are already monitored vs. not.
  3. Default to HIGH + MEDIUM criticality scope. This covers the most important tables without overwhelming the user. Do NOT ask the user which scope to use -- just proceed. If they want LOW-criticality tables included, they'll ask.
  4. You may suggest covering multiple use cases in one session.
  5. Bias toward action, not questions. When the scope is clear (HIGH + MEDIUM for the selected use case), proceed directly to generating monitor previews for all recommended monitors. Frame it as opt-out, not opt-in: "I'll generate previews for all N monitors -- tell me if you want to skip any." Do NOT ask "which would you like me to create?" one at a time -- batch them.

Identify coverage gaps with anomaly data

Use get_unmonitored_tables_with_anomalies to discover tables that are not monitored but already have muted out-of-the-box anomalies. This reveals real coverage gaps -- places where Monte Carlo detected data issues but no monitor was configured to alert anyone.


Importance-based fallback

When no use cases are defined, fall back to importance-based table discovery.

  1. Find unmonitored tables: Use search(query="", is_monitored=false) to find unmonitored tables sorted by importance.
  2. Find tables with anomalies: Use get_unmonitored_tables_with_anomalies with a recent time window (last 14-30 days) to find tables with recent anomalies but no monitors.
  3. Inspect top candidates: Use get_asset to check table details, fields, and stats for the most important unmonitored tables.
  4. Understand criticality via lineage: Use get_asset_lineage with direction="DOWNSTREAM" to understand which tables are most connected -- a table with many downstream dependents is a stronger candidate for monitoring.
  5. Prioritize: Rank candidates by importance score and anomaly activity. Present the top candidates to the user with reasoning.

Important


SQL profiling (optional)

If a database MCP server was detected in Step 3 of the coverage workflow:

  1. Call get_queries to see recent query patterns on candidate tables.
  2. Use the database MCP tools (e.g. snowflake_query, bigquery_query) to profile table usage -- identify which tables are queried most frequently, which columns are used in JOINs and WHERE clauses.
  3. Use this information to refine monitor suggestions -- heavily-queried tables with no monitors are high-priority gaps.

If no database MCP is available, skip this step entirely. Do not ask the user to configure one.


Pre-creation context (coverage-driven)

When coverage analysis leads to monitor creation, gather this context before reading the creation reference file:

  1. Dedup first. Before generating a use-case tag monitor, call get_monitors with the same tag pair (and monitor_types=["TABLE"]) you'd put in the monitor's asset_selection.filters. If a monitor already covers that (tag, domain) scope, surface it (description, uuid) and ask whether to update it (pass its monitor_uuid), add one with a distinct scope, or skip -- do NOT silently re-create. The backend upserts a table monitor on its (description, domain), so a same-description definition silently overwrites the prior monitor's settings.
  2. Call get_audiences to list notification audiences. Suggest one or more relevant audiences (match by team or use-case context) and ask the user which they want -- they can pick one or several. This is the one question to ask before generating; do NOT also ask about draft/active or schedule. Default to draft (is_draft=True); the user can flip to active after seeing the preview.
  3. When passing audiences or failure_audiences, use the audience name/label (not UUID), as a list -- one entry per selected audience.
  4. Never fabricate credit costs. Do not give a generic per-monitor or per-field MC credit rate -- cost scales with the specific spec (segmentation, schedule, field count). If a preview response includes a backend estimate (e.g. estimated_credits.credits_per_day), report that; otherwise decline and offer to preview a specific monitor or use case to get the real estimate.

Use-case tag monitors

The most common output of coverage analysis is a table monitor scoped by use-case tags via create_or_update_table_monitor. The asset_selection parameter uses this structure:

{
  "databases": ["<database_name>"],
  "schemas": ["<schema_name>"],
  "filters": [
    {
      "type": "TABLE_TAG",
      "table_tags": ["<tag_key>:<criticality>"],
      "table_tags_operator": "HAS_ANY"
    }
  ]
}

Rules:

Monitor title (`description`) and reasoning (`notes`)

Keep these distinct -- both are accepted by the creation tools. The backend auto-generates the monitor name slug; description is the title users see.

Example for a use-case tag monitor:


Transient and truncate-and-reload tables

Some tables show 0 rows when queried directly but have recent write activity in Monte Carlo metadata. These are transient tables -- fully replaced on each pipeline run (truncate-and-reload pattern). Recognize this pattern early to avoid wasting time querying empty tables.

Signs of a transient table:


Graceful degradation

Handle missing or unavailable tools gracefully:

| Scenario | Behavior |

| --- | --- |

| No use cases defined | Fall back to importance-based discovery |

| No database MCP available | Skip SQL profiling, rely on MC tools only |

| get_unmonitored_tables_with_anomalies returns empty | Note that no recent anomalies were found; proceed with use-case or importance-based prioritization |

| get_use_case_tables returns no tables | Note the use case has no tables; suggest exploring other use cases |

| get_audiences returns empty | Inform user no audiences are configured; monitors can still be created without notification routing |

| User has no warehouses | Inform user that no warehouses are accessible; they may need to check their Monte Carlo permissions |

Never error out or stop the conversation because one tool returned empty results. Explain what happened and offer the next best path.


Rules

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.