跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
浏览器与自动化

cost-change-investigation

Use when investigating a cost change to explain what changed, when, and the best-supported drivers with contribution, timing, usage, metric, event, alert, and terminology evidence. Call get_skill with skillId \"cost-change-investigation\" before starting the investigation.

costory-io · 已有静态检查记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add costory-io/costory-finops-mcp-skills --skill cost-change-investigation

技能说明


name: cost-change-investigation description: "Use when investigating a cost change to explain what changed, when, and the best-supported drivers with contribution, timing, usage, metric, event, alert, and terminology evidence. Call get_skill with skillId "cost-change-investigation" before starting the investigation."

Cost Change Investigation

Role

You are a senior FinOps lead explaining a cost change to stakeholders.

Goal

  • Explain what changed, when, and the best-supported driver(s).
  • Produce a short client-facing summary and a developer-facing methodology.

What The Client Sees

The client sees the specific group-by label, numeric cost change, original cost, new cost, and the summary you generate.

Example:

  • AmazonAthena : +$2.66K, +8.29%, $32.05K → 34.71K | Costs increased because of ....

Rules:

  • Never mention numeric cost-change values already displayed for the client.
  • You may mention cost or usage metrics for the specific factor(s) that explain the change, for example:
    • Costs increased because of a 3x increase in Athena query usage.
    • Spending increased by $2500 in "specific api type".

Workflow

  1. Call MCP get_context first. Use query, search, list_events, list_alerts, list_metrics, and suggest_usage_metrics only when they add context, validate a driver, explain timing, or connect cost to usage.
    • Several organizations: if get_context returns "Multiple organizations" with a list of slugs, do not pick one. Ask the user which org to use (from that list or list_organizations), then pass that slug to get_context and the following tool calls. If the user already named the org (e.g. "org acme"), use that slug directly.
    • list_metrics and suggest_usage_metrics only discover what exists; query is how you actually pull them, as extra series alongside the cost ones ({"type": "metric", "metricId": ...} for business metrics, {"type": "usage", ...} for usage metrics), so a driver can be backed by the usage or business volume behind it.
    • list_alerts and list_events surface operational context (deployments, incidents, config changes) that can explain timing; check their content against the scenario, not just their dates.
  2. Use lookup_term_context(query=...) before relying on an unfamiliar or ambiguous term, column/group-by value, alert, event, metric, or phrase.
  3. Complete the analysis:
    • Call suggest_groupby() first. Choose relevant columns you want to investigate using max_prop_diff, top_changed, nunique, and total_cost.
    • Call find_cost_change_factors(columns=[...]) using the selected columns returned by the group-by suggestions. Retain its comparison_periods and where_clause.
    • Choose useful, non-obvious contributor_candidates using magnitude and nesting evidence.
    • Get timing evidence from MCP query: one cost series for the whole scenario scope, plus one series per contributor you want to time. Write each series' filterCel yourself, following "Building filterCel" below. Set from/to from comparison_periods, aggBy: "Day", and analyze: {"changePoint": true}. Keep it to at most 6 contributor series per call.
    • Read timing back from the response's changePoint entries, matching queryName to the series name you sent.
    • If weekend seasonality may hide some patterns, rerun the same call with ignoreWeekends and compare the evidence.
  4. Compare results with MCP evidence.
  5. Merge the strongest contribution, timing, terminology, and MCP evidence.

Tool Argument Formats

For find_cost_change_factors, pass one object per selected column, carrying only the column name from suggest_groupby as operand_1 — no expression, no label, no other key:

{
  "columns": [
    {"operand_1": "cos_service_name"},
    {"operand_1": "cos_charge_description"}
  ]
}

For change-point timing, call MCP query with one series per factor you want to investigate. Name series a, b, c, ... — the scope total first, then one per contributor — and remember which name is which factor, since that name is what the results come back under:

{
  "queries": [
    {"type": "cost", "name": "a", "metricId": "cost", "filterCel": "cos_provider in [\"AWS\"] && cos_service_name in [\"AmazonRDS\"]"},
    {"type": "cost", "name": "b", "metricId": "cost", "filterCel": "cos_provider in [\"AWS\"] && cos_service_name in [\"AmazonRDS\"] && cos_charge_description in [\"RDS:GP2-Storage\"]"}
  ],
  "from": "2026-04-01",
  "to": "2026-05-31",
  "aggBy": "Day",
  "analyze": {"changePoint": true}
}

Rules for that call:

  • Never set groupBy on a series you want change points for. Detection runs once per query on the sum of every group in that series, so grouping silently folds all groups into one curve and the periods you get back describe the aggregate, not any single group. Give each factor its own series with its own filterCel instead.
  • Span both comparison_periods (from is previous.start_date, to is current.end_date), not the current period alone, so the previous period stays visible in the series.
  • Sanity-check the scope-total series against the comparison_periods totals before reading any timing. find_cost_change_factors already proved this scope has spend that changed, so an all-zero series means the query missed that data rather than that spend was flat — it still returns isError: false and a no trend period with zero stats. Report that timing could not be retrieved; never call a contributor flat, stable, or unchanged on that evidence.

Building filterCel

Each series' filter is the scenario scope AND the contributor you are timing. Write the CEL yourself: translate the response's where_clause from SQL, and AND it with the contributor's {key, value} pairs. The scope-total series gets the scope alone.

Every key is a dimension name and every pair is an equality: key in ["value"], or key == null for a null or empty

阅读完整来源 ↗