Skip to main content
Glama

FernTool Network Tools

estimate_ai_cost

Estimate token count and USD API cost of a text across major AI models (OpenAI GPT, Anthropic Claude, Google Gemini), and whether it fits each context window. Token counts are approximate. Pass text, or tokens directly.

Input Schema

NameRequiredDescriptionDefault
textNo
tokensNo
output_tokensNoExpected reply length in tokens (default: same as input)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It does disclose a genuinely useful behavioral caveat ('Token counts are approximate'), the model coverage, and that the result includes context-window fit, but says nothing about whether it performs live API calls, pricing data freshness, or any rate/auth constraints.

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?

Two tight sentences with the purpose front-loaded and no boilerplate. The approximation caveat and input-mode hint both earn their place, though the sentence fragment 'Pass text, or tokens directly' is slightly clipped.

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?

For a 3-parameter calculator tool with no annotations and no output schema, the description covers purpose, model scope, cost, context-window fit, and accuracy caveat. Gaps remain around the text-vs-tokens relationship and what the returned estimate looks like, which for an unannotated tool is a meaningful omission.

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 only 33% (just output_tokens), so the description must compensate. It partly does by clarifying that text and tokens are alternative input modes ('Pass text, or tokens directly'), but it doesn't state whether they are mutually exclusive, what happens if both are passed, or what unit/encoding 'tokens' assumes.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clear specific verb+resource: 'Estimate token count and USD API cost of a text across major AI models', naming the model families and the context-window fit dimension. It implicitly separates itself from the closest sibling (count_words) because it covers cost and model context windows, not just word counting, but it never acknowledges that overlapping sibling explicitly.

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?

'Pass text, or tokens directly' tells the agent how to invoke it but not when to prefer it over count_words or when a cost estimate is the right call. Usage is only implied by the tool's purpose, with no when/when-not or alternative routing.

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.

Resources