Skip to main content
Glama

Get namespace cost history

get_namespace_cost_history
Read-only

Read how the current cluster's cost was allocated to each namespace over time - the same series GET /org/clusters/{cluster_id}/cost/namespaces/history serves. days is the window, 1 to 35 (the metering keeps 35 days; default 30), and granularity is day (the default) or hour (at most 7 days; default 7). Returns, in the organisation's display currency, the buckets the window was cut into (each with hours, attributed_hours, the hours the metering attributed to namespaces, and estimated_hours, those of them no metering pass ran for, filled in by the next pass at its own rate) and, costliest first, each namespace's cost_cents: one value per bucket in minor units of currency, null where the metering attributed none of the bucket's hours (unknown, not zero) and 0 where it ran and gave the namespace nothing. The 15 costliest namespaces are listed; namespaces_not_listed counts the rest. List-price estimates, not the bill; nothing is extrapolated. Read-only; use get_cluster_cost for the latest snapshot.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "cluster_id": "<cluster_id>"
    },
    "name": "get_namespace_cost_history"
  }
}

Input Schema

NameRequiredDescriptionDefault
daysNoThe window in days: 1 to 35, at most 7 by the hour. Leave it out for 30 days (7 by the hour).
cluster_idYesAnkra cluster id (UUID) the call targets. Discover ids with list_clusters.
granularityNoThe bucket size: day (the default) or hour.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

readOnlyHint already covers safety, and the description still adds substantial context: list-price estimates rather than the invoice, no extrapolation, a 35-day metering retention bound, a 15-namespace listing cap with namespaces_not_listed, and the crucial null-means-unknown vs 0-means-attributed-zero distinction.

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?

Purpose is front-loaded and every clause carries information — nothing is filler. It is a single dense run-on paragraph, though, so the return-format details would scan better as separate sentences; density slightly hurts readability without adding waste.

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?

With no output schema, the description fully describes the return shape: buckets with hours/attributed_hours/estimated_hours, per-namespace cost_cents in minor units, ordering costliest-first, listing cap, and currency. Nothing an agent needs to call or interpret this correctly is missing.

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% and already documents bounds and defaults, so the baseline is 3. The description goes further by explaining the reason behind the numbers (metering keeps 35 days) and the coupling between granularity=hour and the 7-day ceiling, which the schema states only as a bare constraint.

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?

Opens with a specific verb and resource (read how the current cluster's cost was allocated to each namespace over time) and anchors it to the exact endpoint GET /org/clusters/{cluster_id}/cost/namespaces/history. It also explicitly separates itself from get_cluster_cost so an agent can choose without inspecting schemas.

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

Usage Guidelines4/5

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

States the one clear alternative and the condition that selects it ('use get_cluster_cost for the latest snapshot'), plus the granularity precondition (hour is capped at 7 days). It does not address other cost siblings such as get_stack_cost or get_fleet_cloud_cost, so routing is clear but not exhaustive.

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.