Skip to main content
Glama

Lordevo Shop: website checks for agents (x402)

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

token_count
Read-onlyIdempotent

$0.0021 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.2/5.0
Behavior4/5

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

Beyond the annotations (readOnly, idempotent, non-destructive, closed-world), the description discloses pricing ($0.0021/call via x402 USDC on Base), the free-trial allotment (3 per IP per UTC day) and the accuracy ceiling of the heuristic. That is meaningful behavioral context not present in structured fields. Minor gap: it doesn't restate that results are deterministic for identical input, though the idempotentHint covers that.

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?

Effectively one dense, front-loaded paragraph: price, then the [Data utilities] tag, then capability, accuracy caveat, outputs, input handling and limit. Almost every clause carries information, though the price and character limit are repeated from the title and schema.

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?

For a simple two-parameter, read-only utility with full schema coverage, annotations and an output schema, the description supplies everything an agent needs: what it computes, how accurate it is, what it costs, how to get it free, and input size limits. Return-value details can be left to the output 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 coverage is 100%, so both `text` and `trial` are already fully documented in the schema. The description restates the 400,000-character limit and POST-for-long-text guidance, which duplicates the schema rather than adding new meaning. Baseline 3 is appropriate.

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?

Names a specific verb and resource ('estimates how many LLM tokens a text uses') plus the method ('documented offline heuristic'), and adds the secondary outputs (characters, words, lines, UTF-8 bytes). No sibling in the catalog does tokenization, so an agent can immediately tell what this is for.

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?

Gives clear operating context: use `try_free` or set trial=true for the free path, use POST for long text, and keep input under 400,000 characters. It also warns the result is an approximation (~15% for English), which is a real usage constraint. It stops short of explicitly stating when another tool (e.g. a byte/length utility) would be preferable.

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