tokens
Count tokens in a string. Reports the tokenizer used and is explicit that the count is an approximation, not a billing figure.
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": "tokens"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Text to measure. Capped at 64kb by the request body limit. | |
| tokenizer | No | Only cl100k_base is available. |