Skip to main content
Glama

calculate_cost

Read-onlyIdempotent

Estimate a USD text-token subtotal for one exact offer using current reviewed rates. Input includes cached input. Excludes cache writes, storage, tools and taxes. No model invocation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
usageYes
model_idYes
expected_dataset_revisionNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior4/5

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

Annotations already mark the tool read-only, idempotent, and non-destructive. The description adds meaningful context beyond those: it uses current reviewed rates, excludes cache writes/storage/tools/taxes, and does not invoke a model. No contradiction with annotations.

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?

Three short sentences with no filler. The main purpose is front-loaded in the first sentence, and the subsequent sentences add exclusions and behavioral facts without redundancy.

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?

The description covers scope, exclusions, and the no-invocation behavior, and the output schema exists, so return values need no explanation. However, it does not clarify the optional expected_dataset_revision parameter or the role of max_input_tokens_per_request, leaving some gaps for a tool with nested inputs.

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 the description must compensate, but it only loosely references cached input and text tokens. It does not explain model_id semantics, expected_dataset_revision, or max_input_tokens_per_request. The schema names are self-descriptive, but the description adds minimal parameter-level guidance.

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 states a specific verb ('Estimate'), a clear resource ('USD text-token subtotal'), and a precise scope ('one exact offer'). It also distinguishes this tool from siblings like compare_model_costs by emphasizing single-offer calculation rather than comparison.

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?

The description gives clear context: use this tool when you need a token-cost subtotal for one offer, not for comparing models or invoking a model. It does not explicitly name alternatives or state when-not-to-use, but the 'one exact offer' phrasing implies the boundary against sibling tools.

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.