Skip to main content
Glama

tokenize

Read-onlyIdempotent

Convert UTF-8 text into individual tokens using a deterministic tokenizer model. Returns the resolved model, token strings, and token count for exact analysis without storing input.

Instructions

Tokenize UTF-8 text into individual tokens with a supported deterministic Algenta tokenizer model (default text.tokenizer; call list_models for every supported model id). Use this when you need the token strings themselves; call count_tokens when you only need the number. Read-only and deterministic: the same input and model always return the same tokens, and nothing is stored. Returns the resolved model id, its tokenizer_kind, the tokens array, and token_count. An unsupported model id fails with model_not_supported.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYesUTF-8 text to tokenize.
modelNoTokenizer model id from list_models.text.tokenizer

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.1.3
    • addedInput schema / properties / input / description
      Added value: +"UTF-8 text to tokenize."
    • addedInput schema / properties / model / description
      Added value: +"Tokenizer model id from list_models."
  2. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false. The description adds meaningful extra behavior: determinism ('same input and model always return the same tokens'), the fact that nothing is stored, the exact returned fields, and the error mode model_not_supported. This genuinely enriches the annotation-only picture without contradicting it.

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?

The description is longer than one sentence but every sentence carries a distinct purpose: purpose, alternate tool, behavioral guarantees, return shape, and error behavior. It is front-loaded with the core action. Slightly dense, but nothing is filler.

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?

Even though there is no output schema, the description lists all returned fields (resolved model id, tokenizer_kind, tokens array, token_count) and the failure case. With only two simple parameters and rich annotations, no piece of information an agent needs to invoke this tool correctly is missing.

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 the schema already documents both input and model. The description adds some context—supported deterministic model, default text.tokenizer, and the failure mode for unsupported ids—but most of this is also visible in the schema (e.g., 'Tokenizer model id from list_models'). The added value is modest, so 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?

States a specific verb and resource: 'Tokenize UTF-8 text into individual tokens' with a supported deterministic tokenizer model. It clearly distinguishes itself from the sibling count_tokens by noting it returns the token strings themselves, and identifies the default model. An agent can immediately understand what the tool does and what it is not.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly provides when-to-use guidance ('Use this when you need the token strings themselves') and names the alternative ('call count_tokens when you only need the number'). It also directs the agent to list_models for supported model ids, covering prerequisite knowledge. Left with no ambiguity about when to choose this tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools