Skip to main content
Glama

Tokens zählen

tokens_zaehlen

Counts the exact number of tokens of a text for OpenAI tokenizers (o200k for GPT-4o/4.1/o-series, cl100k for GPT-4/3.5) and checks whether it fits a context limit. Useful to plan prompts and costs. For Claude, Gemini or Llama the count is an approximation. Token-Zähler. Preis $0.005 (x402).

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": {
      "text": "<text>"
    },
    "name": "tokens_zaehlen"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYesText
limitNoOptional: Token-Limit zum Prüfen
modellNoTokenizer: o200k (GPT-4o, o1, GPT-4.1) oder cl100k (GPT-4, GPT-3.5); für andere Modelle eine Näherung

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries the full burden; it does disclose good behavioral context — the exact tokenizer mapping, accuracy limits per model family, and a per-call price ($0.005 via x402). It does not state the return shape (a count plus a fits/doesn't-fit result) or confirm it is a side-effect-free computation, leaving gaps for a tool with zero annotation coverage.

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?

Purpose is front-loaded in the first sentence with the key caveat immediately after. The trailing "Token-Zähler." merely restates the title and the price fragment is terse, though both are brief enough not to bloat the entry.

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 3-parameter utility with no output schema and no annotations, the description covers purpose, tokenizer selection, accuracy caveats and cost. It is still thin on what the caller receives back (numeric count vs. boolean limit verdict), which matters precisely because no output schema exists.

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 the schema already documents text, limit and modell. The description reinforces the tokenizer choice semantics (o200k vs cl100k and which models they map to) but says nothing about the limit parameter or how the fit check is applied, adding only marginal meaning.

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?

Names a specific verb and resource ("Counts the exact number of tokens of a text"), scopes it to OpenAI tokenizers with named variants, and adds a second concrete function (context-limit check). An agent knows exactly what the tool does and the tokenizer family it applies to.

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

Usage Guidelines4/5

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

"Useful to plan prompts and costs" gives clear usage context, and the note that non-OpenAI models (Claude, Gemini, Llama) only get approximations effectively signals when the result should not be trusted. No explicit alternative tool or hard exclusion is named, so it stops short of a 5.

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