Count words and characters
count_textUse this when the user asks how long a text is, for example "how many words is this", "character count for this tweet", "will this fit in one SMS", "how long does this take to read". Input tips: pass text exactly as written, up to 20,000 characters (about 3,500 words); do not trim or fix it. Returns: characters, characters without spaces, graphemes (user-perceived characters), words, sentences, paragraphs, lines, UTF-8 bytes, SMS encoding, units and segments, reading minutes, and Flesch reading ease and grade (English only, null otherwise), with the rule used for each count. Not for: counting text inside a file, PDF or spreadsheet the tool cannot see (paste the text instead), or counting tokens for a model. Errors: a text over the limit is refused; split it and add the counts. The text is not stored.
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_text"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The text to count, exactly as the user wrote it (at most 20000 characters, about 3,500 words). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sms | Yes | How a carrier would send the text as SMS. | |
| lines | Yes | Lines separated by a line break. | |
| rules | Yes | The rule behind each count, to quote when the user asks what counts as a word or a character. | |
| words | Yes | Runs of non-whitespace; a hyphenated word or a number is 1 word. | |
| graphemes | Yes | Characters as a reader sees them; an emoji with a skin tone is 1. | |
| sentences | Yes | Sentences, split with English sentence rules. | |
| characters | Yes | Unicode code points; an emoji counts as 1. | |
| paragraphs | Yes | Blocks of text separated by blank lines. | |
| utf8_bytes | Yes | Size of the text in UTF-8 bytes. | |
| reading_minutes | Yes | Silent reading time in minutes at 238 words a minute, one decimal. | |
| flesch_reading_ease | Yes | Flesch Reading Ease, higher is easier (60 to 70 is plain English); null for non-English text or text with no sentence. | |
| characters_no_spaces | Yes | Code points that are not whitespace. | |
| flesch_kincaid_grade | Yes | Flesch-Kincaid US school grade level; null for non-English text or text with no sentence. |