Skip to main content
Glama

ai_token_arbitrage

Calculate multi-provider LLM API inference costs, prompt caching economics (up to 90% discount), batch discounts, and cost disparity across Claude 3.5 Sonnet, GPT-4o, DeepSeek V3/R1, and Gemini 1.5 Pro/Flash.

Behavior: Deterministic, idempotent calculation with zero external side effects. Models official pricing cards per million input/output tokens. Incorporates prompt cache hit pricing reductions and asynchronous batch API discounts (50%). Returns comprehensive cost comparison matrix, cheapest model recommendation, cache savings, and cost multiples relative to the lowest-cost model.

Usage Guidelines: Use when budgeting AI agent inference costs, evaluating LLM providers, or deciding whether to implement prompt caching. Do not use for general cloud bandwidth transfer costs; use cloud_egress_finops instead.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
isBatchNoWhether the 50% asynchronous batch processing discount applies.
promptTokensNoNumber of input prompt tokens per API call. Must be an integer >= 0.
cacheHitRatioNoProportion of input prompt tokens served from cache (0.0 to 1.0 or 0 to 100%). Default is 0.80 (80%).
completionTokensNoNumber of generated output completion tokens per API call. Must be an integer >= 0.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. Changed4 schema fields changed
    • changedInput schema / properties / cacheHitRatio / description
      Previous value: -"Prompt cache hit ratio (0.0 to 1.0 or 0 to 100%)"New value: +"Proportion of input prompt tokens served from cache (0.0 to 1.0 or 0 to 100%). Default is 0.80 (80%)."
    • changedInput schema / properties / completionTokens / description
      Previous value: -"Output completion token count per API request"New value: +"Number of generated output completion tokens per API call. Must be an integer >= 0."
    • changedInput schema / properties / isBatch / description
      Previous value: -"Whether asynchronous batch API 50% discount applies"New value: +"Whether the 50% asynchronous batch processing discount applies."
    • changedInput schema / properties / promptTokens / description
      Previous value: -"Input prompt token count per API request"New value: +"Number of input prompt tokens per API call. Must be an integer >= 0."
  2. First observed

TDQS

A4.9/5.0
Behavior5/5

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

With no annotations present, the description carries the full behavioral disclosure burden and handles it well: it states the operation is 'deterministic, idempotent calculation with zero external side effects', names the pricing source, and details what the return includes. It also quantifies cache discounts up to 90% and batch discounts at 50%.

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

Conciseness5/5

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

The purpose statement is front-loaded, followed by compact behavior and usage-guideline paragraphs. Every sentence earns its place, with no filler or redundancy.

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?

Since there is no output schema, the description clearly tells the caller what to expect: a cost comparison matrix, cheapest-model recommendation, cache savings, and cost multiples. Scope, model coverage, behavioral guarantees, and routing guidance are all present, making the definition self-sufficient.

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 for all four parameters is already 100%, so the baseline is 3. The description adds useful context beyond the schema by clarifying pricing units ('per million input/output tokens') and giving quantitative discount context that maps to isBatch and cacheHitRatio, though it does not individually redefine each parameter.

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?

The description opens with a specific verb and resource: 'Calculate multi-provider LLM API inference costs...' and enumerates the model families covered. It also distinguishes itself from siblings by explicitly saying it is not for general cloud bandwidth costs and naming the correct alternative tool.

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?

It provides explicit when-to-use conditions such as 'budgeting AI agent inference costs' and 'evaluating LLM providers', plus a when-not-to-use condition with the named alternative cloud_egress_finops. This is strong, unambiguous routing guidance for an agent.

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.

TDQS

A4.4/5.0
Disambiguation5/5

Every tool targets a separate calculation formula or regulatory context, and descriptions include explicit 'do not use... use X instead' cross-references that clearly separate similar calculators. Even overlapping financial/loan/tax tools are disambiguated by geography, employment model, or specific formula.

Naming Consistency4/5

All tool names are lowercase snake_case and follow a domain/acronym-plus-descriptor pattern, making the set visually and structurally consistent. Minor outliers like casio_991_solve and heavy acronyms (npv_irr, scorp_optimizer) prevent it from being perfectly uniform.

Tool Count2/5

At 28 tools, the server is above the 25-tool threshold that makes broad tool scanning costly for an agent. Every calculator is distinct, but the mix of unrelated domains (tax, fluid mechanics, rocket equations, restaurant tips) means most agents will only ever need a small subset.

Completeness4/5

The set covers a wide range of self-contained calculation domains, from finance and tax to physics and everyday bills, with no obvious dead ends—each tool returns a complete result. Missing general-purpose utilities such as unit/currency conversion or descriptive statistics are notable gaps, but they are workaroundable and don't break the server's specialized calculator model.

Resources