Skip to main content
Glama

Benchline

Count tokens

count_tokens
Read-onlyIdempotent

Count tokens with the o200k or cl100k encoder and price the count against the published model table. Claude and Gemini rows are estimates, not those vendors' tokenizers.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesThe prompt or document to count.
encodingNoo200k
modelIdsNoPrice rows to return. Unknown ids are rejected.
cachedRatioNo
outputTokensNo
requestsPerDayNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
charsYes
countYes
wordsYes
pricesYes
encodingYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and openWorldHint=false, so safety is covered. The description adds genuine value beyond that by disclosing that Claude and Gemini rows are estimates rather than those vendors' real tokenizers — an important accuracy caveat an agent needs when reporting numbers.

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?

Two sentences, no waste, and the core capability plus the encoder choice are front-loaded. The caveat sentence is short and earns its place by preventing a misread of the estimate rows.

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?

An output schema exists, so return values need no explanation, and annotations cover the safety profile. The remaining gap is the cost-modeling parameters (cachedRatio, outputTokens, requestsPerDay), which an agent cannot interpret from either the description or the schema.

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 only 33%, so the description must compensate, and it partially does: 'o200k or cl100k encoder' explains encoding, and 'published model table' explains modelIds. However, cachedRatio, outputTokens, and requestsPerDay — the parameters that shape the cost model — are left entirely unexplained in both description and schema.

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 names a specific verb+resource ('Count tokens') and adds scope the siblings lack: the o200k/cl100k encoder choice and pricing against a model table. This implicitly separates it from count_text (character/word counting), though it never names that sibling explicitly, keeping it just 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 Guidelines2/5

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

There is no when-to-use or when-not-to-use guidance, and no alternative tool is mentioned despite count_text being a plausible competitor for text-length tasks. The accuracy caveat about Claude/Gemini rows is a limitation note, not routing guidance.

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