Skip to main content
Glama

Calculate cost

calculate_cost
Read-only

Estimate cost from total input tokens, their cached subset, output tokens and request count. Optional batch_mode uses available batch rates with standard-rate fallback.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
model_idNomodel id
requestsNorequests
batch_modeNobatch mode
input_tokensNoinput tokens
output_tokensNooutput tokens
cached_input_tokensNocached input tokens

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / batch_mode
      Added value: +{
      +  "description": "batch mode",
      +  "type": "boolean"
      +}
  2. First observed

TDQS

B3.3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, so the safe-read profile is covered. The description does add one genuine behavioral detail beyond annotations — that batch_mode uses batch rates with a standard-rate fallback — but says nothing about units, currency, or how optional parameters default, which matters for a 6-param tool with zero required fields.

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?

Two sentences, no filler, with the core operation front-loaded ahead of the optional-mode caveat. Every clause carries information.

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

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be described, and the batch_mode caveat is a useful addition. However, with six parameters all optional and none marked required, the description leaves the agent guessing which inputs are actually needed and in what units, so it is only minimally sufficient.

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 nominally 100%, so the baseline is 3, though those schema descriptions are bare name restatements. The description adds real value for two params: it clarifies that cached_input_tokens is a subset of input_tokens, and explains batch_mode's fallback behavior. It says nothing about model_id, the most consequential parameter, nor about the accepted string/number/array forms.

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 ("Estimate cost") and enumerates the inputs it operates on: input tokens, cached subset, output tokens, request count. It is clearly distinguishable from siblings like find_cheapest or compare_models, but it never explicitly names or contrasts those siblings, so it stops short of a 5.

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

Usage Guidelines2/5

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

The only usage signal is that batch_mode is optional and falls back to standard rates. There is no guidance on when to reach for this tool versus benchmark_lookup, find_best_value, or find_cheapest, and no stated prerequisites (e.g., that a model_id is effectively needed for a meaningful result).

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