Skip to main content
Glama

Token Diet

Server Details

Count tokens exactly for any text and see if it fits a 128K, 200K or 1M context window.

If you are the author of this connector, you can claim ownership by verifying the domain or GitHub account it belongs to. Claimed connector authors can inspect health checks, view analytics, and manage their listing.
Status
Healthy
Last Tested
Transport
Streamable HTTP · MCP 2025-11-25
URL

TDQS

A4.6/5.0

Scored across 1 tool

Disambiguation5/5

There is only one tool, so there is nothing to confuse it with. The description also explicitly scopes it ('Not for shortening text') and states when to use it versus estimating, eliminating ambiguity.

Naming Consistency5/5

The single tool uses clear snake_case with a server prefix (tokendiet_count_tokens), matching a verb_noun pattern. No conflicting conventions exist, so naming is fully predictable.

Tool Count4/5

Token counting is a narrow, single-purpose utility, so one focused tool is a reasonable scope rather than an extreme mismatch. It could arguably be slightly richer (e.g. encoding selection), but nothing feels bloated or missing structurally.

Completeness4/5

The tool covers the core need: exact token counts, word/char counts, and per-window usage, plus model-family caveats. Minor gaps exist, such as no selectable encoding/tokenizer or multi-text batch mode, but agents can work around them.

Available Tools

1 tool
tokendiet_count_tokensCount the exact tokens in a textA
Read-onlyIdempotent
Inspect

Use when the user asks how many tokens a text, prompt, log, document or code paste is, whether it fits a context window (128K, 200K, 1M), or how big something is before they send it to an AI. Returns the exact o200k token count (GPT-4o family and later; Claude and Gemini usually within about 15%), plus words, characters and how much of each window it uses. Language models cannot count their own tokens, so call this instead of estimating. Example: {"text": ""}. Not for shortening text.

NameRequiredDescriptionDefault
textYesThe text to count (up to 200,000 characters).

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the readOnly/idempotent annotations: it discloses the tokenizer (o200k, GPT-4o family and later), the expected accuracy for Claude and Gemini (~15% variance), the full set of returned metrics (tokens, words, characters, window utilization), and the 200K character ceiling. This is exactly the accuracy-caveat context an agent needs to relay results honestly.

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?

Front-loaded with the trigger condition, then the return shape, then the justification for not estimating, then the exclusion. Dense but every sentence carries decision-relevant information; nothing is padding.

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

Completeness5/5

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

For a single-parameter read-only counting tool with no output schema, the description covers trigger, tokenizer, accuracy caveats, returned fields, and input limits. An agent could invoke and correctly report results with no further information.

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 coverage is 100% and the single `text` parameter is already documented with its 200,000-character limit, so the schema does the heavy lifting. The description's JSON example merely restates the schema shape rather than adding syntax or formatting rules, so the baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource (count tokens in a text) and enumerates the exact input classes it covers: text, prompt, log, document, code paste. It also carves out what it is not ("Not for shortening text") and names the specific tokenizer used, so the tool is unambiguous even without siblings.

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

Usage Guidelines5/5

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

Gives an explicit trigger ("Use when the user asks how many tokens..."), a proactive condition (checking fit against 128K/200K/1M context windows before sending), and a clear exclusion ("Not for shortening text"). It also says to call this *instead of estimating*, which preempts the most likely competing behavior.

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. 2 tool updates
    • Addedtokendiet_count_tokens
    • Removedtokendiet_trim_text
  2. 1 tool update
    • First observedtokendiet_trim_text

Related MCP Connectors

Related MCP Servers

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources