Storage cost analysis

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

Storage cost analysis is an AI agent skill from the GitHub repository monte-carlo-data/mc-agent-toolkit. Analyze a warehouse for stale, unused, or redundant tables via the analyze_storage_costs MCP tool. Classifies waste patterns and table categories, computes safety tiers, and handles category drill-downs and lineage follow-ups.

How to use this skill

Skill file

Monte Carlo Storage Cost Analysis Skill

This skill analyzes a data warehouse for stale tables that can be removed to reduce storage costs. It delegates classification, safety scoring, and formatting to the analyze_storage_costs MCP tool, then presents the pre-formatted result verbatim and handles follow-up questions (category drill-downs, lineage checks).

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

analyze_storage_costs, get_asset_lineage and search, 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 file (use the Read tool to access it):

When to activate this skill

Activate when the user:

When NOT to activate this skill

Do not activate when the user is:

Prerequisites

The following MCP tools must be available (connect to Monte Carlo's MCP server):

The analyze_storage_costs tool supports Snowflake, BigQuery, Redshift, and Databricks warehouses only. Other warehouse types are out of scope.

Workflow

Important: These steps are internal instructions for you. Do NOT expose step numbers, step names, or the procedural structure to the user. Just act naturally.

Step 1: Identify the warehouse

You need a warehouse to proceed.

Step 2: Run the analysis

Call analyze_storage_costs with:

The tool fetches candidates, classifies them into waste patterns (Unread, Write-only, Dead-end, Static waste, Zombie, Other stale) and table categories (Temporary, Archive/Snapshot, Production, Other), computes safety tiers, and returns a formatted analysis.

Step 3: Present the initial summary

The tool output contains two regions:

  1. A <!-- PRESENT_AS_IS --> block with a condensed summary, a Top-N table, and a drill-down prompt.
  2. A <!-- CATEGORY_DETAILS --> block with per-category tables wrapped in <!-- CATEGORY:<key> --> markers. Do NOT present these yet.

Present ONLY the <!-- PRESENT_AS_IS --> block — copy it verbatim, preserving every column, row, and value. Add a brief intro sentence if needed, then paste the block unchanged. The user will see the summary and top tables, then choose a category to drill into.

CRITICAL — do NOT call any other tool after analyze_storage_costs succeeds. No search, no get_asset, no troubleshooting agents, no cross-checks. The analysis result IS the final answer; your only remaining job is to present the <!-- PRESENT_AS_IS --> block verbatim.

CRITICAL — preserve markdown-linked MCONs verbatim. The pre-formatted tables already contain properly linked MCONs (e.g., ` [db:schema.table](https://getmontecarlo.com/assets/MCON++...) `). Never output bare MCON strings as plain text.

Step 4: Handle follow-up requests

Category drill-downs. When the user asks about a specific category ("show me temporary tables", "what about production?", "tell me more about archive"):

  1. Find the matching <!-- CATEGORY:<key> --> section in the analyze_storage_costs result already in the conversation. Do NOT re-invoke analyze_storage_costs — the data is already there.
  2. Present that section's content verbatim — every column, row, and value.
  3. After presenting, remind the user of remaining categories they haven't explored yet.

Category keywords (see references/output-structure.md for the full list):

If the user says "show me everything" or "all categories", present all category sections in order: temporary → archive → uncategorized → production.

Lineage checks. When the user asks what consumes a specific table ("check lineage for X", "is it safe to remove Y?", "what depends on this table?"):

  1. Call get_asset_lineage with mcons: [<table mcon>] and direction: "DOWNSTREAM".
  2. If has_relationships: false → the table's consumers are likely BI dashboards or tools (not other tables). Mention this — it may still be safe to remove, but the user should verify with dashboard owners.
  3. If downstream tables exist AND are also stale → recommend removing both.
  4. If downstream tables are active → flag as risky, do NOT recommend removal.

Note: The N consumers flag in the Usage & Risk column counts ALL consumers, including BI dashboards (Looker, Tableau, Power BI) and other non-table assets. The lineage tool only returns table-to-table edges, so lineage results may show fewer consumers than the count. When that happens, explain the gap to the user.

Reading the Usage & Risk column

Each row's final Usage & Risk cell combines read-side activity with risk flags. Format:

{activity}                          # no flags fire
{activity}; {flag1, flag2, ...}     # one or more flags fire

Activity values (always present):

A low days since read is only meaningful when paired with the read count — a single backup job or security scanner can make a cold table look "1d". Always weigh staleness against reads + users.

Risk flags (appended after ; in this fixed order when any fire):

Table categories

Tables are automatically classified for prioritized review:

Scope limitations

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.