Agent Cost MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| AGENT_COST_LEDGER_PATH | No | Path to the local JSON ledger file used by `record_spend`. Defaults to `~/.agent-cost-mcp-server/ledger.json`. |
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 |
|---|---|
| price_usageA | Price a concrete usage record at a model's list rates. Args: model_id: Model identifier from the pricing snapshot, e.g. "anthropic.claude-sonnet-4-5" or "openai.gpt-5-mini". input_tokens: Input (prompt) tokens consumed. output_tokens: Output (completion) tokens consumed. Returns the input/output/total cost in USD. |
| estimate_run_costB | Estimate what one run of a workload will cost on a model. Args: model_id: Model to price the workload on. input_tokens: Expected input tokens for one run. output_tokens: Expected output tokens for one run. Returns the model's cost plus the same workload priced on every other model in the snapshot, cheapest first. |
| compare_models_for_taskA | Rank models for a task by expected cost per successful task. Cost per token is the wrong ranking for agent work: a cheap model that fails half its tasks costs more per success than a pricier, reliable one. Pass measured success rates (0-1 per model_id) if you have them; models without a supplied rate are ranked on raw cost. Args: input_tokens: Input tokens for one attempt at the task. output_tokens: Output tokens for one attempt at the task. success_rates: Optional map of model_id to success rate in (0, 1]. |
| record_spendA | Record a run's actual token usage in the local per-task ledger. Args: task_id: Caller-chosen identifier grouping one task's runs. model_id: Model the run used. input_tokens: Actual input tokens consumed. output_tokens: Actual output tokens consumed. Returns the recorded entry, priced at the model's list rates. |
| budget_statusA | Check a task's recorded spend against a budget. Args: task_id: The task identifier used with record_spend. budget_usd: The budget for the task, in USD. Returns spent, remaining, call count, and whether the task is over budget. This server supplies the numbers; enforcing the budget (stopping a run) belongs to the agent framework. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 5 tools
price_usage and estimate_run_cost both price input/output tokens and could be momentarily confused, but the descriptions clearly separate a concrete recorded usage from a projected single run with cross-model comparison. compare_models_for_task (success-rate ranking), record_spend (ledger write), and budget_status (ledger read) each target a distinct concern.
Four names follow a clean verb_noun snake_case pattern (price_usage, estimate_run_cost, compare_models_for_task, record_spend). budget_status is a noun_noun query name, a minor deviation, but the set remains readable and predictable.
Five tools is well-scoped for a cost estimation server: price, estimate, compare, record, and check budget. No tool is redundant and none feels like filler.
The pricing, projection, ranking, recording, and budget-checking lifecycle is covered, with estimate_run_cost implicitly exposing the model snapshot. Minor gaps remain: no explicit tool to list available models or model_ids, and no way to read back or clear ledger entries beyond budget_status.