TokenTally by Harlo
Count tokens (o200k/cl100k), truncate to a budget, chunk text for RAG and estimate LLM cost.
使うべきか
品質と安全性
検出事項(1)
- LOWestimate_cost 内
ツール定義とプロトコルへの準拠に関する自動分析に基づいています。
コンテキストコスト
これは、サーバーのツールがモデルのコンテキストに読み込まれるたびに消費されるおおよそのトークン数です。数が多いほど、ほかのタスクに使える注意が減ります。
インストール
ワンクリックインストール
これを `claude_desktop_config.json` ファイルに追加してください:
{
"mcpServers": {
"tokentally": {
"url": "https://tokentally.mike-tusa.workers.dev/mcp"
}
}
}リモートエンドポイント
https://tokentally.mike-tusa.workers.dev/mcpstreamable-httpできること
ツール一覧
ツール(4)
🟢count_tokens(text)
Count tokens for text in o200k_base and cl100k_base side by side, plus approximate Claude/Gemini/Llama counts with method notes. OpenAI counts (o200k_base, cl100k_base) are exact for those tokenizers. Claude, Gemini and Llama counts are APPROXIMATE (proxy encoding; real tokenizers differ, often by 10-20%, and newer Claude tokenizers by ~30% or more). Cost estimates use a dated price table (prices_as_of 2026-10-27) and are estimates, not live billing. Stateless: text is not stored or logged; no URL fetching. Max input is 256 KB. A single unbroken run of characters near that cap may hit a CPU timeout (503); normal text at the cap is supported.
入力スキーマ
{
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "Text (≤256 KB). URLs are not fetched."
}
},
"required": [
"text"
]
}🟢truncate_to_budget(text, max_tokens, keep, encoding, model)
Truncate text to max_tokens (keep start or end) for an encoding or model.
入力スキーマ
{
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "Text (≤256 KB). URLs are not fetched."
},
"max_tokens": {
"type": "integer"
},
"keep": {
"type": "string",
"enum": [
"start",
"end"
]
},
"encoding": {
"type": "string",
"enum": [
"o200k_base",
"cl100k_base"
]
},
"model": {
"type": "string"
}
},
"required": [
"text",
"max_tokens"
]
}🟢chunk_text(text, chunk_tokens, overlap_tokens, encoding, model)
Split text into token-bounded chunks on paragraph/sentence boundaries with character offsets, token counts and optional overlap.
入力スキーマ
{
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "Text (≤256 KB). URLs are not fetched."
},
"chunk_tokens": {
"type": "integer"
},
"overlap_tokens": {
"type": "integer"
},
"encoding": {
"type": "string",
"enum": [
"o200k_base",
"cl100k_base"
]
},
"model": {
"type": "string"
}
},
"required": [
"text"
]
}🟢estimate_cost(text, input_tokens, output_tokens, models)
Estimate USD cost per model from text or input_tokens plus output_tokens using a dated price table (prices_as_of 2026-10-27). Estimates, not live billing.
入力スキーマ
{
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "Text (≤256 KB). URLs are not fetched."
},
"input_tokens": {
"type": "integer"
},
"output_tokens": {
"type": "integer"
},
"models": {
"type": "array",
"items": {
"type": "string"
}
}
}
}コミュニティ
エビデンス