Token Counter
Server Details
Counts tokens under OpenAI-compatible (tiktoken) encodings, by model or encoding name.
- Status
- Healthy
- Uptime
- 99.5% over 44 days
- Last Tested
- Transport
- Streamable HTTP · MCP 2025-11-25
- URL
TDQS
Scored across 1 tool
With only one tool, there is no ambiguity. An agent cannot confuse it with any other tool, as there are no alternatives.
The single tool 'tokens_count' uses a clear snake_case naming pattern. While there is no other tool to compare, the name is self-consistent and follows a reasonable convention.
One tool is exactly appropriate for a focused token counter server. The tool performs a single, well-defined task that matches the server's purpose.
The tool covers the stated domain of counting tokens for OpenAI-compatible encodings. However it explicitly excludes Claude/Anthropic tokenization, which could be a gap for broader LLM token counting needs.
Available Tools
1 tooltokens_countAInspect
Counts tokens under an OpenAI-compatible (tiktoken) encoding. Provide exactly one of model (e.g. "gpt-4o") or encoding ("o200k_base" or "cl100k_base"). No Claude/Anthropic tokenizer.
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | ||
| model | No | e.g. gpt-4o; exactly one of model/encoding | |
| encoding | No | o200k_base or cl100k_base; exactly one of model/encoding |
Output Schema
| Name | Required | Description |
|---|---|---|
| tokens | Yes | |
| encoding | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description must carry the transparency burden. It discloses the compatibility boundary and the exclusive parameter requirement, but it does not describe behavior for invalid combinations (both/neither model and encoding) or tokenization nuances beyond the schema. This is adequate but not rich.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, tightly worded, and front-loaded with the core action. Every sentence contributes essential scope or constraint information with no redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
This is a low-complexity tool, and the description covers the essential input constraints, compatibility scope, and exclusions. An output schema exists, so the lack of return-value detail is not a gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 67%, and the schema already includes the 'exactly one' constraint for model/encoding. The description reinforces this and adds concrete values, but it adds little meaning beyond the schema for the 'text' parameter and does not clarify edge-case semantics.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with a specific verb and object ('Counts tokens') and clearly scopes the operation to OpenAI-compatible tiktoken encodings. It also explicitly excludes Claude/Anthropic tokenizers, distinguishing it from potential alternatives even in the absence of sibling tools.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides explicit usage constraints: provide exactly one of 'model' or 'encoding', with concrete examples. It also states when not to use it ('No Claude/Anthropic tokenizer'), though it does not name alternative tools because none are listed.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
- First observed
tokens_count
Related MCP Connectors
Exact Claude API cost calc with real cache economics, plus a tiktoken-misuse scanner.
Compare up-to-date pricing for 40+ LLMs (incl. Chinese) & estimate cost from tokens. EN/zh.
Find AI model pricing, estimate token costs and compare offers. No API key required.
PDF, Word, Excel, CSV, HTML and XML to clean Markdown for LLMs and RAG, with token counts.
Related MCP Servers
- AlicenseAqualityDmaintenanceEstimates Claude API token counts, per-model cost, and prompt-caching break-even without an API key or network.5MIT
- AlicenseBqualityDmaintenanceToken usage tracker for OpenAI and Claude APIs with MCP (Model Context Protocol) support.6134 npm5MIT
- AlicenseNot gradedqualityBmaintenanceMCP server for deterministic, zero-dependency context-window math, enabling token estimation, text truncation, and budget reporting without a tokenizer.MIT
- FlicenseNot gradedqualityCmaintenanceProvides tools to count tokens, estimate API costs, optimize prompts, and compare AI model pricing for multiple LLMs.72 npm-
Glama MCP Gateway
Add one secure layer between your agents and this server.