Skip to main content
Glama

IA-QA — 152 QA & Dev Tools for AI Agents

count_tokens

Read-onlyIdempotent

Estimate the token count of a text string using the cl100k_base approximation (~4 chars/token). Shows whether a text fits the context window of a model and what it costs. Returns token estimate, character count, and word count.

Input Schema

NameRequiredDescriptionDefault
inputYesText to count tokens for

Output Schema

NameRequiredDescriptionDefault
charsNo
wordsNo
tokens_estimateNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / examples
      Added value: +[
      +  {
      +    "input": "Hello world, this is a test."
      +  }
      +]
  2. Changed1 schema field changed
    • addedOutput schema / properties
      Added value: +{
      +  "chars": {},
      +  "tokens_estimate": {},
      +  "words": {}
      +}
  3. Changed1 schema field changed
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "additionalProperties": true,
      +  "type": "object"
      +}
  4. First observed

TDQS

Score is being calculated.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.