Skip to main content
Glama

estimate_cost

Calculate the cost of an LLM API request by providing model ID, input tokens, output tokens, and optional currency (CNY or USD).

Instructions

Estimate the cost of a single request for a given model and token counts.

Args: model_id: model id from list_llm_prices (e.g. "deepseek-v4-pro"). input_tokens: number of input (prompt) tokens. output_tokens: number of output (completion) tokens. currency: "CNY" (default) or "USD".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
currencyNoCNY
model_idYes
input_tokensYes
output_tokensYes
Behavior3/5

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

With no annotations, the description reveals the core behavior but omits details on output format, error handling, and whether costs are approximate or exact. It doesn't disclose if there are any side effects or limitations.

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 concise, front-loaded with purpose, and structured as a clear param list. Every sentence adds value 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?

While the tool is simple, there is no output schema, and the description does not specify the return format or error scenarios. For a cost estimation tool, mentioning the output unit (e.g., cost amount and currency) would improve completeness.

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

Parameters5/5

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

Schema description coverage is 0%, yet the description explains each parameter's role and source (model_id from list_llm_prices, token counts, currency default). This fully compensates for the missing schema descriptions.

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 clearly states the tool estimates cost for a single request given model and token counts. It distinguishes itself from the sibling tool list_llm_prices by specifying that model_id should come from that list.

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 explicitly directs to use model_id from list_llm_prices and mentions default currency. However, it does not explicitly state when not to use this tool or compare with alternatives beyond the sibling reference.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/szp2005/llm-prices-cn'

If you have feedback or need assistance with the MCP directory API, please join our Discord server