Skip to main content
Glama

Read Book Text

get_book_text
Read-onlyIdempotent

READ PIPELINE step 2 — READ. Read a book's text. Call get_book first (step 1) for the chapter list, then come here. Preferred: use the chapter param to read one chapter at a time (includes [Page N] markers for citation). Alternatively, use from/to for explicit page ranges (e.g. from=1 to=50). When you find passages worth quoting, hand the page numbers to get_quote / get_quotes (step 3) for verbatim text + a citation link. TRUNCATION: the response always includes truncated: true/false. When truncated=true, the truncation_note field gives the exact next from/to values to call — this means content was cut short by a page-budget limit, NOT that the book ended. An AI agent MUST NOT infer end-of-book from pages_returned alone; check truncated first. Daily page budgets apply across get_book_text/get_quote/get_quotes: anonymous 500 pages/24h, signed-in 1,000, free Explorer keys 2,000, paid keys uncapped — sign in at sourcelibrary.org/auth/signin or get a key at sourcelibrary.org/developers. Corpus-scale text belongs on the dataset API (sourcelibrary.org/dataset), not on this tool.

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": {
      "book_id": "<book_id>"
    },
    "name": "get_book_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
toNoEnd page number (inclusive). Recommended chunk size: 50 pages. If the response has truncated=true, use the next from/to from truncation_note.
fromNoStart page number (inclusive). Use with to for explicit page ranges.
langNoISO code of the EDITION to read, e.g. "es". Default "en". Resolved PER PAGE: a page with no text in that language comes back as English, labelled `translation_lang: "en"` (json) or `[Translation — en]` (plain), and the response carries lang_coverage. Chapter text is materialized in English only, so `chapter` with a non-English `lang` is served from the chapter's page range instead.
partNoPart number (1-based) for large chapters split into multiple parts
formatNojson (default, structured with per-page fields) or plain (concatenated text with page markers)
book_idYesThe book: its id, or the slug from a book URL (the part after /book/). Both work.
chapterNoChapter index (0-based). Preferred over from/to — returns pre-structured chapter text with embedded [Page N] markers.
contentNoWhich text to include: ocr (original language), translation (English), or both (default)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / book_id / description
      Previous value: -"The book ID"New value: +"The book: its id, or the slug from a book URL (the part after /book/). Both work."
  2. Changed1 schema field changed
    • addedInput schema / properties / lang
      Added value: +{
      +  "description": "ISO code of the EDITION to read, e.g. \"es\". Default \"en\". Resolved PER PAGE: a page with no text in that language comes back as English, labelled `translation_lang: \"en\"` (json) or `[Translation — en]` (plain), and the response carries lang_coverage. Chapter text is materialized in English only, so `chapter` with a non-English `lang` is served from the chapter's page range instead.",
      +  "type": "string"
      +}
  3. Changed6 schema fields changed
    • changedInput schema / properties / chapter / description
      Previous value: -"Chapter index (0-based)"New value: +"Chapter index (0-based). Preferred over from/to — returns pre-structured chapter text with embedded [Page N] markers."
    • changedInput schema / properties / content / description
      Previous value: -"Default: both"New value: +"Which text to include: ocr (original language), translation (English), or both (default)"
    • addedInput schema / properties / format / description
      Added value: +"json (default, structured with per-page fields) or plain (concatenated text with page markers)"
    • changedInput schema / properties / from / description
      Previous value: -"Start page"New value: +"Start page number (inclusive). Use with to for explicit page ranges."
    • changedInput schema / properties / part / description
      Previous value: -"Part number for large chapters"New value: +"Part number (1-based) for large chapters split into multiple parts"
    • changedInput schema / properties / to / description
      Previous value: -"End page"New value: +"End page number (inclusive). Recommended chunk size: 50 pages. If the response has truncated=true, use the next from/to from truncation_note."
  4. First observed

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already cover the read-only, idempotent, closed-world profile, and the description adds substantially beyond them: truncation semantics (truncated flag + truncation_note giving exact next from/to), an explicit warning that truncation is a page-budget cut rather than end-of-book, and concrete daily page budgets per auth tier with sign-in/key URLs. This is exactly the operational context an agent needs for a paginated read tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the pipeline position and preferred usage, then escalation to truncation and budget details. Dense and mostly earning its place, though the opening 'READ PIPELINE step 2 — READ' restates the title and the URL list is verbose for the value it adds.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For an 8-parameter tool with no output schema, the description covers what an agent genuinely needs: ordering, parameter preference, the truncation return field and its remediation, and budget limits that gate repeat calls. Nothing required to call it correctly or interpret its response is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3, but the description adds selection strategy beyond the schema: prefer chapter over from/to, use from/to for explicit ranges with an example (from=1 to=50), and feed truncation_note values back in. The remaining params (part, lang, content, format) are left to the schema, which is detailed enough to carry them.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Read a book's text') and situates it in a numbered pipeline (step 2 of READ), distinguishing it from get_book (step 1) and get_quote/get_quotes (step 3). An agent can place it precisely among siblings without opening a schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicit sequencing ('Call get_book first'), an explicit preferred mode ('use the chapter param to read one chapter at a time'), an explicit alternative ('use from/to for explicit page ranges'), and an explicit handoff rule to get_quote when quotable passages are found. It also names when NOT to use it (corpus-scale text belongs on the dataset API).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.