Skip to main content
Glama

Get object cost

get_object_cost
Read-only

Read what one object of the organisation costs - a cluster, a namespace, a stack, an application, a cloud credential or a project - the same projection GET /org/cloud-cost/objects/{kind}/... serves. kind picks the object. cluster, namespace (give namespace) and stack (give stack_name) read one cluster: the selected one, or cluster_id when no cluster is selected (a cluster_id that is not the selected cluster is refused). application (give application_id), credential (give credential_id) and project (give project_id) read every cluster behind the object that the caller may read; scope.partial true says clusters the caller may not read were left out, so the figure is a floor. Returns, in the organisation's display currency and minor units: monthly_cents (the run rate at the latest snapshot, times the hours in a month), idle_pct (the share of the run rate that is unrequested capacity - requests, not usage; clusters and credentials only), share_of_fleet_pct (of the organisation's fleet, or of the project's for a caller confined to one project), confidence, the open cloud waste, trend_30d (daily spend: the cents spent per UTC day over 30 days, not a run rate; a day marked partial is the current one, still metering over only hours_metered hours, and is not comparable to a whole day; hours_metered is the hours cents covers, hours_measured of them measured by a metering pass and hours_estimated filled in by a later pass at its own rate, whose money is in cents but which nobody measured; hours_missing the hours that had ended with no figure at all, whose money is not in cents, stated because behind several clusters each count is one cluster's worst and they need not add up to 24; a day marked incomplete is missing an hour it had already had, so its cents are a floor of that day, not a drop), month_to_date_cents (spent so far this UTC month, read over the whole month; month_to_date_days_metered of month_to_date_days_elapsed days are in it in full) and, per cluster and per namespace, the figures behind it. null is unknown, not zero: priced false carries unpriced_reason, and a day, cluster or namespace nobody metered is null. coverage_incomplete true means monthly_cents is a floor, and each cluster's own coverage_incomplete says which cluster made it one. A namespace marked shared also runs another application and is counted whole. List-price estimates, not the bill. Read-only; use get_namespace_cost_history for a cluster's namespaces over time.

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": {
      "kind": "<kind>"
    },
    "name": "get_object_cost"
  }
}

Input Schema

NameRequiredDescriptionDefault
kindYesThe kind of object: cluster, namespace, stack, application, credential or project.
namespaceNoThe Kubernetes namespace, for kind namespace.
cluster_idNoUUID of the cluster, for kind cluster, namespace or stack. Leave it out when a cluster is selected; one that is not the selected cluster is refused.
project_idNoUUID of the project, for kind project. list_projects has the ids.
stack_nameNoThe stack's name, for kind stack.
credential_idNoUUID of the cloud credential, for kind credential.
application_idNoUUID of the application, for kind application.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • changedInput schema / properties / kind / description
      Previous value: -"The kind of object: cluster, namespace, stack, application or credential."New value: +"The kind of object: cluster, namespace, stack, application, credential or project."
    • changedInput schema / properties / kind / enum
      Previous value: -[
      -  "cluster",
      -  "namespace",
      -  "stack",
      -  "application",
      -  "credential"
      -]New value: +[
      +  "cluster",
      +  "namespace",
      +  "stack",
      +  "application",
      +  "credential",
      +  "project"
      +]
    • addedInput schema / properties / project_id
      Added value: +{
      +  "description": "UUID of the project, for kind project. list_projects has the ids.",
      +  "type": "string"
      +}
  2. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Annotations only supply readOnlyHint=true, and the description confirms read-only and adds substantial context: the cluster_id refusal rule when it is not the selected cluster, scope.partial meaning the figure is a floor, coverage_incomplete semantics, null-is-unknown-not-zero, and "List-price estimates, not the bill". These are behavioural traits an agent could not infer from the annotation or schema.

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

Conciseness3/5

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

The opening sentence is well front-loaded and the core selection rules come early, but the single dense paragraph then runs through an extremely long parenthetical on trend_30d hours_metered/hours_estimated/hours_missing. That detail is legitimate given there is no output schema, yet the lack of any structural separation makes it slower to parse than necessary.

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 carries the full burden of explaining returns (monthly_cents, idle_pct, share_of_fleet_pct, confidence, trend_30d, month_to_date_cents, per-cluster/namespace figures) and it does so, including units, currency, and floor/partial caveats. For a 7-parameter, multi-kind cost tool this is as complete as the description needs to be.

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 each parameter is already documented, but the description adds conditional coupling the schema states only per-field: which parameter each kind requires and the constraint that a cluster_id outside the selected cluster is refused. That meaningfully reduces mis-invocation risk when composing kind plus id parameters.

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?

States a specific verb and resource ("Read what one object of the organisation costs") and enumerates exactly which object kinds count as "one object" - cluster, namespace, stack, application, cloud credential, project. It also names the endpoint it mirrors and explicitly contrasts itself with get_namespace_cost_history, so an agent can distinguish it from that 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 Guidelines4/5

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

Gives per-kind invocation guidance - "kind picks the object", namespace requires namespace, stack requires stack_name, application/credential/project require their ids - and states one explicit alternative (get_namespace_cost_history for a cluster's namespaces over time). It does not address when to prefer this over closely related siblings such as get_cluster_cost, get_stack_cost or get_fleet_cloud_cost, which is a real gap given how many cost tools exist.

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.