Skip to main content
Glama
temurkhan13

openclaw-cost-tracker-mcp

by temurkhan13

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
OPENCLAW_COST_LOGSNoPath 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_BACKENDYesBackend 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

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
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 threshold_multiplierx or more above their agent's median request cost. Default 3.0x. Surfaces giant-context-paste accidents, runaway loops, model regressions, etc.

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

NameDescription
diagnose-cost-spikeWalk a cost-overview snapshot and explain a recent spike
weekly-cost-digestCompose a 200-word weekly cost digest from the last 7 days

Resources

Contextual data attached and managed by the client

NameDescription
Cost overview snapshot (7-day window)Full cost summary: total, by-provider, top agents, top models, anomaly count
30-day cost forecastProjected 30-day total + per-provider, with confidence note
Recent cost anomaliesRequests 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