Skip to main content
Glama

Get Usage

get_usage
Read-onlyIdempotent

The A2 usage ledger: every metered billing event newest-first with attribution — featureId, amount, the project/job that produced it, and the event's LIST price in USD (a plan allowance may zero it on the invoice). Answer "what did project X cost this period?" with a query instead of summing your own quotes. Filter by projectId, jobId, and/or a [from, to) epoch-ms window. Requires the billing:read scope.

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
toNoPeriod end, epoch milliseconds, EXCLUSIVE.
fromNoPeriod start, epoch milliseconds, INCLUSIVE.
afterNoOpaque cursor from the previous page's `pagination.nextCursor`. Forward-only.
jobIdNoOnly events produced by this job — how to answer "did my failed render post a charge?" for one run.
limitNoPage size (1..100), default 20. Out-of-range or unparseable clamps into the range.
projectIdNoOnly events attributed to this project.

Output Schema

NameRequiredDescriptionDefault
dataNo
paginationNoCursor pagination metadata.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Adds meaningful context beyond the readOnly/idempotent annotations: newest-first ordering, that the amount is LIST price (invoice may zero it), and the billing:read scope requirement. Pagination semantics are left to the schema, which keeps it from a 5.

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?

Four sentences, front-loaded with what the tool is and its value, then filters and the scope prerequisite. Dense but every sentence contributes; no filler.

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

Completeness4/5

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

An output schema exists so return values needn't be spelled out, and the description covers purpose, use case, filters, and auth. Complete enough for correct invocation across all six optional params.

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 all six parameters are already documented. The description reiterates projectId/jobId/[from,to) filtering but adds little beyond what the schema's per-parameter descriptions convey, so baseline 3 applies.

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 resource (metered billing events / usage ledger) with concrete returned fields (featureId, amount, attribution, LIST price) and ordering (newest-first). No sibling tool deals with billing, so the agent can confidently distinguish it.

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?

Provides a concrete use-case framing ('answer what did project X cost this period?') and warns against summing quotes manually. It doesn't name alternatives or state when-not to use it, so it stops short of full routing guidance.

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.