Skip to main content
Glama

Usage Statistics

get_usage_stats
Read-only

Retrieve token counts and costs for today, 7 days, 30 days, or all time to monitor LLM usage and spending.

Instructions

Get usage statistics for a time period. Shows token counts and costs (when pricing configured).

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

Input Schema

NameRequiredDescriptionDefault
periodNoTime period for statstoday

Output Schema

NameRequiredDescriptionDefault
usageYes
periodYes
totalsYes
endDateYes
startDateYes
costByProviderNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv1.20.14
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedOutput schema / properties / costByProvider / propertyNames
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / usage / additionalProperties / additionalProperties / properties / estimatedCostUSD
      Added value: +{
      +  "type": "number"
      +}
    • addedOutput schema / properties / usage / additionalProperties / propertyNames
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / usage / propertyNames
      Added value: +{
      +  "type": "string"
      +}
  2. Addedv1.19.6
  3. Removedv1.19.5
  4. Addedv1.2.3

TDQS

A3.8/5.0
Behavior4/5

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

The description specifies the nature of the returned data—token counts and costs—which is valuable behavioral context beyond the simple 'readOnlyHint' annotation.

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

Conciseness5/5

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

The description is extremely concise, efficiently stating the tool's core purpose and primary outputs in two direct sentences.

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?

For a read-only metric retrieval tool with minimal parameters, the description is highly complete, informing the agent exactly what metrics it will receive upon execution.

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?

With schema description coverage at 100%, the description adds little specific semantic meaning, instead confirming that the 'time period' concept is central to the tool's function. Baseline score applies.

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 defines the action ('Get usage statistics') and the resource (usage stats), which effectively separates it from conversational tools like 'ask_duck' or 'chat_with_duck' in the sibling list.

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

Usage Guidelines3/5

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

Usage is implied by the function of retrieving metrics, but there is no explicit comparison to other metrics-related tools or conditions for when this is preferred over simply viewing general usage.

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