Skip to main content
Glama

llm_cost

Read-only

Paid ($0.01 USDC via x402). Token & cost calculator: estimate tokens for a text (or pass input_tokens/output_tokens) and price it across several models using provider list prices (LiteLLM price table, MIT). Params: models (comma list of model ids like gpt-4o-mini, claude-sonnet-4-5, gemini/gemini-2.5-flash or search words, max 15), text or input_tokens, output_tokens, calls. Calling this tool returns the exact HTTP request and x402 payment requirements; pay with any x402 client to get the data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textNo
callsNo
modelsNo
input_tokensNo
output_tokensNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4/5.0
Behavior5/5

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

Annotations cover only readOnlyHint and openWorldHint, so the description carries the critical extra burden and does so well: it discloses that the tool is paid ($0.01 USDC via x402), that calling it does NOT return data but instead returns the exact HTTP request and x402 payment requirements, and that a payment client is needed to actually get the result. This two-step payment behavior is essential and not derivable from structured fields.

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?

It is a dense but well front-loaded paragraph: purpose first, then the paid/x402 behavior, then parameter notes. Nearly every clause earns its place, though the sentence packing model ids and constraints is slightly heavy.

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, no-output-schema tool this is close to complete: it explains the payment/return contract, the parameter list, and the token-vs-text input modes. The undefined 'calls' parameter and the exact response shape are the only remaining gaps.

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

Parameters4/5

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

Schema coverage is 0%, so the description must compensate, and it does for most parameters: models is explained with concrete id examples and a 'max 15' constraint; text vs input_tokens/output_tokens alternatives are clarified; output_tokens is named. Only 'calls' is listed without any explanation of its meaning or format.

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?

The description names a specific verb and resource: 'Token & cost calculator' that estimates tokens and prices them across models. It is clear what the tool does, but it does not differentiate itself from close siblings like llm_pricing or dump_llm_pricing, which an agent must distinguish on its own.

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?

It gives input paths ('pass a text' vs 'pass input_tokens/output_tokens'), which implies usage, but never states when this tool should be chosen over the pricing siblings. No exclusions or alternative-routing guidance is provided.

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