Skip to main content
Glama

Compare the cost of the same workload on several models

compare_llm_costs
Read-onlyIdempotent

USD cost of the same call (same token counts) on each of several models, cheapest first. Use it to pick a model or to price a switch.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "models": "<models>",
      "inputTokens": "<inputTokens>",
      "outputTokens": "<outputTokens>"
    },
    "name": "compare_llm_costs"
  }
}

Input Schema

NameRequiredDescriptionDefault
callsNoNumber of calls like this one, e.g. per user per month.
modelsYesModel ids to compare.
inputTokensYesPrompt tokens per call, including any cached ones.
cachedTokensNoHow many of the prompt tokens are read from the prompt cache.
outputTokensYesReply tokens per call.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior3/5

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

Annotations already cover readOnly, idempotent, non-destructive, closed-world behavior, so safety is settled. The description adds real value by disclosing the output ordering (cheapest first), but it says nothing about the 2–20 model constraint, how unknown model ids are handled, or whether prices are static catalog values versus live.

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?

Two short sentences, front-loaded with the return meaning followed by the use case. Nothing is wasted, though the brevity contributes to the missing edge-case coverage.

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?

No output schema exists, but the description discloses the essential return shape: one USD cost per model, ascending. It is nearly complete for a pure calculation tool; only model-id validity and price-source behavior are absent.

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 description coverage is 100%, so all five parameters — calls, cachedTokens, inputTokens, outputTokens — are already documented in the schema. The description only restates the 'same token counts' premise, adding no syntax or interpretation beyond structured fields. Baseline 3 applies.

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 concrete result — USD cost of the same call on each of several models, sorted cheapest first — so the agent knows exactly what comes back. It does not distinguish itself from the similar sibling estimate_llm_cost, which appears to price a single model, leaving some ambiguity.

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?

Gives an explicit purpose: pick a model or price a switch. That is a clear usage context, but there are no exclusions or pointers telling the agent to use estimate_llm_cost for one model instead.

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.