Skip to main content
Glama

Estimate the cost of LLM requests

estimate_cost

Calculate the USD cost of one or more LLM requests for a chosen model, including input/output tokens, caching, batch pricing, long-context surcharges, and announced price changes.

Instructions

Cost in USD of N requests on one model, with input/output breakdown, caching, batch, long-context surcharges and announced price changes.

Input Schema

NameRequiredDescriptionDefault
dateNoPrice on this date (YYYY-MM-DD), including announced changes; default today
batchNoUse asynchronous batch prices (results within 24 hours)
modelYes
requestsNoNumber of requests to price
input_tokensYesPrompt tokens per request, including cached tokens
output_tokensYesOutput tokens per request, including any reasoning/thinking tokens
cached_input_tokensNoPart of input_tokens read from the prompt cache

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden and does disclose useful behavior: the result is in USD, includes an input/output breakdown, and factors in caching, batch discounts, long-context surcharges, and announced price changes. It does not state that the tool is a pure read-only calculation, nor describe the shape of the returned breakdown, which matters since there is no output schema.

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 dense sentence with the core output (USD cost) front-loaded and the supporting pricing dimensions trailing. Every clause maps to a real feature of the tool; it is efficient, though the enumeration is packed tightly enough to read as a feature list rather than guidance.

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 7-parameter pricing calculator with no annotations and no output schema, the description covers the pricing dimensions well but leaves the return value layout, rounding/currency assumptions, and behavior for unknown models or dates unaddressed. Adequate, but an agent must still probe the output to understand the breakdown.

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 coverage is 86%, so the schema already defines date, batch, requests, token counts, and cached_input_tokens in detail. The description adds only the high-level framing of which pricing dimensions are modeled (batch, caching, long context) and does not explain parameter interactions such as cached_input_tokens being a subset of input_tokens beyond what the schema says.

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?

The description names a specific computation (total USD cost of N requests on one model) and enumerates the modifiers it accounts for (caching, batch, long-context surcharges, announced price changes). This clearly separates it from siblings like get_model_price or list_models, though it never names those siblings explicitly.

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

Usage Guidelines3/5

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

Usage is only implied: 'cost of N requests on one model' suggests this is the tool for multi-request totals rather than per-token pricing. There is no explicit statement of when to prefer this over get_model_price, compare_models, or estimate_text_cost, and no exclusions or prerequisites.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.