Skip to main content
Glama

Core: Get usage history

metrecept_get_usage_history

Retrieve per-UTC-day usage history for the last 1–90 days to track requests, tokens, and spend trends, with idle days shown as zero and no estimates.

Instructions

Read the tenant's usage meters as a per-UTC-day series, oldest day first, plus window totals: requests, cache hit/miss tokens and USD, prewarm, web fetches, API calls, custody and statement meters, upstream cache tokens and billed_usd. Use it for trends or 'what did I spend each day'. Not for lifetime totals or plan: use metrecept_get_usage. Not for spend avoided: use metrecept_get_savings. Read from the durable per-day ledger; idle days are 0, nothing is estimated. Read-only, not billed. Requires a Metrecept API key (METRECEPT_API_KEY env on stdio, or Authorization: Bearer on remote HTTP); results are scoped to that key's tenant only.

Input Schema

NameRequiredDescriptionDefault
daysNoWindow length in UTC days ending today, 1-90 (default 30; out-of-range values are clamped).

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.3.1
    • addedInput schema / properties / days / description
      Added value: +"Window length in UTC days ending today, 1-90 (default 30; out-of-range values are clamped)."
  2. Addedv0.1.4

TDQS

A4.6/5.0
Behavior5/5

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

No annotations are provided, so the description carries the full burden and does: read-only, not billed, sourced from a durable per-day ledger, idle days reported as 0 with nothing estimated, and tenant-scoped. It also states the auth mechanism for both stdio and remote HTTP transports, which is exactly the kind of context annotations would otherwise supply.

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?

Front-loaded with the core behavior and scoping, followed by exclusions and operational caveats in priority order. The meter enumeration is long but functional; a couple of clauses (upstream cache tokens, custody and statement meters) are dense enough to cost a point on readability.

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?

Return values are covered by the output schema, so the description doesn't need to explain them. It still supplies everything else an agent needs: scope, ordering, ledger semantics, billing status, auth requirements, and sibling routing.

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% and the single 'days' parameter is fully documented in the schema, including range, default, and clamping behavior. The description reinforces the UTC-day window semantics but adds no detail beyond what the schema already states, so the 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 verb (read), resource (tenant's usage meters), and output shape (per-UTC-day series, oldest first, plus window totals), then enumerates the meters covered. An agent can distinguish this from metrecept_get_usage and metrecept_get_savings without opening any schema.

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

Usage Guidelines5/5

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

Gives explicit positive cases ('trends', 'what did I spend each day') and two explicit exclusions with the named alternative for each (lifetime totals/plan -> get_usage; spend avoided -> get_savings). Nothing is left to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.