Skip to main content
Glama

IA-QA — 152 QA & Dev Tools for AI Agents

estimate_llm_cost

Read-onlyIdempotent

Estimate the API cost in USD for a given model and token counts, at the price read daily from the provider's own pricing page (prices_as_of, price_status). Any model from list_llm_models.

Input Schema

NameRequiredDescriptionDefault
modelYesModel name, e.g. "gpt-4o", "claude-3.5-sonnet", "deepseek-v3"
input_tokensYesNumber of input/prompt tokens
output_tokensNoNumber of output/completion tokens (default: 0)

Output Schema

NameRequiredDescriptionDefault
modelNo
ratesNo
input_tokensNo
output_tokensNo
input_cost_usdNo
total_cost_usdNo
output_cost_usdNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "input_tokens": 1000000,
      +    "model": "gpt-4o",
      +    "output_tokens": 1000000
      +  }
      +]
  2. Changed1 schema field changed
    • addedOutput schema / properties
      Added value: +{
      +  "input_cost_usd": {
      +    "type": "string"
      +  },
      +  "input_tokens": {},
      +  "model": {},
      +  "output_cost_usd": {
      +    "type": "string"
      +  },
      +  "output_tokens": {},
      +  "rates": {
      +    "type": "object"
      +  },
      +  "total_cost_usd": {
      +    "type": "string"
      +  }
      +}
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "type": "object"
      +}
  4. First observed

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnly/idempotent/non-destructive, so the bar is lower, and the description still adds real value: it discloses provenance and freshness (price read daily from the provider's own pricing page) plus the prices_as_of/price_status signals the caller can use to judge staleness. It doesn't mention behavior for unknown or unlisted models, which keeps it out of 5 territory.

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?

One sentence, front-loaded with the core action, with the provenance caveat in a compact parenthetical. Nothing extraneous.

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?

With an output schema covering return fields and annotations covering the safety profile, the description supplies what's missing: provenance and freshness of prices. Only the edge case of an unrecognized model is unaddressed.

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

Parameters4/5

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

Schema coverage is 100%, so a 3 is the baseline, and the description earns an extra point by explaining where the `model` value must come from (list_llm_models) rather than leaving it as an arbitrary string. Token parameters are left entirely to the schema.

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?

States a specific verb+resource ("Estimate the API cost in USD") with the exact inputs that drive it (model + token counts), which cleanly separates it from token-counting siblings like count_tokens or token_budget_calculator. It also names the model catalog sibling, so the agent knows where valid model names come from.

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?

"Any model from list_llm_models" gives a clear prerequisite/discovery path and the pricing-source note sets expectations about the numbers returned. It stops short of explicit when-not guidance or a direct comparison against token_budget_calculator, so no full 5.

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.