Skip to main content
Glama

token_cost_estimate

Read-onlyIdempotent

Estimate dollar cost and wall-clock time for LLM token usage using model-specific pricing and token-to-time mapping, including input/output/overhead breakdowns.

Instructions

Estimate wall-clock time AND dollar cost for LLM token usage.

Combines token-to-time mapping with model-specific pricing data. Returns cost breakdown (input/output/overhead) alongside the time estimate. Use token_time_bridge when you only need wall-clock time and not dollar cost.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "tokens": "<tokens>",
      "model": "<model>"
    },
    "name": "token_cost_estimate"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelYesLLM model identifier. Unknown models fall back to generic estimates.
tokensYesTotal number of tokens in the LLM request (prompt + completion).
task_typeNoOptional task type for feedback matching.
tool_callsNoNumber of tool calls expected in the agentic loop.
reasoning_depthNoExpected depth of chain-of-thought reasoning.moderate

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.8.0
    • removedInput schema / additionalProperties
      Removed value: -false
  2. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already establish this as a safe, idempotent, closed-world read, so the bar is lower. The description adds genuine behavioral context beyond them: it merges time mapping with model-specific pricing and discloses the shape of the result (cost breakdown across input/output/overhead alongside the time estimate).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the two headline outputs, and the routing sentence at the end earns its place. The line "Combines token-to-time mapping with model-specific pricing data" largely restates the opening claim and could be cut.

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 5-parameter, 2-required estimation tool with no output schema, the description covers purpose, return contents, and the key alternative. What is missing—units of the cost figure, currency, and assumptions underlying the estimate—is secondary but not trivial for a pricing 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 description coverage is 100%, so all five parameters are already documented, including the unknown-model fallback and the enums for task_type and reasoning_depth. The description only implies that the model parameter drives pricing and does not explain how task_type or reasoning_depth change the estimate—baseline 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?

Names a specific verb ("Estimate") and two concrete outputs (wall-clock time AND dollar cost) scoped to LLM token usage, then explicitly distinguishes itself from the sibling token_time_bridge. An agent can pick between the two without opening either schema.

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?

Provides an explicit when-to-use-the-other-tool clause: "Use token_time_bridge when you only need wall-clock time and not dollar cost." That is a real routing rule. It does not explain when to set task_type or reasoning_depth, or how it relates to other estimation siblings, so it stops short of full guidance.

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