Skip to main content
Glama

Eric Notes

Estimate base token cost

calculate_cost
Read-onlyIdempotent

Estimate USD base token costs for 1–4 model IDs; unknown prices remain null.

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": {
      "ids": "<ids>",
      "inputTokens": "<inputTokens>",
      "outputTokens": "<outputTokens>"
    },
    "name": "calculate_cost"
  }
}

Input Schema

NameRequiredDescriptionDefault
idsYes
inputTokensYes
outputTokensYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

B3.2/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, closed-world), so the description's value is in the output contract: 'unknown prices remain null' tells the agent how to interpret missing data in the absence of an output schema. The 'base' qualifier also signals that only base rates are included, though it doesn't say what is excluded (e.g. discounts, cache pricing).

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?

A single front-loaded sentence with no filler; the null-behavior clause earns its place. The '1–4' cardinality duplicates the schema's minItems/maxItems, which is minor redundancy rather than waste.

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?

For a simple read-only calculator with no output schema, the description supplies the essential output semantics (null for unknown prices). However, with three undocumented parameters and no statement of pricing source or currency assumptions, an agent still has to guess at input formats.

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

Parameters2/5

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

Schema description coverage is 0%, so all three required parameters depend on the description. It clarifies that 'ids' are model identifiers and implies token counts via 'token costs', but never explains the ID format, the token-counting convention for inputTokens/outputTokens, or what the numeric bounds represent.

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?

Specific verb ('Estimate') plus resource ('USD base token costs') and an explicit scope ('1–4 model IDs'), so an agent immediately knows this is a pricing lookup, not a model comparison. It does not name a sibling such as compare_models or get_model to distinguish itself further, which keeps it just 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?

There is no statement of when to use this versus alternatives like compare_models or search_models, and no prerequisites or exclusions. The only guidance is an implicit use case (pre-call cost estimation) and the '1–4' limit, which merely restates the schema's maxItems.

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