Book statistics
book_statsCompute word count, unique words, sentence length, reading time, and chapter extremes for any Project Gutenberg book. Get deterministic stats without model involvement.
Instructions
Compute statistics for a Project Gutenberg book: word count, unique words, average sentence and word length, reading time, most frequent content words, and the longest and shortest chapters. Deterministic counting, no model involved.
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": {
"id": "<id>"
},
"name": "book_stats"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Project Gutenberg book id, e.g. 2701 (Moby Dick) or 1342 (Pride and Prejudice). Find ids with search_books. | |
| top_n | No | How many most-frequent words to list (5-50, default 20). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| note | No | ||
| title | No | ||
| top_words | Yes | Most frequent words, excluding English function words, Mr/Mrs and numbers. | |
| line_count | Yes | ||
| word_count | Yes | ||
| attribution | Yes | Credit line to keep with any quoted text. | |
| unique_words | Yes | Distinct lowercased word forms. | |
| chapter_count | Yes | ||
| sentence_count | Yes | Approximate: ends of sentences found by punctuation, skipping common abbreviations like Mr. | |
| longest_chapter | No | ||
| shortest_chapter | No | ||
| type_token_ratio | Yes | unique_words / word_count. Falls naturally as books get longer, so compare books of similar length. | |
| reading_time_minutes | Yes | At 238 words per minute. | |
| avg_word_length_chars | Yes | ||
| avg_sentence_length_words | Yes |