Skip to main content
Glama

estimate_cost

Estimate the cost of an AI API call given model and token counts or text. Returns input/output/total cost and optional monthly projection.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textNoText to tokenize for input (if input_tokens not given).
modelYesModel ID, e.g. gpt-4o, claude-opus-4, gemini-2.0-flash.
input_tokensNoNumber of input tokens.
output_tokensNoNumber of output tokens.
requests_per_dayNoIf given, adds daily/monthly/yearly cost projection.

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description must carry the full burden. It discloses the core behavior: calculates cost from inputs and returns a breakdown. However, it does not explicitly state that this is a read-only, non-mutating operation, nor does it mention whether it uses live pricing or has edge cases (e.g., both text and input_tokens provided). The term 'Estimate' implies a calculation, but not full transparency.

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?

The description is a single sentence that front-loads the purpose, conveys the inputs and outputs, and mentions the optional projection. No wasted words; every clause contributes.

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?

The description covers the main inputs and outputs, and the schema covers all parameters. However, there is a minor inconsistency: the description says 'optional monthly projection' while the parameter requests_per_day also mentions daily and yearly projections. Still, the tool is simple and the description is largely complete for an estimation tool.

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% and each parameter has a description. The tool description adds little beyond the schema, though it clarifies the 'or' relationship between text and input_tokens by saying 'token counts or text.' This is useful but not a substantial addition over the schema's own explanation.

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 uses a specific verb ('Estimate') with a clear resource ('cost of an AI API call') and specifies the inputs (model and token counts or text) and outputs (input/output/total cost, optional monthly projection). It clearly distinguishes from sibling tools like count_tokens (token counting) and get_model_pricing (pricing data).

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?

The description implies usage: when you need to estimate cost and have model and token counts or text, use this tool. However, it does not explicitly state when not to use it or mention alternatives (e.g., count_tokens for tokenization, get_model_pricing for raw price lookup). The guidance is implicit rather than explicit.

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.

TDQS

A3.9/5.0
Disambiguation5/5

Each tool has a distinct purpose: counting tokens, estimating cost, retrieving pricing, and listing models. No overlap in functionality.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern: count_tokens, estimate_cost, get_model_pricing, list_models. Clear and predictable.

Tool Count5/5

Four tools are well-scoped for a token counting and cost estimation server, covering the core needs without bloat.

Completeness4/5

The surface supports counting, cost estimation, pricing lookup, and model discovery. A minor gap is lack of batch token counting across multiple files, but core workflows are covered.