count_tokens
Count tokens in any text using the GPT-3.5/4 tokenizer to check context budget before sending large prompts.
Instructions
Count tokens in text using the GPT-3.5/4 (cl100k_base) tokenizer. Useful for managing context budget before sending a large prompt
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": "count_tokens"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes |