Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
ANTHROPIC_API_KEYNoAnthropic API key for token counting via the messages.count_tokens endpoint. If not set, Claude token counting falls back to tiktoken's o200k_base encoding.
ANTHROPIC_TOKEN_COUNT_MODELNoThe default Claude model to use when the caller omits the model argument in token counting tools.claude-opus-4-8

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
count_tokensA

Count tokens in text.

Routes by model name to Anthropic/Claude (default) or OpenAI/tiktoken.

Args:
    text: The text to tokenize.
    model: Model or encoding name (e.g. claude-opus-4-8, gpt-4, o200k_base).
        Empty uses ANTHROPIC_TOKEN_COUNT_MODEL.
count_tokens_fileA

Count tokens in a UTF-8 file.

Args:
    file_path: Absolute path to the file.
    model: Model or encoding name. Empty uses ANTHROPIC_TOKEN_COUNT_MODEL.
count_tokens_folderA

Count tokens across all text files in a folder, recursively.

Skips dependency/VCS/build directories (.git, node_modules, .venv, ...)
and binary files (by extension, then a content sniff). Non-UTF-8 text
falls back to UTF-16 (BOM) or cp1252. Returns the sum of per-file counts.

Args:
    folder_path: Absolute path to the folder.
    model: Model or encoding name. Empty uses ANTHROPIC_TOKEN_COUNT_MODEL.
count_lines_fileA

Count lines in a file (str.splitlines semantics: a trailing newline adds no empty line).

Args:
    file_path: Absolute path to the file.
count_chars_fileA

Count characters (Unicode code points) in a UTF-8 file.

Args:
    file_path: Absolute path to the file.
count_kb_fileA

File size in KB as ceil(bytes / 1024), matching Windows Explorer.

Args:
    file_path: Absolute path to the file.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/the-phase-space/tokenizer-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server