Skip to main content
Glama
Metrx MCP Server

Metrx MCP Server

by metrxbots

Get Cost Summary

metrx_get_cost_summary
Read-onlyIdempotent

Retrieve a comprehensive cost summary for your AI agent fleet: total spend, call counts, error rates, agent breakdown, revenue attribution, and optimization opportunities for a chosen period.

Instructions

Get a comprehensive cost summary for your AI agent fleet. Returns total spend, call counts, error rates, agent breakdown, revenue attribution (if available), and optimization opportunities. Use this as the starting point for understanding your agent economics. Do NOT use for real-time per-request cost checking — use OpenTelemetry spans for that. 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_get_cost_summary"
  }
}

Input Schema

NameRequiredDescriptionDefault
period_daysNoNumber of days to include in the summary (default: 30)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.2

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile is covered. The description adds genuinely new behavioral context: the required 'read' API scope and the conditional nature of revenue attribution ("if available"). It does not discuss rate limits, latency, or result size, which keeps it below the top score.

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?

Four short sentences, front-loaded with the core action and return contents, followed by usage positioning, exclusion, and the auth prerequisite. The enumeration of return fields is long but earns its place since there is no output schema; only minor tightening is possible.

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

Completeness4/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 correctly takes on the burden of describing return contents, and it also covers the auth prerequisite and the conditional revenue field. The only material gap is that the period_days lookback is never discussed in the description, so an agent must read the schema to understand the reporting window.

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?

There is a single parameter with 100% schema description coverage (period_days, default 30, range 1-90), so the schema carries the semantics. The description adds nothing about the lookback window or how period_days interacts with the returned figures, leaving this at the baseline for high coverage.

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

Purpose4/5

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

States a specific verb and resource ("Get a comprehensive cost summary for your AI agent fleet") and enumerates the returned content: total spend, call counts, error rates, agent breakdown, revenue attribution, optimization opportunities. The "starting point for understanding your agent economics" framing positions it relative to other tools, but it never names the adjacent summary-style siblings (e.g. balance, budget status, dashboard headline) that an agent would need to choose between.

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

Usage Guidelines4/5

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

Provides both a when-to-use ("starting point for understanding your agent economics") and an explicit when-not-to-use with a redirect ("Do NOT use for real-time per-request cost checking — use OpenTelemetry spans for that"). The exclusion is clear but points outside this toolset rather than resolving ambiguity among the many metrx_get_* summary tools.

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