Skip to main content
Glama

llm-cost

llm_cost
Read-only

3 free MCP calls per day (all tools together), then $0.005 USDC via x402 or card credits (paid in-band: params._meta["x402/payment"]). 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. When to use: Use llm-cost to compare what a workload costs across models.

Input Schema

NameRequiredDescriptionDefault
textNo
callsNo
modelsNo
input_tokensNo
output_tokensNo

Output Schema

NameRequiredDescriptionDefault
callsNo
resultsNo
sourcesNo
input_tokensNo
output_tokensNo
estimate_methodNo
input_tokens_estimatedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedOutput schema / description
      Previous value: -"Inferred from a real response captured on 2026-10-24; extra fields may appear, null-valued fields are untyped."New value: +"Inferred from a real response captured on 2026-10-26; extra fields may appear, null-valued fields are untyped."
  2. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "description": "Inferred from a real response captured on 2026-10-24; extra fields may appear, null-valued fields are untyped.",
      +  "properties": {
      +    "calls": {
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "estimate_method": {},
      +    "input_tokens": {
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "input_tokens_estimated": {
      +      "type": [
      +        "boolean",
      +        "null"
      +      ]
      +    },
      +    "output_tokens": {
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "results": {
      +      "items": {
      +        "properties": {
      +          "context_length": {
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          },
      +          "cost_per_call_usd": {
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          },
      +          "fits_context": {
      +            "type": [
      +              "boolean",
      +              "null"
      +            ]
      +          },
      +          "input_per_m_usd": {
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          },
      +          "model": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "output_per_m_usd": {
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          },
      +          "requested": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "total_usd": {
      +            "type": [
      +              "number",
      +              "null"
      +            ]
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "sources": {
      +      "items": {
      +        "properties": {
      +          "license": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "name": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "note": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "snapshot": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          },
      +          "url": {
      +            "type": [
      +              "string",
      +              "null"
      +            ]
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "type": "object"
      +}
  3. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Goes well beyond readOnlyHint/openWorldHint by disclosing a concrete commercial constraint (3 free calls per day across all tools, then $0.005 USDC), the exact in-band payment mechanism (params._meta["x402/payment"]), and data provenance (LiteLLM price table, MIT). Rate limit, auth/payment path, and price source are exactly the behavioral facts an agent needs before invoking.

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?

Dense but zero-waste: cost/free-tier framing first, then what it computes, then params, then when-to-use. Four sentences each carrying distinct information, with the commercial constraint front-loaded where it matters most for a paying agent.

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-param, 0%-coverage tool with an output schema, the description covers payment, source of truth, model selection syntax, and the two input modes (estimate vs supplied token counts). It omits only what "calls" means semantically and that numeric inputs arrive as strings, so an agent could mis-specify that one parameter.

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?

With 0% schema description coverage, the description carries the full parameter burden and mostly succeeds: models is given format, examples, search-word fallback, and a hard cap of 15; text vs input_tokens is framed as an either/or. The gap is "calls," which is listed but never explained, and the fact that all five params are typed as strings is not flagged.

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?

States a concrete verb+resource: "Token & cost calculator: estimate tokens for a text ... and price it across several models using provider list prices." That is specific enough to act on. It does not, however, distinguish itself from near-neighbors like token_compare, llm_pricing, or dump_llm_pricing, which an agent could easily confuse it with.

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?

Explicit positive routing exists: "When to use: Use llm-cost to compare what a workload costs across models." It also implies the token-estimation path via the text/input_tokens params. It gives no when-not guidance and never names the sibling tool that would be the alternative, so it stops short of a 5.

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