Skip to main content
Glama

AgentTools Hub

Token Estimator

dev_token_estimator

Estimate how many tokens a text consumes for each major model family (GPT, Claude, Gemini, Llama, DeepSeek) using a character/word heuristic that is within ~10% of real BPE tokenizers — enough for context budgeting and cost math, with zero dependencies. — x402 price $0.001/call (USDC, eip155:8453).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesText

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations provided, the description carries the full behavioral burden and adds important context: it is a heuristic within roughly 10% of real tokenizers, has zero dependencies, and requires an x402 payment of $0.001 per call. It does not describe return shape or rate limits, but for a lightweight estimation tool this is a strong disclosure.

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?

The main purpose is front-loaded in a single information-dense sentence, followed by a compact pricing note. It is appropriately sized for the tool, though the em-dash pricing fragment could be cleaner.

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 estimator with no output schema, the description is largely complete: it explains the input concept, the output families, the heuristic nature, and the payment requirement. It could state more about the returned structure, but the core calling requirements are covered.

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% and there is only one parameter, text, whose name and schema already make its meaning clear. The description adds no extra syntax, constraints, or formatting details beyond what the schema provides, so the baseline score is appropriate.

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 states a specific verb and resource: estimating token consumption for multiple named model families. It clearly distinguishes itself as a heuristic estimator rather than a full BPE tokenizer, but it does not explicitly contrast itself with the sibling dev_llm_cost_calculator or other token-adjacent tools.

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?

It implies usage for context budgeting and cost math, which gives an agent a sense of when the tool is appropriate. However, there is no explicit when-not guidance or named alternative for related tasks such as cost calculation.

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