Skip to main content
Glama
io.github.ufhouck/aicost-cli

io.github.ufhouck/aicost-cli

get_ai_cost

Calculate the cost of AI model usage from input and output tokens or units, including batch discounts and currency conversion, to estimate API expenses.

Instructions

Alias for calculate_ai_cost: calculate the cost of an AI model usage based on tokens or units.

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": {
      "model_id": "<model_id>"
    },
    "name": "get_ai_cost"
  }
}

Input Schema

NameRequiredDescriptionDefault
batchNoApply Batch API discount if supported (default: false)
unitsNoNumber of units for non-text models (images, seconds, minutes, songs, clips, 1M chars, or months)
currencyNoTarget currency code (default: 'USD')
model_idYesModel ID or alias (e.g., 'gpt-6.2-astra', 'claude-opus-5.5', 'gemini-4-carbon', 'grok-4.7', 'deepseek-v4.1-flash', 'veo-3.1')
input_tokensNoUncached input tokens (for text models)
output_tokensNoOutput completion tokens (for text models)
cached_input_tokensNoCached input tokens billed at cache-read rate

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.3.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full disclosure burden, and it discloses almost nothing beyond the basic calculation. It says nothing about return format, rounding, which pricing source is consulted, freshness of rates, or error behavior for unknown model IDs.

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?

A single front-loaded sentence with the alias relationship stated first and no filler. It is efficiently sized, though the brevity leaves the tool under-specified rather than over-written.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 7-parameter cost calculator with no output schema and no annotations, the definition omits what the agent most needs: the shape of the result, how currency and batch discount affect it, and what distinguishes the token path from the unit path. Relying entirely on the schema leaves behavior and output opaque.

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 every one of the 7 parameters (including inputs for batch discount, currency, and cached input tokens) is already documented in the schema. The description adds only the at-a-glance framing that parameters are either token-based or unit-based, which is a marginal addition over the schema baseline of 3.

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 specific operation ('calculate the cost of an AI model usage') and explicitly identifies itself as an alias for calculate_ai_cost, which immediately tells an agent the two tools are interchangeable. It stops short of a 5 because an agent still cannot tell whether this tool or calculate_ai_cost is the preferred entry point.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No when-to-use or when-not guidance is given beyond the alias note. The phrase 'based on tokens or units' hints that text models use token params and non-text models use units, but it never states the selection rule, prerequisites, or whether currency conversion has constraints.

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