Skip to main content
Glama

token_count

Estimates the token count of a text for GPT/Claude-style tokenizers and the input cost at common model prices. 0.001 USDC per call via x402.

Input Schema

NameRequiredDescriptionDefault
textYesText
paymentProofNoPayment proof: USDC tx hash on Polygon or Base (0x...) or Solana tx signature. Omit on the first call to receive the 402 payment instructions, pay, then call again with the proof.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.8/5.0
Behavior4/5

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

No annotations are provided, so the description carries the full burden, and it does disclose the paid nature (0.001 USDC per call via x402) and that results are estimates rather than exact counts. It does not explain the two-step 402 flow or any rate/accuracy caveats, but those are covered in the schema's paymentProof field.

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 tight sentences, zero filler; the core purpose and the cost are both front-loaded and every clause earns its place.

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?

Covers what the tool does, that results are estimates, and that calls are paid, which is the key non-obvious behaviour. With no output schema, an explicit statement of what comes back (count and estimated cost) would round it out, but the payment mechanics are already fully documented in the parameter 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 description coverage is 100% and the paymentProof field already documents the 402 retry flow in detail, so the schema does the heavy lifting. The description adds nothing about parameter syntax or format, which is acceptable at the baseline.

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?

States a specific verb and resource: 'Estimates the token count of a text' plus input cost. The mention of GPT/Claude-style tokenizers implicitly separates it from the crypto 'token' siblings (token_audit, token_market, trending_tokens), but it never names text_stats or any other near-neighbour, so differentiation is inferred rather than stated.

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 implies the use case (budgeting prompt size / input cost) but gives no explicit when-to-use or when-not-to-use rules, and does not mention the closest sibling text_stats. An agent must infer the choice from the tool name alone.

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.