Query Costs (AWS default; per-provider)
query_costsQuery CloudQuell cost & FinOps data for the caller's organization. ONE flexible tool: choose a view to get the slice you need. view="overview" (default) returns month-to-date spend vs the previous month, per-account and per-service rollups, and a service-level comparison. view="detailed" returns the pivot VOCABULARY for this scope — the service names, tag keys and linked accounts you can filter on. It does NOT return pivot tables: use run_cost_pivot for those (by product, usage type, tag, region, cost center, charge type or provider). DEFAULTS TO AWS: without provider the backend scopes to AWS cost data only. Pass provider ("azure" | "gcp" | "snowflake" | "anthropic" | "openai") to query another connected provider instead. Filter with start_date/end_date (YYYY-MM-DD), account_id, and service — the filter values are provider-native (payload field names like awsService are legacy-named but carry the scoped provider's data). account_id takes either a sub-account NAME or a 12-digit cloud account id (the id is resolved to the name for you); get_available_linked_accounts lists both. COST BASIS: by default the numbers use the organization's SAVED cost settings. Pass cost_basis to pin an explicit basis — { "use_amortized": true } for the FINANCE view (commitment/upfront fees spread across the term they cover, matching accrual reporting and what a chargeback or a CFO conversation needs), or leave it unblended for the ENGINEERING view (what was billed on the day, matching the provider console and what a team debugging a spike expects). include_credits / include_discounts / include_refunds / include_taxes decide what nets against the total. cost_basis is LAYERED: each field you set overrides just that toggle for this call, and every field you omit keeps the organization's saved value — so pin only what the question needs. The basis actually applied comes back as costBasis in the response (with overrides naming the toggles you pinned); quote its summary when reporting the numbers. Use response_format="concise" (default) for key fields, "detailed" for the full payload. Read-only — never modifies anything. Example: { "view": "overview", "start_date": "2026-05-01", "end_date": "2026-05-31", "response_format": "concise" } returns this-month-so-far totals and the top account/service movers; add "provider": "azure" for the same slice of Azure spend, or "cost_basis": { "use_amortized": true, "include_credits": true } for the amortized, credit-netted finance view.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "query_costs"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| view | No | Which cost slice to return. "overview" (default) = month-to-date vs previous, by-account and by-service rollups, service comparison. "detailed" = the pivot VOCABULARY for this scope (available services, tag keys, linked accounts) — not pivot tables. For savings, anomalies, budget status, tag coverage, allocation, or commitments, use the dedicated tools (get_savings, list_anomalies, get_budget_status, get_tag_coverage, get_allocation_breakdown, list_commitments). | overview |
| limit | No | Max rows per list section in the concise projection (default: no cap beyond the truncation guard). Ignored when response_format="detailed", which returns the full payload bounded only by the output-size guard. | |
| service | No | Filter to a single service by its provider-native name (AWS e.g. "AmazonEC2", "AmazonS3"; other providers use their own service names — discover them with get_available_services scoped to that integration). | |
| end_date | No | Window end, YYYY-MM-DD (e.g. "2026-05-31"). | |
| provider | No | Provider scope for the query. OMIT = AWS when no integration_id is pinned; with integration_id the scope follows that integration's provider server-side. Pass "azure", "gcp", "snowflake", "anthropic", or "openai" to run the same views against that provider's cost data instead. One provider per call. | |
| account_id | No | Filter to a single sub-account — an AWS linked account, Azure subscription, GCP project, Snowflake account, or Anthropic/OpenAI workspace/project. Accepts EITHER the sub-account name OR a 12-digit cloud account id, which is resolved to the name automatically. get_available_linked_accounts lists both for every sub-account. | |
| cost_basis | No | Optional cost-basis override — how cost is computed. LAYERED: each field you set overrides just that toggle for this call; every field you omit keeps the organization's SAVED value. Omit the whole object to use the org's saved settings unchanged. Finance/chargeback questions usually want { "use_amortized": true }; "what did we actually get billed" questions want { "use_amortized": false }. The effective basis is echoed back as `costBasis` in the response, including which toggles this request overrode. | |
| start_date | No | Window start, YYYY-MM-DD (e.g. "2026-05-01"). | |
| response_format | No | concise = key fields only (default, lower token cost); detailed = the full parsed payload (see `limit`). | concise |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | Why there are no pivot tables here, and which tools do provide pivots (detailed). | |
| tool | No | Which tool truncated (only on a truncated result). | |
| view | No | Which slice was returned: "overview" or "detailed". | |
| message | No | How to narrow the request (only on a truncated result). | |
| costBasis | No | The accounting basis these numbers were computed on: `source` ("organization_defaults" or "organization_defaults+overrides"), an `overrides` array naming the toggles this request pinned, the five resolved toggles (null = kept the org's saved value, which this server cannot read), and a one-line `summary` to quote when reporting the figures. | |
| truncated | No | Present and true when the result exceeded the output-size budget and was WITHHELD. When you see this, no data fields are present — narrow the request as `message` says and call again. | |
| lastUpdated | No | When this cost data was last ingested. Always report it alongside the figures. | |
| approx_chars | No | Approximate size of the withheld result (only on a truncated result). | |
| mtdComparison | No | Month-to-date vs the same days last month, with `asOfDay` (the last ingested day). | |
| pivotsAvailable | No | Always false on view="detailed": this endpoint returns the pivot vocabulary, not pivot tables. See `note`. | |
| availableTagKeys | No | Tag keys present in this scope (detailed). | |
| availableServices | No | Service names present in this scope — the values `service` accepts (detailed). | |
| serviceComparison | No | Per-service current vs prior month movement — the top-movers source (overview). | |
| previousMonthTotal | No | The previous month's full total. | |
| resolvedAccountName | No | Present when a 12-digit `account_id` was resolved to this account name. | |
| accountFilterWarning | No | Present when the account filter could not be resolved; the query still ran. | |
| currentMonthByAccount | No | Current-month spend per sub-account (overview). | |
| availableLinkedAccounts | No | Sub-accounts present in this scope, id + name (detailed). | |
| previousMonthToDateTotal | No | The previous month's total through the same day-of-month. |