Skip to main content
Glama

token_calculator

Calculate cost from token counts for any supported AI model. Stateless — no KV required.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYesModel ID to price
inputTokensYesInput token count
outputTokensYesOutput token count

TDQS

A4/5.0
Behavior3/5

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

No annotations are provided, so the description carries the burden. It does mention 'Stateless — no KV required,' which is a useful behavioral disclosure about no side effects, but it doesn't explicitly say the operation is read-only, whether it requires authentication, or what the return format is. This is adequate but not rich.

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 extremely concise: two short sentences. The first sentence states the purpose, the second adds a valuable behavioral note. There is zero redundancy, and it is front-loaded with the action.

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 simple calculator with only three parameters and no output schema, the description is mostly complete. It clearly states what it does and the stateless nature. However, it does not explicitly describe the return value (e.g., a numeric cost in a specific currency), which would be helpful without an output schema, but the simplicity makes it acceptable.

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?

The schema covers 100% of the parameters, each with clear descriptions (model ID, input token count, output token count). The description adds no additional parameter-level semantics beyond what the schema already provides, so the baseline of 3 applies.

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's function: 'Calculate cost from token counts for any supported AI model.' The verb 'calculate' is specific, the resource is well-defined (cost from token counts), and the scope ('any supported AI model') distinguishes it from sibling tools like budget_alert or cost_forecast, which handle broader forecasting or tracking.

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?

The description implies usage: when you have token counts and need a cost estimate. It doesn't explicitly compare to alternatives or state exclusions, but the 'Stateless' hint and focus on token counts provide clear context that this is for one-off calculations, not tracking or forecasting.

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

A4/5.0
Disambiguation5/5

Each tool targets a distinct aspect of cost optimization: tracking, forecasting, alerting, breakdown, and calculation. There is no functional overlap between any pair of tools, making selection unambiguous.

Naming Consistency5/5

All tool names follow a consistent pattern of two lowercase nouns joined by an underscore (e.g., cost_tracker, model_breakdown). The naming style is uniform and predictable.

Tool Count5/5

Five tools is a well-scoped size for an AI cost optimizer, covering the essential operations without unnecessary complexity. Each tool serves a clear and necessary function.

Completeness4/5

The core workflows are covered: recording, retrieving, forecasting, alerting, breakdown, and calculation. Minor gaps exist (no update or delete operations), but agents can accomplish the main lifecycle without significant friction.