Skip to main content
Glama
zhaoyue722

LLM Usage & Cost Tracker

usage_summary

Summarize LLM usage and costs for a chosen period (today, week, month, year). Returns totals, top providers and models by cost, and the most expensive call. Optionally include failed requests.

Instructions

Return a one-shot summary of usage over a named calendar period.

period is one of today | week | month | year (default: "week"). Boundaries are calendar UTC: today = since 00:00 UTC today, week = since Monday 00:00 UTC, month = since the 1st of the month, year = since January 1st. Returns totals, the top-3 providers and top-3 models by cost (with pct of total), and the single most expensive call in the window — or largest_call=None when the window is empty.

include_failed defaults to False: totals, top-N rollups, and largest_call all exclude success=False rows (partial-stream captures and other failure rows). Pass True for symmetric debugging access to the failure population.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
periodNoweek
include_failedNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
periodYes
call_countYes
top_modelsYes
largest_callYes
top_providersYes
total_cost_usdYes
Behavior4/5

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

With no annotations, the description carries full burden for behavioral disclosure. It explains the date boundaries, exclusions for failures, and the return of largest_call=None when empty. It does not explicitly state read-only nature but is thorough for a non-destructive tool.

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?

Every sentence is useful. The description is front-loaded with the main purpose, followed by parameter details in a clear and structured format. No filler or repetition.

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?

Given the tool has only 2 optional params and an output schema exists (though not provided), the description covers the essential behavior and edge cases. It could mention output currency or read-only nature, but it is complete for its intended use.

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?

Schema coverage is 0%, and the description fully explains both parameters: period with enum values and calendar boundaries, include_failed with default and effect on totals/rollups. This adds complete meaning beyond the schema.

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?

The description states the tool returns a one-shot summary of usage over a calendar period. It uses a specific verb 'return' and resource 'usage summary', and clearly distinguishes from sibling tools like query_spend (detailed query) and record_usage (recording).

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 description implies usage for quick summaries but does not explicitly state when to use this tool over alternatives like query_spend or compare_providers. No when-not or alternative references provided.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/zhaoyue722/llm-usage-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server