Skip to main content
Glama

reconcile_usage_receipt

Read-onlyIdempotent

Audit a single API usage receipt against official rate cards to quantify relay markups, billing variance, and unutilized prefix cache waste.

Instructions

Audits a single API usage receipt against official 1x manufacturer rate cards from the 563-entity UMCE registry to quantify relay multiplier markups and unutilized prefix cache waste. Deterministic mathematical audit in memory requiring no authentication. Returns JSON with expected_theoretical_cost_usd, billing_variance_usd, variance_status ('OVERCHARGED_BY_RELAY_OR_MARKUP' when variance > $0.001 else 'EXACT_RATE_CARD_MATCH'), same_model_unutilized_cache_waste_usd, and net_recoverable_savings_usd. Enforces cached_tokens <= prompt_tokens, pricing (prompt_tokens - cached_tokens) at uncached input rates and cached_tokens at warm cache rates before comparing against actual_billed_usd. Use this tool when verifying an invoice line item; use detect_model_downgrade_and_substitution instead for session-level budget endurance projections.

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

Input Schema

NameRequiredDescriptionDefault
modelNoBilled model ID in 'vendor/model-slug' format (e.g. 'openai/gpt-4o-2024-11-20' or 'openai/gpt-6.1-sol').openai/gpt-4o-2024-11-20
cached_tokensNoSubset of prompt_tokens billed at warm cache read rate (0 <= cached_tokens <= prompt_tokens).
prompt_tokensNoTotal input prompt tokens billed (must be >= cached_tokens).
actual_billed_usdNoActual USD amount deducted on the provider or relay invoice.
completion_tokensNoOutput completion tokens billed.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.2

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive/closed-world, but the description adds substantial behavior beyond them: deterministic in-memory math, no authentication required, the exact pricing formula applied to cached vs uncached tokens, an enforced invariant (cached_tokens <= prompt_tokens), and the numeric variance threshold ($0.001) that flips variance_status. These are exactly the traits an agent needs before trusting a cost-audit result.

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?

Purpose, return shape, pricing mechanics, and sibling routing are front-loaded in a logical order with no filler sentences. It is dense to the point of being a single long block, and the 'deterministic ... in memory requiring no authentication' clause partly overlaps the read-only annotations, costing a point.

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?

There is no output schema, yet the description enumerates the returned fields (expected_theoretical_cost_usd, billing_variance_usd, variance_status with its two enum values, same_model_unutilized_cache_waste_usd, net_recoverable_savings_usd). Combined with the pricing rules and invariants, an agent can invoke and interpret this five-parameter tool with no residual questions.

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

Parameters4/5

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

Schema coverage is 100%, so the baseline is 3, but the description goes further by explaining how parameters interact: prompt_tokens minus cached_tokens priced at uncached rates, cached_tokens priced at warm cache rates, then compared against actual_billed_usd. That relational meaning is not derivable from the individual field descriptions alone.

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: audits a single API usage receipt against official 1x manufacturer rate cards from the 563-entity UMCE registry, quantifying relay markup and unutilized prefix cache waste. The scope (single receipt, pricing audit) clearly separates it from routing, cache-layout, and model-discovery siblings.

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 names the trigger ('Use this tool when verifying an invoice line item') and names the alternative with the condition that selects it ('use detect_model_downgrade_and_substitution instead for session-level budget endurance projections'). Both when-to-use and when-not-to-use are stated, so the agent need not infer routing.

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