Get Gutenberg Book Text
gutenberg_get_textRetrieve the plain-text content of a Project Gutenberg book, stripped of the standard license header and footer. Front matter such as producer credits, the title page, contents, and prefaces stays in the text. For long works — novels routinely run 500KB–2MB — use offset and limit to read in chunks rather than fetching the whole book at once, or pass find to jump to a known passage without paging. The response reports totalChars and remainingChars for reliable pagination. Prefers UTF-8 plain text; falls back to an HTML edition converted to text; refuses audio books (media_type "Sound") with a clear error.
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": "gutenberg_get_text"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Project Gutenberg book ID. Use gutenberg_search_books or gutenberg_get_book to find IDs. Example: 1342 for Pride and Prejudice, 2600 for War and Peace, 84 for Frankenstein. | |
| find | No | A passage to locate instead of paging to it: the response starts at the first occurrence at or after offset and adds match, and an absent passage fails with passage_not_found rather than returning other text. Matching ignores letter case and whitespace around find. Any run of spaces, tabs, or line breaks matches any other such run, so a hard-wrapped line still matches. Straight and curly quotes match each other. Accents count: "cafe" does not match "café". Everything else is literal, with no wildcards or patterns, so an italic word stored as _word_ needs its underscores. A blank find is an ordinary read. | |
| limit | No | Requested maximum characters. Default 20,000; requests above 50,000 are capped locally at 50,000. Paragraph-boundary trimming may return less than the applied limit — use length for continuation. Trimming never cuts before a find match ends. | |
| offset | No | Character offset into the stripped literary text at which to start reading. 0 returns the beginning of the work. To read subsequent chunks, use offset = prior_offset + prior_length (the length field from the previous response — NOT offset + limit, because the actual returned length may be slightly less than limit due to paragraph-boundary trimming). With find, the search starts here and the returned chunk starts at the match. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | Gutenberg book ID. | |
| text | No | The requested chunk of literary text, stripped of Gutenberg license boilerplate. Encoding: UTF-8. Line endings: normalized to LF. | |
| error | No | Present when the call failed. Absent on success. | |
| match | No | Where find matched. Absent on a read without find. | |
| title | No | Book title, from the catalog record. | |
| length | No | Number of characters in this chunk. | |
| offset | No | Character offset where this chunk begins: the match start when find matched. | |
| hasMore | No | True if there is more text after this chunk. When true, call again with offset = offset + length and no find. | |
| provenance | No | One-line source note with Project Gutenberg ID, title, and license URL. | |
| totalChars | No | Total characters in the stripped literary text. Use with offset and length to determine progress and plan subsequent calls. | |
| appliedLimit | No | Character limit applied to this chunk, at most 50,000. | |
| sourceFormat | No | The format that was fetched. "text/html" indicates HTML-to-text conversion was applied because no plain-text format was available. | |
| remainingChars | No | Characters remaining after this chunk (totalChars - offset - length). 0 means this chunk includes the end of the book. | |
| requestedLimit | No | Positive integral character limit requested by the caller, before capping. |