Skip to main content
Glama

get_usage

Reads local Claude Code, Codex, and OpenCode logs to report token totals, equivalent cost, streaks, and per-agent and per-model breakdowns across all-time, yearly, 30-day, and 7-day windows.

Instructions

Total local AI coding agent usage: tokens, equivalent cost, streak, active days, per-agent mix and per-model breakdown. Windows are all time, the current calendar year so far, the last 30 days and the last 7 days. Reads logs on this machine; makes no network request.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
agentsNoRestrict the read to these agents. Omit for all of them.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations, the description carries the full disclosure burden and does deliver a meaningful trait: 'Reads logs on this machine; makes no network request', which tells the agent this is a local-only read with privacy implications. It stops short of noting read-only safety, expected scan cost on large logs, or empty-state behavior, so it is good but not exhaustive.

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?

Three sentences, front-loaded with the returned metrics and followed by the windows and the local-read note. Every sentence contributes; the only minor density is the metric list, which is justified by the breadth of the return.

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?

With no output schema and no annotations, the description compensates well by listing the returned dimensions, the four time windows, and the local/no-network behavior. The remaining gap is sibling orientation relative to get_daily_usage and get_recap, which matters for correct tool selection.

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 description coverage is 100%, and the single 'agents' parameter is already documented in-schema ('Restrict the read to these agents. Omit for all of them.'). The description adds no syntax or filtering detail beyond that, so the baseline 3 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?

States a specific verb ('total ... usage') and resource, then enumerates the exact metrics returned (tokens, equivalent cost, streak, active days, per-agent mix, per-model breakdown). Very clear about what it does, but it never differentiates itself from siblings like get_daily_usage or get_recap, so an agent must infer the granularity distinction.

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?

The enumerated time windows (all time, current year, last 30 days, last 7 days) implicitly signal when this aggregate view is appropriate. However, there is no explicit when-to-use guidance and no direction to or away from get_daily_usage / get_recap, leaving the alternative-selection question unanswered.

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

This server cannot be deployed

Other Tools