Skip to main content
Glama

text_analyze

Read-only

Return deterministic text statistics: bytes, characters, words, lines, sentences, estimated_tokens (characters / 4, rounded up), reading_minutes (at 200 words per minute) and a SHA-256 hash of the exact text. Use it to size text against a context or length limit, or to fingerprint it; counts are heuristics, not a model tokenizer. Runs without network access and does not store your input. Input up to 100,000 bytes; larger input is an error.

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

Input Schema

NameRequiredDescriptionDefault
textYesText to analyze, up to 100 KB.
l402_proofNoL402 payment proof "<macaroon>:<preimage>". Omit on the first call; an unpaid call returns a 0 sat Lightning invoice and the macaroon. Pay the invoice, then repeat the call with this argument set.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / l402_proof / description
      Previous value: -"L402 payment proof \"<macaroon>:<preimage>\". Omit on the first call; an unpaid call returns a 5 sat Lightning invoice and the macaroon. Pay the invoice, then repeat the call with this argument set."New value: +"L402 payment proof \"<macaroon>:<preimage>\". Omit on the first call; an unpaid call returns a 0 sat Lightning invoice and the macaroon. Pay the invoice, then repeat the call with this argument set."
  2. Changed1 schema field changed
    • addedInput schema / properties / l402_proof
      Added value: +{
      +  "description": "L402 payment proof \"<macaroon>:<preimage>\". Omit on the first call; an unpaid call returns a 5 sat Lightning invoice and the macaroon. Pay the invoice, then repeat the call with this argument set.",
      +  "type": "string"
      +}
  3. Added

TDQS

A4.1/5.0
Behavior4/5

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

Beyond the readOnly/destructive annotations, it discloses determinism, no persistent storage of input, offline execution, a hard 100,000-byte ceiling with error-on-exceed behavior, and the exact formulas behind estimated_tokens and reading_minutes. It stops short of mentioning the L402 payment gate or the invoice-returning failure mode in prose, and the claim "runs without network access" sits in mild tension with an openWorldHint=true annotation plus a schema-level Lightning payment flow, though the claim plausibly refers only to the analysis itself.

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?

Four tight sentences with no filler, each carrying distinct information (outputs, use cases, guarantees, limits). The long output enumeration slightly delays the usage guidance, so the front-loading is good but not perfect.

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?

With no output schema, the description correctly takes on the burden of enumerating return fields and their computation, plus the input ceiling and error condition. The remaining gap is the payment/retry protocol, which lives only in the schema rather than the description, and no indication of the response's structural shape.

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, and the description only restates the size limit (100,000 bytes vs. the schema's "100 KB"). It adds nothing about the l402_proof parameter or about what the payment-gated retry looks like in practice, so the baseline 3 applies.

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 opens with a specific verb-and-resource pair ("Return deterministic text statistics") and enumerates the exact outputs (bytes, characters, words, lines, sentences, estimated_tokens, reading_minutes, SHA-256). It also distinguishes itself from a pure hashing sibling by framing the hash as one of several statistics rather than the primary function.

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 gives explicit use cases — sizing text against a context/length limit, or fingerprinting it — and an explicit caveat that counts are heuristics rather than a model tokenizer, which prevents misuse for token budgeting. It does not name an alternative tool (e.g., a dedicated hash sibling) or state when *not* to use it, which keeps it below a 5.

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