Skip to main content
Glama

Spend breakdown

get_spend
Read-only

AI API spend in US dollars at list prices, split into input, cache reads, cache writes and output, grouped by day, team, provider, model, API key or tier, with optional filters.

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": "get_spend"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoLast day, YYYY-MM-DD. Defaults to the latest day.
keyNoAPI key name, as listed by list_api_keys.
fromNoFirst day, YYYY-MM-DD. Defaults to the start of the data.
teamNoTeam name, as listed by get_spend_summary.
modelNoModel name, for example Sonnet 5.5.
group_byNoHow to group the totals. Default day.
providerNoclaude (Anthropic) or openai.
last_daysNoOnly the most recent N days. Overrides from/to.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.4/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnlyHint=true, destructiveHint=false, openWorldHint=false), yet the description still adds genuinely useful semantics: that figures are list prices in US dollars, which heads off interpreting them as invoiced cost. It stops short of disclosing aggregation defaults, result-size limits, or ordering, so it stops at a 4.

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?

One front-loaded sentence that puts the resource and units first, then the breakdown. The enumerated grouping list is slightly redundant against the enum but earns its place by advertising the tool's flexibility in one pass.

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

Completeness3/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 return-value burden and only partially discharges it: the split and grouping tell the agent roughly what rows look like, but not the exact fields, aggregation semantics, or result limits. For an 8-parameter analytics tool that is adequate rather than complete.

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

Parameters3/5

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

Schema coverage is 100%, so every parameter is already documented, and the description's enumeration of grouping axes merely restates the group_by enum. It adds no extra meaning about date precedence or filter combination beyond what the schema states.

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

Purpose4/5

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

The description names the specific resource (AI API spend in US dollars) and the exact breakdown dimensions it returns (input, cache reads, cache writes, output) plus the grouping axes. That is far more concrete than a restated title, though it never distinguishes itself from siblings like get_spend_summary or get_people_spend.

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

Usage Guidelines2/5

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

The only usage signal is the trailing phrase 'with optional filters', which implies scoping but does not say when to reach for this tool instead of get_spend_summary or get_people_spend. There are no exclusions, prerequisites, or stated scenarios, so the agent must infer the choice from the sibling names alone.

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