Skip to main content
Glama

Read usage and inference costs

get_usage
Read-onlyIdempotent

Read usage in projects you can access in the connected organization, including calls without retained traces. Omit project_uuid to include unassigned organization usage. For limited project access, only metrics with recorded organization scope qualify as unassigned usage. All arguments are optional; start with {} for a seven-day summary. Use group_by=model or project to find the most expensive groups, ranked by total_cost descending (stable group-key tie break), up to limit; grouping requires bucket=none. Project groups use public project UUIDs and names when metadata is available. With no grouping, bucket=day returns up to 32 daily buckets over a maximum 31-day window. Costs are USD: cost covers customer model calls, evals_cost covers evaluations, guards_cost covers guards/routing checks, and total_cost includes all three. Counts/tokens/errors describe customer calls, matching the app's usage analytics. This is recorded inference/controls usage, not an invoice or balance; credits, storage and other billing adjustments are not represented. If meta.has_more, increase limit up to 100 or narrow the project/date filter. Requires runtime:read.

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_usage"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoExclusive RFC3339 end time. Defaults to now. Reuse the returned from/to values while paging.
fromNoInclusive RFC3339 start time. Defaults to seven days before to. The window must be positive and at most 31 days.
limitNoMaximum groups in a ranking, default 20, maximum 100. Does not truncate ungrouped summaries or daily series.
bucketNonone (default) for a summary or grouped ranking; day for a compact UTC daily series without grouping.
group_byNonone (default), model, or project. Grouped rankings require bucket=none.
project_uuidNoOptional project UUID you can access. Omit to include eligible projects and attributable unassigned organization usage.

Output Schema

NameRequiredDescriptionDefault
dataYes
metaYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Beyond the read-only and idempotent annotations, the description discloses important behavior: inclusion of calls without retained traces, limited project-access qualification, grouping constraints requiring `bucket=none`, daily bucket limits, cost category definitions, and the fact that results are not an invoice or balance. It also states the required scope and paging behavior.

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 description is dense and front-loaded with the core purpose, then proceeds through scoping, grouping, cost semantics, and paging. It is somewhat long and repeats a few schema details such as optional arguments and maximum limits, but most sentences carry useful operational nuance.

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?

Given the tool's complexity and the presence of an output schema, the description is highly complete. It covers access scope, defaults, grouping behavior, date-window constraints, cost semantics, paging, and the key limitation that this is recorded usage rather than billing.

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

Parameters5/5

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

Although the schema has full parameter description coverage, the description adds meaningful semantic context: omitting `project_uuid` affects unassigned usage, grouping requires `bucket=none`, and increasing `limit` interacts with `meta.has_more`. It also clarifies that `limit` applies to ranked groups rather than ungrouped summaries.

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 clearly states that this tool reads usage and inference costs across accessible projects, including unassigned organization usage. It is specific about the resource and scope, but it does not explicitly distinguish itself from any named sibling tool.

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?

It gives concrete starting guidance such as using `{}` for a seven-day summary and selecting `group_by=model` or `project` for ranked expensive groups. It also explains how to handle truncation via `meta.has_more`, though it does not name explicit alternatives or when-not-to-use cases.

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