Skip to main content
Glama
Metrx MCP Server

Metrx MCP Server

by metrxbots

Run Cost Leak Scan

metrx_run_cost_leak_scan
Read-onlyIdempotent

Run a comprehensive cost leak audit across all your agents. Identifies 7 types of cost inefficiencies: idle agents, model overprovisioning, missing caching, high error rates, context bloat, missing budgets, and cross-provider arbitrage…

Instructions

Run a comprehensive cost leak audit across all your agents. Identifies 7 types of cost inefficiencies: idle agents, model overprovisioning, missing caching, high error rates, context bloat, missing budgets, and cross-provider arbitrage opportunities (covers amazon, anthropic, cohere, deepseek, google, meta, mistral, openai, xai). Returns a scored report with fix recommendations and estimated monthly savings. Supports output_format="json" for machine-readable output in CI/CD pipelines. Do NOT use as a continuous monitoring loop — use get_alerts and get_failure_predictions for ongoing monitoring. Read-only: it changes nothing. To act on a finding, use get_optimization_recommendations or create_model_experiment. Requires an API key with the 'read' scope.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "metrx_run_cost_leak_scan"
  }
}

Input Schema

NameRequiredDescriptionDefault
agent_idNoScan a specific agent instead of all agents
output_formatNoOutput format: "text" (default) returns a human-readable markdown report; "json" returns raw machine-readable JSON suitable for CI/CD pipelines and programmatic processing.text
include_low_severityNoInclude low-severity findings in the report

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.6.3
    • changedInput schema / properties / agent_id / description
      Previous value: -"Scan a specific agent instead of the entire fleet"New value: +"Scan a specific agent instead of all agents"
  2. Addedv0.2.0
  3. Removed
  4. First observedv0.1.2

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint, idempotentHint and destructiveHint=false, so "Read-only: it changes nothing" largely restates structured data. The description does add genuine context beyond annotations: the required 'read' API scope, the shape of the return (scored report with fix recommendations and estimated monthly savings), and the explicit prohibition on polling it as a monitoring loop.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The opening sentence front-loads purpose, followed by coverage, return shape, usage exclusion, and prerequisites in a logical order. It is dense but slightly overlong, and "Read-only: it changes nothing" duplicates the readOnly annotation rather than earning its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description carries the return-value burden and does so by describing a scored report with fix recommendations and estimated savings. Auth requirements, provider coverage, non-monitoring guidance, and follow-up paths are all present, leaving nothing an agent needs in order to call it correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so all three parameters are already documented, including the output_format enum and its CI/CD use case. The description reinforces output_format="json" for pipelines and implies agent_id scoping via "across all your agents," but adds no syntax or format detail the schema lacks. Baseline 3 applies when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ("Run a comprehensive cost leak audit across all your agents") and enumerates the seven inefficiency categories it detects, so the agent knows exactly what the tool produces. It also names the sibling tools that cover adjacent needs, making it distinguishable without opening any schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when NOT to use it ("Do NOT use as a continuous monitoring loop — use get_alerts and get_failure_predictions for ongoing monitoring") and routes follow-up action to get_optimization_recommendations or create_model_experiment. Both the exclusion and the two alternatives are named with the condition that selects them.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.