Get Gutenberg Book Text
gutenberg_get_textRetrieve the plain-text content of a Project Gutenberg book, stripped of the standard license header and footer so the response contains only the literary work. For long works — novels routinely run 500KB–2MB — use offset and limit to read in chunks rather than fetching the whole book at once. 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.
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. | |
| limit | No | Maximum number of characters to return in this chunk. Default 20,000 (~4–5 pages of prose). Increase toward 50,000 for large context windows. The actual returned length may be slightly less than limit when a natural paragraph boundary is found within 500 characters of the limit — check the length field in the response for the actual character count returned. | |
| 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). |
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. | |
| title | No | Book title, from the catalog record. | |
| length | No | Number of characters in this chunk. | |
| offset | No | Character offset where this chunk begins. | |
| hasMore | No | True if there is more text after this chunk. When true, call again with offset = offset + length. | |
| 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. | |
| 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. |