Skip to main content
Glama

FMF Proof

API Relay Bill and Cache Reconciler

bill_reconcile

Send your own usage rows and the prices the relay posts; no relay key is needed. Recomputes every row in integers, flags rows charged above the posted price, and names the cause where the arithmetic can: cache reads billed as full input, a whole-number multiplier, or billing from the official price times a hidden multiplier. Up to 10,000 rows per call.

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": "bill_reconcile"
  }
}

Input Schema

NameRequiredDescriptionDefault
rowsNoYour usage rows, up to 10000: { id?, model, input_tokens, output_tokens, cache_read_tokens?, cache_write_tokens?, charged }. charged is a decimal string in the relay's billing currency.
posted_pricesNoPrices the relay posts, per 1M tokens, as decimal strings: { "<model>": { input, output, cache_read?, cache_write? } }.
tolerance_pctNoRows charged more than this percent above expected are flagged (default 2).
include_all_rowsNoAlso return rows that passed.
reference_pricesNoOptional official prices in the same shape; lets an overcharge be explained as "official price x N".
posted_multiplierNoThe group multiplier the relay posts, e.g. "0.5" (default 1).
input_includes_cacheNoRequired when rows have cache tokens: true if input_tokens already counts cached tokens (OpenAI-style), false if not (Anthropic-style).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does substantial work: it discloses that computation is done in integer arithmetic, that only over-tolerance rows are surfaced by default, the specific cause taxonomy it can attribute, and that no relay key is needed (implying pure local analysis of submitted data). It omits the response shape and whether all flagged causes are mutually exclusive, so it is strong but not exhaustive.

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 prerequisite and inputs are front-loaded in the first clause, the mechanics follow, and the row cap closes it out. The middle sentence is dense with three enumerated cause categories but each item is load-bearing. No filler or repeated phrasing.

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?

For a 7-parameter computation tool with no annotations and no output schema, the description covers the inputs, the arithmetic approach, the flagging rule, and the diagnostic output in conceptual terms. The main residual gap is the exact result structure, which is only inferrable from include_all_rows and the flagging sentence, but an agent has enough to invoke 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 every parameter is already documented in the schema, and the description largely restates those facts (row cap, posted prices). It does add some cross-parameter meaning by linking the cause categories to reference_prices ("official price x N") and cache-token handling, but leaves tolerance_pct, include_all_rows, and posted_multiplier semantics to the schema. Baseline 3 is appropriate.

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?

The description names concrete operations on a specific resource: recompute usage rows, flag rows charged above posted price, and attribute the cause (cache reads billed as full input, whole-number multiplier, official price times a hidden multiplier). An agent can tell this is a billing-audit tool rather than a pricing feed or health check. It stops short of naming any sibling, so differentiation from tools like price_parity or diff_receipt is left implicit.

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

Usage Guidelines3/5

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

It states the operating context clearly: you supply your own usage rows plus the relay's posted prices, and no relay key is required. That covers prerequisites and the per-call row cap of 10,000. It never says when to prefer this over sibling reconciliation or price-comparison tools, and gives no when-not guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources