Skip to main content
Glama

Estimate cost

estimate_cost

Estimate the cost of a single LLM call before making it, using known or estimated token counts from text inputs, all offline without API keys.

Instructions

Estimate the cost of a single LLM call for one model from known or estimated token counts. Offline, no keys.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYesModel alias or full id, e.g. "sonnet" or "claude-sonnet-4-6".
inputTokensNoExact input tokens; optional if inputText is given.
outputTokensNoExact output tokens; defaults to the model output cap.
inputTextNoPrompt text; estimated to tokens if inputTokens is absent.
expectedOutputTextNoExpected output text; estimated if outputTokens is absent.
charsPerTokenNoOverride the chars-per-token heuristic divisor.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYes
providerYes
tierYes
inputTokensYes
outputTokensYes
tokensWereEstimatedYes
costYes
breakdownYes
pricingYes
catalogVersionYes
asOfYes
Behavior3/5

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

With no annotations, the description carries full burden. It discloses offline behavior and no key requirement, but lacks details on idempotency, caching, error conditions, or whether it uses live pricing data. Adds some transparency but insufficient for a tool with zero annotations.

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?

Two concise sentences, front-loaded with purpose. No fluff or redundancy. Every word adds value.

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?

With 6 params and an output schema available, the description covers basic purpose and key behavioral trait (offline, no keys). However, it doesn't differentiate from similar sibling predict_cost, nor explain expected input format details or error cases. Adequate but not thorough.

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 the description need not repeat parameter details. It adds the global context 'Offline, no keys' and mentions charsPerToken override, but no additional semantics beyond the schema for individual parameters. Baseline 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?

Clearly states verb 'estimate cost' and resource 'single LLM call for one model'. Distinguishes from siblings like compare_models, get_pricing, and predict_cost by focusing on a single call with known/estimated token counts and emphasizing offline usage.

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?

Mentions 'Offline, no keys' implying no API call needed, but does not explicitly state when to use this tool versus alternatives like predict_cost or select_optimal_model. No when-not-to-use guidance.

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/sachinuppal/modelcostsaver'

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