openclaw-cost-tracker-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| OPENCLAW_COST_LOGS | No | Path to the directory containing cost-log JSONL files (only used when backend is 'openclaw-jsonl'). Defaults to ~/.openclaw/cost-logs/. | ~/.openclaw/cost-logs/ |
| OPENCLAW_COST_BACKEND | Yes | Backend to use: 'mock' for sample data with deliberate anomalies and routing opportunities, or 'openclaw-jsonl' for parsing OpenClaw cost-log JSONL files. |
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 |
|---|---|
| cost_overviewA | Top-level cost summary for a window — total spend, request count, by-provider breakdown, top agents, top models, anomaly count. Use this first for a single-pane view. |
| costs_by_agentB | Per-agent cost breakdown — total spend + request count + avg cost-per-request + primary provider/model + share of total spend, sorted by cost descending. |
| costs_by_providerB | Per-provider cost breakdown — total spend + request count + token counts + share of total, sorted by cost descending. |
| find_cost_anomaliesA | Requests whose cost is |
| top_cost_driversA | Highest-spend agents + models in the window — flat list, no per-provider or anomaly noise. Useful for 'where's our money going' digest format. |
| model_routing_recommendationsA | Suggestions to route some volume to cheaper providers/models — e.g., claude-sonnet-4 → gemini-2.5-flash for extraction-style work, gpt-4o → gpt-4o-mini for short chats. Each rec includes 30d estimated savings. |
| forecast_monthly_costA | Projects 30-day total spend from the observed window's run rate. Returns per-provider 30d projection + confidence note. Re-run with longer window for stability. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| diagnose-cost-spike | Walk a cost-overview snapshot and explain a recent spike |
| weekly-cost-digest | Compose a 200-word weekly cost digest from the last 7 days |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| Cost overview snapshot (7-day window) | Full cost summary: total, by-provider, top agents, top models, anomaly count |
| 30-day cost forecast | Projected 30-day total + per-provider, with confidence note |
| Recent cost anomalies | Requests flagged as 3x+ above their agent's median cost |
TDQS
Scored across 7 tools
Each tool targets a distinct cost analysis aspect: overview, agent/provider breakdown, anomalies, forecasting, recommendations, and top drivers. No overlap in functionality.
All tool names use consistent lowercase underscore pattern, clearly indicating their purpose (e.g., cost_overview, find_cost_anomalies). Pattern is predictable and readable.
Seven tools is ideal for a focused cost tracker; each tool covers a specific need without redundancy or bloat.
Covers core cost analysis needs (overview, breakdowns, anomalies, forecasting, optimization). Minor gaps like filtering or export are acceptable given the scope.