Skip to main content
Glama

Estimate tokens (free)

estimate_tokens
Read-onlyIdempotent

[FREE] Fast approximate token count of text (heuristic estimate, not a real tokenizer; no prices). Limit 120/hour per IP.

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": "estimate_tokens"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.4/5.0
Behavior5/5

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

The annotations already mark this as read-only, idempotent, non-destructive, and closed-world. The description adds meaningful context beyond those: it is a heuristic approximation rather than a real tokenizer, returns no prices, and is rate-limited to 120 calls per hour per IP.

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 a single compact statement with the most important qualifier, 'FREE', front-loaded. Every clause adds useful information and there is no repetition.

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?

For a simple one-parameter estimation tool, the description covers the essential caveats: approximate, heuristic, free, no prices, and rate limit. It does not explicitly say the result is an integer count, but that is strongly implied by the tool name and purpose.

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?

There is only one required parameter, 'text', and the description says the tool counts tokens 'of text'. That is enough for an agent to understand the input, but schema description coverage is 0% and the description adds no format, size, or encoding details.

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 gives a specific verb and resource: 'Fast approximate token count of text.' It also distinguishes itself from siblings like summarize or text_embeddings by clarifying this is a heuristic estimate, not a real tokenizer.

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?

It clearly frames the tool as free, heuristic, and not a real tokenizer, which signals when to use it for quick estimates. However, it doesn't explicitly say when not to use it or name an alternative for precise tokenization.

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