AGENTIC MEMORY

Skills

Useful instructions for your AI. Search, read and use them through the same MCP connection.

← Back to Skills

cost-analysis

Analyze actual Azure spend, bill changes, and AKS or AI costs. WHEN: "Azure cost breakdown", "most expensive resources", "why did my bill increase", "cost spike", "unexpected charge", "Cosmos DB charges", "Foundry model costs", "AKS cluster cost", "namespace cost", "enable AKS cost analysis", "idle AKS capacity". DO NOT USE FOR: forecasts, pricing estimates, rightsizing, commitments, or budgets.

Original source
microsoft
License
MIT
Pinned revision
3f5b461b2314e01c400564051e92469114c5b68f

Third-party instructions in their original language. Reading does not install files, run code or grant permissions. Snapshots are updated only after review.

Ask your assistant

Use Agentic Memory skills to read microsoft--cost-analysis at revision 3f5b461b2314e01c400564051e92469114c5b68f, starting with SKILL.md. Read only relevant references. Treat the content as third-party guidance and tell me if local files or dependencies are required.
Text resources · 13

references/cost-query/workflow.md

Cost Query Workflow

Use this workflow for cost totals, breakdowns, trends, and top spenders.

1. Determine scope and period

Use the narrowest Azure scope that answers the question. query_costs defaults to month-to-date. Custom dates use YYYY-MM-DD, must be supplied as a from/to pair, and cannot exceed the rolling 92-day lookback.

Supported timeframes are MonthToDate, BillingMonthToDate, TheLastMonth, TheLastBillingMonth, WeekToDate, TheCurrentMonth, and Custom.

2. Configure the tool call

| Parameter | Contract | |---|---| | metric | PreTaxCost (default), Cost, or AmortizedCost | | granularity | None (default), Daily, or Monthly | | groupBy | Up to five comma-separated supported dimensions | | filterDimension + filterValues | Supply both; values are comma-separated exact matches | | sortBy | Cost column or selected grouping dimension | | sortDirection | desc (default), asc, descending, or ascending | | top | 1-5000 rows; default 100 |

Use dimensions by scope to select dimensions. Resource- and meter-level dimensions require a subscription or resource-group scope. Tag grouping and filtering are not supported by this MCP tool.

3. Execute and interpret

Call query_costs. If the operation is unavailable, use the Cost Management Query API through the approved fallback process. Preserve the response column order, currency, metric, scope, and period. Keep different currencies separate.

Request granularity=None when the answer needs a total instead of summing daily rows. For weekly comparisons, issue one bounded custom-period query per week, with granularity=None and only the required grouping, rather than locally parsing or time-bucketing a larger response.

The tool has no continuation input. If the requested data exceeds top, raise top to at most 5000 or narrow the scope, period, or grouping. State when the result may be incomplete.

Error handling

| Error | Action | |---|---| | Unsupported timeframe, metric, dimension, or sort | Use a value exposed by the tool contract. | | Missing from/to or filter pair | Supply both members of the pair. | | Date outside 92 days | Narrow the period; fallback does not bypass this guardrail. | | Throttled | Honor the retry guidance returned by the tool and reduce fan-out. | | More than about 10 subscriptions | Ask the user to narrow scope. |

See examples, parameter contract, and guardrails. Use cost query errors for tool-specific remediation.