Skip to main content
Glama

Coolant

tokens

Count tokens in a string. Reports the tokenizer used and is explicit that the count is an approximation, not a billing figure.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesText to measure. Capped at 64kb by the request body limit.
tokenizerNoOnly cl100k_base is available.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observed

TDQS

A3.8/5.0
Behavior3/5

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

The description discloses that the count is approximate and that the tokenizer used will be reported, which adds transparency. It does not mention potential side effects (none expected) or the 64kb text cap (though that is in the schema). With no annotations, the description carries the burden but only partially covers limitations.

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?

The description is two concise sentences that convey the core function, the reported tokenizer, and the approximation caveat without any redundant words or awkward structure. It is well-organized and front-loaded.

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

Completeness4/5

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

The description is complete for a simple counting tool, covering purpose, the tokenizer reporting, and the approximation caveat. It omits the 64kb text limit, but that is captured in the schema, and there is no output schema to specify. The only minor gap is not stating the output format explicitly, but it implies the token count is returned.

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?

The schema already fully describes both parameters (text and tokenizer) with clear descriptions, so the tool description adds no additional meaning. The description does not mention parameters explicitly, keeping it at the baseline for full schema coverage.

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?

The description clearly states the tool 'counts tokens in a string' and adds specificity by noting it reports the tokenizer used and clarifies that the count is approximate, not a billing figure. This leaves no ambiguity about the tool's function.

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

Usage Guidelines3/5

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

The description provides some guidance by explicitly stating the count is not a billing figure, implying it should not be used for billing purposes. However, it does not mention any alternative tools or broader when-to-use / when-not-to-use scenarios beyond this single caveat.

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