Skip to main content
Glama

Query Costs (AWS default; per-provider)

query_costs
Read-only

Query 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

NameRequiredDescriptionDefault
viewNoWhich 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
limitNoMax 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.
serviceNoFilter 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_dateNoWindow end, YYYY-MM-DD (e.g. "2026-05-31").
providerNoProvider 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_idNoFilter 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_basisNoOptional 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_dateNoWindow start, YYYY-MM-DD (e.g. "2026-05-01").
response_formatNoconcise = key fields only (default, lower token cost); detailed = the full parsed payload (see `limit`).concise

Output Schema

NameRequiredDescriptionDefault
noteNoWhy there are no pivot tables here, and which tools do provide pivots (detailed).
toolNoWhich tool truncated (only on a truncated result).
viewNoWhich slice was returned: "overview" or "detailed".
messageNoHow to narrow the request (only on a truncated result).
costBasisNoThe 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.
truncatedNoPresent 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.
lastUpdatedNoWhen this cost data was last ingested. Always report it alongside the figures.
approx_charsNoApproximate size of the withheld result (only on a truncated result).
mtdComparisonNoMonth-to-date vs the same days last month, with `asOfDay` (the last ingested day).
pivotsAvailableNoAlways false on view="detailed": this endpoint returns the pivot vocabulary, not pivot tables. See `note`.
availableTagKeysNoTag keys present in this scope (detailed).
availableServicesNoService names present in this scope — the values `service` accepts (detailed).
serviceComparisonNoPer-service current vs prior month movement — the top-movers source (overview).
previousMonthTotalNoThe previous month's full total.
resolvedAccountNameNoPresent when a 12-digit `account_id` was resolved to this account name.
accountFilterWarningNoPresent when the account filter could not be resolved; the query still ran.
currentMonthByAccountNoCurrent-month spend per sub-account (overview).
availableLinkedAccountsNoSub-accounts present in this scope, id + name (detailed).
previousMonthToDateTotalNoThe previous month's total through the same day-of-month.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint and openWorldHint, and the description reinforces read-only while adding real behavior beyond the annotations: the AWS default scoping when `provider` is omitted, the LAYERED cost_basis override model where omitted fields inherit saved org settings, and the fact that the effective basis is echoed back as `costBasis` with an `overrides` list that should be quoted. That is meaningful operational context an agent could not infer from the annotations alone; it stops short of full marks only because data freshness and truncation behavior are left to other tools/schema.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The text is front-loaded — purpose, view selection, provider default, filters, cost basis, output shape, example — in a deliberate order, and the emphasis markers (ONE, DEFAULTS TO AWS, LAYERED) help scanning. It is on the long side and repeats the cost_basis layering that the nested schema already describes, plus a trailing example that restates earlier points, so it loses a point for some redundancy rather than for lack of structure.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a nine-parameter, nested, multi-provider cost query with an output schema present, the description covers everything an agent needs: provider scoping, view semantics, filter formats, cost-basis overrides, response format, and the echoed `costBasis` field to quote. Return-value detail is appropriately delegated to the output schema rather than duplicated.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds value the schema does not: it warns that filter values are provider-native and that payload field names like `awsService` are legacy-named, notes that `account_id` accepts either a sub-account name or a 12-digit id resolved to the name, and explains the layering of `cost_basis` in plain terms. The worked example with dates and response_format further anchors correct invocation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource ("Query CloudQuell cost & FinOps data for the caller's organization") and immediately frames the tool as one flexible entry point driven by `view`. It then explicitly carves out the boundary with `run_cost_pivot` ("It does NOT return pivot tables: use run_cost_pivot for those"), so an agent can distinguish this tool from a close sibling without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It states when to pick each view ("overview" = month-to-date rollups vs "detailed" = pivot vocabulary), names the alternative for pivot tables, explains the AWS default and how to switch providers, and gives explicit selection criteria for cost basis ("FINANCE view... chargeback or a CFO conversation" vs "ENGINEERING view... a team debugging a spike"). Both when-to-use and when-not-to-use are covered.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources