metrx_get_cost_summary says not to use it for real-time per-request costs, metrx_compare_models says not to use it for agent-specific recommendations, metrx_set_budget says not to use it merely to change enforcement mode, metrx_apply_optimization says to run an experiment first when the impact is unclear. That turns the tool list into a routing table and removes the usual failure where an agent picks whichever call sounds nearest. Underneath it, the distinction that matters is between advisory and enforcing: alerts and predictions inform, while a hard_block budget and an alert threshold configured to pause the agent actually stop work. metrx_compare_models is the one that returns something useful on day zero, before any usage data exists.
An AI agent cost and ROI platform client with 23 tools covering fleet cost summaries and per-agent detail, optimisation recommendations and one-click application, model routing and comparison, budgets with enforcement modes, alerts and failure predictions, A/B model experiments, a cost leak audit, and outcome attribution with ROI reporting.
- The starting point: metrx_get_cost_summary returns total spend, call counts, error rates, a per-agent breakdown, revenue attribution where available and optimisation opportunities over a period, with metrx_list_agents and metrx_get_agent_detail underneath it.
- Optimisation from suggestion through to change: metrx_get_optimization_recommendations returns actionable suggestions with estimated monthly savings and a confidence level, and metrx_apply_optimization applies the ones marked one-click, such as setting a max-token limit or switching model.
- Model choice with and without your own data: metrx_route_model recommends a model for a task complexity using the agent's historical performance, while metrx_compare_models returns pricing per 1M tokens, context window sizes and batch and cache support with no usage data at all.
- Budgets that can genuinely stop work: metrx_set_budget takes a dollar limit, a period, a warning percentage and an enforcement mode of alert_only, soft_block or hard_block, metrx_update_budget_mode changes the mode or pauses it, and metrx_get_budget_status shows spending against limits with warning and exceeded counts.
- Alerts and prediction: metrx_get_alerts returns cost spikes, error-rate increases, budget warnings and system health notifications filtered by severity, metrx_acknowledge_alert clears them from the unread list while preserving the history, metrx_configure_alert_threshold sets server-side thresholds that can email, call a webhook or pause the agent, and metrx_get_failure_predictions forecasts error-rate breaches, latency degradation, cost overruns, rate-limit risk and budget exhaustion with confidence levels.
- Experiments instead of guesses: metrx_create_model_experiment routes a percentage of traffic to a treatment model and tracks cost, latency, error rate and quality until statistical significance or a maximum duration, metrx_get_experiment_results reports sample counts, metric comparisons and the current winner, and metrx_stop_experiment ends it permanently with an option to promote the winner.
- The audit: metrx_run_cost_leak_scan identifies seven kinds of inefficiency — idle agents, model overprovisioning, missing caching, high error rates, context bloat, missing budgets and cross-provider arbitrage across anthropic, cohere, google, mistral, openai and xai — and returns a scored report with fixes and estimated monthly savings.
- Tying spend to value: metrx_attribute_task links an agent event to a business outcome with a value, metrx_get_task_roi returns costs against attributed value with an ROI multiplier broken down by model and outcome type, metrx_get_attribution_report shows which actions led to outcomes with confidence scores, and metrx_generate_roi_audit produces a board-level report with risk flags.
- metrx_get_upgrade_justification analyses current usage patterns and projects the savings a higher tier would unlock.
A Metrx API key, supplied as METRX_API_KEY, on an organisation whose agents are already reporting into the platform.
One command plus a key — npm install @metrxbot/mcp-server, then supply credentials
