Count words
count_wordsUse this when the user wants word counts or a word frequency table for a text, for example "which words come up most in these reviews" or "count word frequency". Takes text up to 100,000 characters, a stop-word language (en, es, fr, de, it, pt or none), extra words to leave out, a case rule, a minimum word length and whether to count numbers. Returns totals, what was skipped and why, the top words with counts and percents, and a CSV of all counted words. Uses the same word rules as make_word_cloud. Does not draw a picture, read files, stem words or split Chinese, Japanese or Thai text into words.
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_words"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| case | No | fold (default for text): Apple and apple count as one word, shown in lower case; as_written (default for a word list): case is kept and counted apart. | |
| text | Yes | The text to count, up to 100,000 characters, e.g. an article, survey answers or meeting notes pasted by the user. | |
| min_length | No | Shortest word to count, in characters, 1 to 20 (default 2), e.g. 3. | |
| stop_words | No | Stop-word list to remove common function words: en (default, English), es, fr, de, it, pt, or none to keep all words. Other languages keep all words, e.g. "es". | |
| exclude_words | No | Extra words to leave out, up to 100, matched without case, e.g. ["project", "team"]. | |
| include_numbers | No | Count number-only words such as 2026 (default false). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rules | Yes | ||
| counts | Yes | ||
| warnings | Yes | ||
| downloads | Yes | ||
| top_words | Yes | ||
| rows_total | Yes | ||
| preview_count | No |