Estimate tokens
estimate_tokensEstimate the token count of text using a local heuristic, avoiding tokenizer downloads so you can gauge LLM prompt size before sending it.
Instructions
Estimate the token count of a text (fast heuristic, no tokenizer download).
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": "estimate_tokens"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The text to measure. |