Skip to main content
Glama

FMF Tools Doc Tools

text_tokens

Exact token count (tiktoken) ($0.001 per call, paid via MPP on Tempo). Exact token counts with OpenAI tiktoken encodings: o200k_base (GPT-4o, 4.1, o-series, GPT-5) and cl100k_base (GPT-4, 3.5, text-embedding-3). Body: JSON {text, encodings?} or raw text. Up to 5 MB of text. HTTP POST https://mpp-docs.fmf-x402.workers.dev/mpp/text/tokens. This MCP wrapper does not settle payment by itself; call with an MPP Payment Authorization header, or use mppx against the HTTP route.

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_tokens"
  }
}

Input Schema

NameRequiredDescriptionDefault
textYes
encodingsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations provided, the description carries the full load and does so well: it discloses the $0.001 per-call cost, the MPP/Tempo payment path, the underlying HTTP route, and the crucial caveat that the MCP wrapper does not settle payment itself — an agent must supply an MPP Payment Authorization header or use mppx. It also caps input at 5 MB. These are exactly the traits an agent needs before invoking.

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?

Front-loaded with the core capability, then pricing/payment, then invocation details — a sensible order. Slight redundancy between the first and second sentences ('Exact token count (tiktoken)' vs 'Exact token counts with OpenAI tiktoken encodings'), but the rest of the text is dense and 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?

No output schema exists, and the description does not describe the return shape (e.g. a count per encoding), which is the one real gap for a multi-encoding request. Everything else an agent needs — required input, size limit, auth/payment, transport — is present, so it is nearly complete for a simple counting tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate, and it largely does: it explains that 'text' can arrive via JSON body or raw text and that 'encodings' is optional, and it decodes the enum values by mapping each to the models they correspond to. The main omission is what happens when 'encodings' is omitted (default set or all encodings).

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?

States a specific verb and resource: 'Exact token count (tiktoken)' and then names the encodings and the models they map to (o200k_base for GPT-4o/4.1/o-series/GPT-5, cl100k_base for GPT-4/3.5/text-embedding-3). This is unambiguous and clearly distinct from the document/audio conversion siblings, none of which count tokens.

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 actionable context: choose the encoding matching the target model, send either JSON {text, encodings?} or raw text, up to 5 MB. It does not include explicit when-not-to-use or alternative guidance, but no sibling competes for this job, so the practical guidance is effectively complete.

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