LLM Usage & Cost Tracker
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| LLM_USAGE_DB_URL | No | The database URL for storing usage data. | sqlite:///$HOME/.llm-usage/usage.db |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| record_usageC | Record a single LLM API call with token counts. Cost is computed automatically from the pricing table at insert time.
|
| query_spendA | Return spending broken down by a chosen axis over a time window.
Tag semantics: events with NULL/empty tags are excluded from
|
| compare_providersA | Project the cost of a hypothetical workload across providers/models. Returns models ranked by absolute cost ascending, with
|
| recommend_providerA | Recommend the cheapest priced model that fits the workload + budget. v1 ranks by cost only. A future release will incorporate quality
benchmarks (see
|
| get_pricingA | Return current pricing for one model, one provider, or all models. Both filters are optional and AND-combined. An unknown
(provider, model) returns an empty list rather than an error — the
caller can distinguish "model not in our table" from "no model
matches your filter" by passing |
| usage_summaryA | Return a one-shot summary of usage over a named calendar period.
|
| list_providersA | List every provider we know about, with their models and OpenAI-compat flag. Sources the provider/model lists from |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| recent_events | Most recent LLM call events recorded by the local capture layer. |
| pricing_table | Current `pricing_snapshot` table — one row per (provider, model). |
TDQS
Scored across 7 tools
Each tool has a clearly distinct purpose: compare_providers for cost projection, get_pricing for current rates, list_providers for provider info, query_spend for spending breakdown, recommend_provider for cheapest model, record_usage for logging calls, and usage_summary for period summaries. No overlap in functionality.
Most tools follow a consistent verb_noun snake_case pattern (e.g., compare_providers, get_pricing, list_providers, query_spend, recommend_provider, record_usage). The only minor deviation is 'usage_summary' which is noun_noun but still clear and fits the style.
With 7 tools, the set is well-scoped for an LLM usage and cost tracker. It covers listing, comparing, recommending, recording, and querying without being overwhelming or sparse.
The server provides core functionality for tracking usage and costs, including recording, querying, and cost projection. Minor gaps exist: no tool to update/delete usage records or manage provider/pricing data, but these are likely intentional for a read-focused tracker.