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. |
Capabilities
Features and capabilities supported by this server
| 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 |
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/temurkhan13/openclaw-cost-tracker-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server