Count characters, words and lines
text_statsCounts exactly what language models are bad at counting: characters (as humans see them), words, lines, sentences, paragraphs, UTF-8 bytes, and occurrences of a letter or substring (e.g. how many "r" in "strawberry"). Use it to check length limits (tweets, SMS, meta descriptions, form fields) before submitting text.
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": "text_stats"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The text to analyze | |
| count | No | Optional letter, word or substring to count occurrences of | |
| overlapping | No | For `count`: count overlapping matches ("aa" in "aaa" = 2). Default false. | |
| case_sensitive | No | For `count`. Default false. |