Skip to main content
Glama

估算使用某個 AI 模型 API 的花費

estimate_ai_api_cost_twd
Read-onlyIdempotent

估算使用某個 AI 模型 API 的花費(美元與新台幣)。文字模型給 input_tokens/output_tokens,繪圖給 images,影片給 seconds,語音給 characters。

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": "<model>"
    },
    "name": "estimate_ai_api_cost_twd"
  }
}

Input Schema

NameRequiredDescriptionDefault
modelYes
imagesNo
secondsNo
charactersNo
input_tokensNo
cached_tokensNo
output_tokensNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already cover the safety profile (readOnly, idempotent, non-destructive, openWorld), so the description only needs to add context. It does add context: the result is expressed in both USD and TWD, and the required metric inputs differ by modality. With no output schema, stating the return currencies is valuable. It does not disclose the pricing source, whether prices are cached or live, or how unknown models are handled, which keeps it from a 5.

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?

One sentence states the purpose and output currencies, and a second sentence lists the modality-to-input mapping. Every clause carries information, it is front-loaded with the verb and resource, and there is no filler.

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 7-parameter estimation tool with no output schema, the description explains most inputs and the return currencies, which is adequate. But the single required parameter, model, is an unconstrained string with no enum and no description, and the description never says what identifiers are valid or where pricing comes from, leaving a real risk of a failed or misleading call. cached_tokens is also unaddressed.

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 description coverage is 0%, so the description carries the parameter burden and mostly succeeds: it explains the semantics of input_tokens, output_tokens, images, seconds, and characters and ties each of them to a modality. This is real added meaning beyond bare parameter names. The gap is cached_tokens, which is never mentioned and whose billing implications are non-obvious, and there is no unit guidance for seconds or characters.

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 states a specific verb and resource: estimating the cost of using a given AI model's API, returned in USD and TWD. The title repeats this, but the body adds the crucial detail that cost estimation varies by model modality. It does not distinguish itself from siblings such as get_ai_api_pricing, so it stops short of a 5.

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 genuinely useful conditional guidance: text models take input_tokens/output_tokens, image models take images, video models take seconds, and speech models take characters. However, it never says when to pick this tool over get_ai_api_pricing or compare_ai_subscriptions, and it does not state prerequisite constraints, such as whether model must be a known identifier or what happens for modalities that are not listed.

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