Skip to main content
Glama

TokenBudget

Estimate the cost of one LLM request across models

estimate_cost
Read-onlyIdempotent

Price one LLM request (input + expected output) on many models at once, cheapest first, with current list prices from each provider's own pricing page (source URL and check date included), prompt-cache and batch discounts, long-prompt surcharges and announced price changes. Also says whether the request fits each model's context window. Call this before an expensive request to pick a model or to stay inside a budget.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "estimate_cost"
  }
}

Input Schema

NameRequiredDescriptionDefault
dateNoPrice on this day (YYYY-MM-DD), to see announced price changes. Default today.
textNoPrompt text. Counted with an estimator, never stored.
batchNoPrice with the provider's batch API discount where one is listed.
modelsNoModel ids to compare, e.g. ["claude-sonnet-5-5", "gpt-6.2-sol", "gemini-3.8-flash"]. Omit to compare every listed model. list_models gives every id.
systemNoSystem prompt text.
messagesNoChat messages [{role, content}]. Counted with an estimator, never stored.
providersNoOnly these providers.
input_tokensNoExact input token count, if you have it. Overrides text and gives an exact cost.
output_tokensNoExpected output tokens (or the max_tokens you will allow).
cached_input_tokensNoHow many input tokens will be read from the prompt cache.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint and closed-world behavior, so the description focuses on useful extra context: list-price provenance with source URL and check date, prompt-cache and batch discounts, long-prompt surcharges, and announced price changes. It stops short of describing pagination or response shape, but adds meaningful behavioral detail beyond the annotations.

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 sentences, front-loaded with the core action and ordering, then the pre-call guidance. The first sentence is dense with a long list of pricing features, but each item is relevant to interpreting results.

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?

For a ten-parameter read-only estimator with no output schema, the description covers what is computed, how results are ordered, and what provenance accompanies prices. It could say more about the exact response fields, but an agent has enough to call it correctly.

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 100%, so all ten parameters are already documented, including the input_tokens override and date semantics. The description adds only the general framing of pricing input plus expected output and the discount concepts, so the baseline of 3 is appropriate.

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 and resource ('Price one LLM request ... on many models at once') plus the ordering and the extra context-window check, which distinguishes it from siblings like get_model_pricing and check_context_fit.

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?

It gives explicit when-to-use guidance: 'Call this before an expensive request to pick a model or to stay inside a budget,' and points to list_models for ids. It does not explicitly exclude the narrower siblings, but the intended context is clear.

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