dashboards
Use when creating or extending Costory dashboards, generating interesting FinOps overviews (suggest_groupby + suggest_usage_metrics + text widgets), adding or replacing widgets, copying widgets between dashboards, editing dashboardContext (global filter / period / groupBy) via update_dashboard, or applying shared-context inheritance for period, groupBy, metric, currency, and CEL filters. Call get_skill with skillId \"dashboards\" before create_dashboard or update_dashboard.
costory-io · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add costory-io/costory-finops-mcp-skills --skill dashboards技能说明
name: dashboards description: "Use when creating or extending Costory dashboards, generating interesting FinOps overviews (suggest_groupby + suggest_usage_metrics + text widgets), adding or replacing widgets, copying widgets between dashboards, editing dashboardContext (global filter / period / groupBy) via update_dashboard, or applying shared-context inheritance for period, groupBy, metric, currency, and CEL filters. Call get_skill with skillId "dashboards" before create_dashboard or update_dashboard."
Dashboards
A DashboardV2 has a shared dashboardContext input (global theme) and widgets that inherit it by default. Each widget is either a chart (Advanced Explorer queries + chartType) or a text block (type: "text", textContent).
Context-first rule: define the full dashboardContext before listing widgets. Widgets should contain only overrides — never duplicate what already lives in dashboardContext. If two or more widgets share the same period, groupBy, metric, currency, or filter scope, extract that shared value to dashboardContext first.
Temporary compatibility: the deprecated top-level
contextalias is accepted during migration, but always generatedashboardContext. Never send both.
When to Trigger
- Creating a new Costory dashboard
- Generating an interesting overview when the user has not specified every widget (use How to generate interesting dashboards below)
- Adding, replacing, or removing widgets on an existing dashboard
- Editing
dashboardContext(global filter, period, groupBy, metric, currency) without recreating - Copying a widget to another dashboard
- User asks for a cost overview "by service / by region" style dashboard
Dashboard dashboardContext fields
| Field | Role | Widget inheritance |
|---|---|---|
metricId | Default cost column (e.g. "cost") | Cost widgets omit metricId to inherit |
currency | USD, EUR, GBP, CNY | Cost widgets omit currency to inherit |
groupBy | Default split dimension — use when most widgets share the same axis | Cost widgets omit groupBy to inherit (or set null explicitly for totals) |
datePreset or startDate/endDate | Dashboard period — required when chart widgets are present (text-only dashboards may omit). Prefer datePreset whenever an available preset matches the requested range | Widgets omit from/to/datePreset to inherit |
conditionsCel | Dashboard-wide CEL filter (scope) | AND-merged into every cost widget by default |
scopeId | Optional saved scope | Inherited like other context fields |
Each query still needs "type": "cost" (query kind — not inherited). What you omit on cost widgets is metricId, currency, groupBy, and period when they match dashboardContext.
Inheritance semantics
- Period, metricId, currency, groupBy: omit on widgets when they match
dashboardContext. - Similarity rule: when widgets or dashboards are very similar, identify the common
datePreset/dates,groupBy,metricId,currency, andconditionsCelbefore writing widgets. Put common values indashboardContext; widget fields are for exceptions only. groupBy: omit the field to inheritdashboardContext.groupBy; setgroupBy: nullto explicitly disable grouping for that widget.- Period presets: if the user's range maps to an available
DatePreset(for exampleTRAILING_30_DAYS,TRAILING_90_DAYS,LAST_MONTH,YTD), usedashboardContext.datePreset. UsestartDate/endDateonly for truly custom ranges. conditionsCel: inherited by default. Every cost widget AND-merges dashboardconditionsCelwith its ownfilterCel.extendDashboardConditions: defaults totrue(inherit dashboard filter). Setfalseonly when the widget must ignore the dashboard filter entirely.- Widget
filterCel: widget-specific scope only — do not put the dashboard-wide filter here; put it indashboardContext.conditionsCel.
Widget types
Two top-level widget kinds in create_dashboard / update_dashboard:
| Kind | How to identify | Required fields |
|---|---|---|
| Chart | omit type, or "type": "chart" | title, queries (each with type + name), usually aggBy |
| Text | "type": "text" | title, textContent (markdown or plain text) |
Chart widget — queries[].chartType
Set chartType on each series (cost / metric / usage / formula / budget / externalMetric). Omit → LINE. Primary series for sizing = first non-formula query (else first query).
chartType | Use when | Typical aggBy | Notes |
|---|---|---|---|
BAR | Categorical / stacked spend over time | Day / Week / Month | Default for breakdowns ("by service", "by region") |
LINE | Trends / continuous evolution | Day / Week / Month | MCP default if chartType omitted |
AREA | Filled trend (e.g. budget vs spend) | Day / Week / Month | Budget queries often default to AREA in the product |
TABLE | Tabular breakdown / many groups | any | Needs more grid space; also a valid compare.chartType |
WATERFALL | Rare as a series chartType | — | Prefer enabling comparison via widget compare (default comparison render is WATERFALL) |
Donut (composition for one period): there is no separate DONUT enum. Use chartType: "BAR" + widget aggBy: "Period" (and a groupBy). That is the product donut.
Time series vs period comparison
These are different modes — pick one per widget based on the question.
| Mode | What it answers | How to configure | Prefer when the user asks… |
|---|---|---|---|
| Time series | How cost (or a metric) evolves within one period | No compare. Series chartType: BAR / LINE / AREA. aggBy: Day / Week / Month | "trend", |