Skip to main content
Glama

Lordevo Shop (x402 website checks)

Token count estimate (plus characters, words, bytes) ($0.002/call)

token_count
Read-onlyIdempotent

$0.002 per call (x402, USDC on Base; free trial: add "trial": true or use try_free). [Data utilities] Estimates how many LLM tokens a text uses with a documented offline heuristic (not an exact tokenizer; typically within about 15% for English), with a low/high range, characters, words, lines and UTF-8 bytes. Input: text (POST for long text). Limit: 400,000 characters.

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

Input Schema

NameRequiredDescriptionDefault
textYesPlain text or Markdown, 1-400,000 characters (short text in the query; long text as POST JSON {"text": "..."})
trialNoOptional. true = free if a trial call is left (3 per IP per UTC day), else the payment terms.

Output Schema

NameRequiredDescriptionDefault
toolNo
cacheNo
linesNo
rangeNo
wordsNo
_trialNoPresent when the call was a free trial call.
methodNo
providerNo
price_usdNo
bytes_utf8No
charactersNo
chars_div_4No
is_estimateNo
tokens_estimateNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / trial / description
      Previous value: -"Optional. true = answer free if a trial call is left (3 per IP per UTC day); otherwise you get the payment terms."New value: +"Optional. true = free if a trial call is left (3 per IP per UTC day), else the payment terms."
  2. Changed2 schema fields changed
    • addedInput schema / properties / trial
      Added value: +{
      +  "description": "Optional. true = answer free if a trial call is left (3 per IP per UTC day); otherwise you get the payment terms.",
      +  "type": "boolean"
      +}
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "anyOf": [
      +    {
      +      "required": [
      +        "tool",
      +        "tokens_estimate",
      +        "is_estimate"
      +      ]
      +    },
      +    {
      +      "properties": {
      +        "accepts": {
      +          "type": "array"
      +        },
      +        "error": {
      +          "type": "string"
      +        },
      +        "resource": {
      +          "type": "object"
      +        },
      +        "x402Version": {
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "x402Version",
      +        "accepts"
      +      ]
      +    },
      +    {
      +      "properties": {
      +        "charged": {
      +          "type": "boolean"
      +        },
      +        "error": {
      +          "type": "string"
      +        },
      +        "message": {
      +          "type": "string"
      +        }
      +      },
      +      "required": [
      +        "error"
      +      ]
      +    }
      +  ],
      +  "properties": {
      +    "_trial": {
      +      "description": "Present when the call was a free trial call.",
      +      "type": "object"
      +    },
      +    "bytes_utf8": {
      +      "type": "integer"
      +    },
      +    "cache": {
      +      "type": "object"
      +    },
      +    "characters": {
      +      "type": "integer"
      +    },
      +    "chars_div_4": {
      +      "type": "integer"
      +    },
      +    "is_estimate": {
      +      "type": "boolean"
      +    },
      +    "lines": {
      +      "type": "integer"
      +    },
      +    "method": {
      +      "type": "string"
      +    },
      +    "price_usd": {
      +      "type": "number"
      +    },
      +    "provider": {
      +      "type": "string"
      +    },
      +    "range": {
      +      "type": "object"
      +    },
      +    "tokens_estimate": {
      +      "type": "integer"
      +    },
      +    "tool": {
      +      "type": "string"
      +    },
      +    "words": {
      +      "type": "integer"
      +    }
      +  },
      +  "type": "object"
      +}
  3. Added

TDQS

A4/5.0
Behavior5/5

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

Annotations already cover the read-only/idempotent safety profile, and the description adds a lot on top: per-call pricing with payment rail, the free-trial path, the 400,000-character ceiling, and an honest accuracy caveat (not an exact tokenizer, typically within ~15% for English). The accuracy bound is exactly the kind of trait an agent needs to decide whether to trust the number.

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?

Dense but efficient: pricing first, then a bracketed category tag, then purpose and capabilities in one sentence, then input constraints. Every clause carries information, though leading with cost rather than purpose slightly buries the front-loaded 'what it does'.

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

Completeness5/5

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

Given an output schema already defines the return shape and annotations define the safety profile, the description fills the remaining gaps an agent needs: cost, trial mechanics, input size limit, transport note for long text, and estimation accuracy. Nothing required to call it correctly is missing.

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 100%, so both parameters are already documented in detail, and the description largely restates them (text limit, POST for long text, trial meaning). It adds no syntax or behavioral nuance about the parameters beyond the schema, so the baseline 3 applies.

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 how many LLM tokens a text uses', plus the method (documented offline heuristic) and the extra outputs (characters, words, lines, UTF-8 bytes). The purpose is unmistakable against text-utility siblings like text_chunk or text_extract, though it never explicitly contrasts itself with them.

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?

Usage is only implied (you want a token estimate before sending text to an LLM). It does route cost-sensitive callers to the 'trial': true flag or the try_free sibling, which is a real alternative hint, but there is no explicit when-not-to-use or guidance on choosing this over other text utilities.

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