tksq_count
Counts LLM tokens in a given text using selectable tokenizer encodings, so you can check token usage before and after manual edits.
Instructions
Count the number of LLM tokens in the given text. Supports multiple tokenizer encodings. Useful for checking token usage before and after manual edits.
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": "tksq_count"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The text to count tokens for | |
| tokenizer | No | Tokenizer encoding. cl100k_base=GPT-4/Claude (default), o200k_base=GPT-4o, approximate=fast ~4 chars/token |