Skip to main content
Glama

internet-archive-mcp-server

Get Internet Archive Item Text

ia_get_text
Read-onlyIdempotent

Retrieve readable OCR DjVuTXT or plain text from an Internet Archive item, including public-domain books, documents, scanned periodicals, and transcripts. Each call reads one text file: the one file names, or by default the first DjVuTXT file (else Text, Plain Text, or another .txt file). An item can hold several, such as one per volume; a notice then gives the count. Set max_chars for page size, then pass next_continuation as continuation with the same identifier and omit char_offset. Direct char_offset access remains available. To jump to a passage, pass find with a phrase: the page starts at its first match at or after char_offset or the continuation's position, and match_offset reports where; that page's next_continuation, passed back with the same find, searches on from the page's end. To list the DjVuTXT files of an item, call ia_get_item with format "DjVuTXT".

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": {
      "identifier": "<identifier>"
    },
    "name": "ia_get_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileNoThe text file to read, named exactly as ia_get_item lists it, e.g. "Strabo 02 Geography 3-5_djvu.txt". It must be readable text: format DjVuTXT, Text, or Plain Text, or a .txt name whose format is not Metadata. Omit to read the default: the first DjVuTXT file, else Text, else Plain Text, else another .txt file. With continuation, omit it or name the file the continuation reads; blank is omitted.
findNoA literal phrase of at most 500 characters to find in the file read; the page then starts at its first match at or after char_offset or the continuation's position. Letters match regardless of case, one character to one (ß never matches ss); a whitespace run in the phrase matches any whitespace run in the text, line breaks included; every other character matches itself. OCR misreads and words hyphenated across line ends break a phrase, so prefer a short, distinctive one. Blank is omitted.
max_charsNoMaximum number of characters to return in this response. Defaults to the server-configured maximum (IA_MAX_SNAPSHOT_CHARS, typically 50 000); a larger value is served at that maximum, with a notice. Lower values reduce token usage.
identifierYesInternet Archive item identifier, e.g. "prideprejudice00aust" (Pride and Prejudice), from ia_search_items results; or an archive.org item URL, such as https://archive.org/details/prideprejudice00aust or its download, stream, metadata, or embed form, read as the identifier it names. A download, stream, or storage-node URL naming a file reads that file when file is omitted.
char_offsetNoCharacter offset to start reading from (default 0); with find, where the search starts. For sequential pages use next_continuation as continuation instead. Omit char_offset when using continuation.
continuationNoOpaque next_continuation from the previous page. Omit char_offset when using it; blank is omitted.

Output Schema

NameRequiredDescriptionDefault
textNoThe text slice starting at char_offset up to max_chars characters.
errorNoPresent when the call failed. Absent on success.
noticeNoExplains a max_chars clamp or why efficient continuation is unavailable, with the next char_offset or end-of-document status; that find matched nothing from char_offset to the end of source_file; or — when file was omitted — how many readable text files the item holds and how to list them.
has_moreNoTrue when there is more text beyond this slice. Use next_continuation, or add max_chars to char_offset if no token is available.
max_charsNoMaximum characters this response could hold — the requested max_chars, or the server maximum when the request exceeded it.
char_offsetNoCharacter offset used for this response: with find, where its first match begins (equal to match_offset), or where the search started when nothing matched.
source_fileNoFilename of the source text file fetched from the item.
match_offsetNoWith find, the character offset where its first match begins, equal to char_offset. Omitted when find matched nothing or was not given.
next_continuationNoOpaque next-page token; use as continuation with the same identifier and omit char_offset. Expires after one hour.
source_file_bytesNoSize of the source text file in bytes, from the item manifest — a byte count, not a character count (non-ASCII text takes several bytes per character). Omitted when the manifest lists no size.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 schema fields changed
    • changedInput schema / properties / char_offset / description
      Previous value: -"Character offset to start reading from (default 0). For sequential pages use next_continuation as continuation instead. Omit char_offset when using continuation."New value: +"Character offset to start reading from (default 0); with find, where the search starts. For sequential pages use next_continuation as continuation instead. Omit char_offset when using continuation."
    • addedInput schema / properties / find
      Added value: +{
      +  "description": "A literal phrase of at most 500 characters to find in the file read; the page then starts at its first match at or after char_offset or the continuation's position. Letters match regardless of case, one character to one (ß never matches ss); a whitespace run in the phrase matches any whitespace run in the text, line breaks included; every other character matches itself. OCR misreads and words hyphenated across line ends break a phrase, so prefer a short, distinctive one. Blank is omitted.",
      +  "maxLength": 500,
      +  "type": "string"
      +}
    • changedOutput schema / properties / char_offset / description
      Previous value: -"Character offset used for this response."New value: +"Character offset used for this response: with find, where its first match begins (equal to match_offset), or where the search started when nothing matched."
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `invalid_continuation`: A continuation is unknown, expired, belongs to another item, reads a different file than file names, or its file changed. `range_unavailable`: The download ignored or returned an invalid conditional byte range. `ambiguous_pagination`: Both a nonblank continuation and char_offset were supplied. `item_not_found`: The identifier does not exist in the Internet Archive. `invalid_identifier`: identifier holds \"/\" or \":\" but is not an archive.org item URL: a URL on another site, a Wayback Machine capture, or an archive.org page that names no item. `invalid_file`: file, or the file a download, stream, or storage-node URL names, is not in the item manifest or is not readable text. `no_text_file`: The item exists but lists no readable text file: no DjVuTXT, Text, or Plain Text file, and no .txt file other than Metadata sidecars. `download_forbidden`: Access to this item is restricted — it is in a login-required or limited collection. `archive_unavailable`: The Internet Archive Metadata API or the text file download did not answer within the request timeout or the call's 55 s deadline (the request timeout when that is longer), could not be reached, answered HTTP 5xx after retries, 429, or another 4xx, or the metadata response was unreadable. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `invalid_continuation`: A continuation is unknown, expired, belongs to another item, reads a different file than file names, or its file changed. `range_unavailable`: The download ignored or returned an invalid conditional byte range. `ambiguous_pagination`: Both a nonblank continuation and char_offset were supplied. `find_incomplete`: With find, the search stopped before the download's request timeout or the call deadline would have cut it off, once past its start, or at a later char_offset it reached with a continuation stored there; or the first match was found past a whitespace run longer than the text one call holds, so the call names the match's char_offset instead of returning its page. `item_not_found`: The identifier does not exist in the Internet Archive. `invalid_identifier`: identifier holds \"/\" or \":\" but is not an archive.org item URL: a URL on another site, a Wayback Machine capture, or an archive.org page that names no item. `invalid_file`: file, or the file a download, stream, or storage-node URL names, is not in the item manifest or is not readable text. `no_text_file`: The item exists but lists no readable text file: no DjVuTXT, Text, or Plain Text file, and no .txt file other than Metadata sidecars. `download_forbidden`: Access to this item is restricted — it is in a login-required or limited collection. `archive_unavailable`: The Internet Archive Metadata API or the text file download did not answer within the request timeout or the call's 55 s deadline (the request timeout when that is longer), could not be reached, answered HTTP 5xx after retries, 429, or another 4xx, or the metadata response was unreadable; or, with find, the download was too slow for the search to get past its start before then. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "invalid_continuation",
      -  "range_unavailable",
      -  "ambiguous_pagination",
      -  "item_not_found",
      -  "invalid_identifier",
      -  "invalid_file",
      -  "no_text_file",
      -  "download_forbidden",
      -  "archive_unavailable"
      -]New value: +[
      +  "invalid_continuation",
      +  "range_unavailable",
      +  "ambiguous_pagination",
      +  "find_incomplete",
      +  "item_not_found",
      +  "invalid_identifier",
      +  "invalid_file",
      +  "no_text_file",
      +  "download_forbidden",
      +  "archive_unavailable"
      +]
    • addedOutput schema / properties / match_offset
      Added value: +{
      +  "description": "With find, the character offset where its first match begins, equal to char_offset. Omitted when find matched nothing or was not given.",
      +  "type": "number"
      +}
    • changedOutput schema / properties / notice / description
      Previous value: -"Explains a max_chars clamp or why efficient continuation is unavailable, with the next char_offset or end-of-document status, or — when file was omitted — how many readable text files the item holds and how to list them."New value: +"Explains a max_chars clamp or why efficient continuation is unavailable, with the next char_offset or end-of-document status; that find matched nothing from char_offset to the end of source_file; or — when file was omitted — how many readable text files the item holds and how to list them."
  2. Changed1 schema field changed
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `invalid_continuation`: A continuation is unknown, expired, belongs to another item, reads a different file than file names, or its file changed. `range_unavailable`: The download ignored or returned an invalid conditional byte range. `ambiguous_pagination`: Both a nonblank continuation and char_offset were supplied. `item_not_found`: The identifier does not exist in the Internet Archive. `invalid_identifier`: identifier holds \"/\" or \":\" but is not an archive.org item URL: a URL on another site, a Wayback Machine capture, or an archive.org page that names no item. `invalid_file`: file, or the file a download, stream, or storage-node URL names, is not in the item manifest or is not readable text. `no_text_file`: The item exists but lists no readable text file: no DjVuTXT, Text, or Plain Text file, and no .txt file other than Metadata sidecars. `download_forbidden`: Access to this item is restricted — it is in a login-required or limited collection. `archive_unavailable`: The Internet Archive Metadata API or the text file download did not answer within the request timeout, could not be reached, answered HTTP 5xx after retries, 429, or another 4xx, or the metadata response was unreadable. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `invalid_continuation`: A continuation is unknown, expired, belongs to another item, reads a different file than file names, or its file changed. `range_unavailable`: The download ignored or returned an invalid conditional byte range. `ambiguous_pagination`: Both a nonblank continuation and char_offset were supplied. `item_not_found`: The identifier does not exist in the Internet Archive. `invalid_identifier`: identifier holds \"/\" or \":\" but is not an archive.org item URL: a URL on another site, a Wayback Machine capture, or an archive.org page that names no item. `invalid_file`: file, or the file a download, stream, or storage-node URL names, is not in the item manifest or is not readable text. `no_text_file`: The item exists but lists no readable text file: no DjVuTXT, Text, or Plain Text file, and no .txt file other than Metadata sidecars. `download_forbidden`: Access to this item is restricted — it is in a login-required or limited collection. `archive_unavailable`: The Internet Archive Metadata API or the text file download did not answer within the request timeout or the call's 55 s deadline (the request timeout when that is longer), could not be reached, answered HTTP 5xx after retries, 429, or another 4xx, or the metadata response was unreadable. Other values are possible when a failure originates below the handler."
  3. Changed5 schema fields changed
    • addedInput schema / properties / file
      Added value: +{
      +  "description": "The text file to read, named exactly as ia_get_item lists it, e.g. \"Strabo 02 Geography 3-5_djvu.txt\". It must be readable text: format DjVuTXT, Text, or Plain Text, or a .txt name whose format is not Metadata. Omit to read the default: the first DjVuTXT file, else Text, else Plain Text, else another .txt file. With continuation, omit it or name the file the continuation reads; blank is omitted.",
      +  "type": "string"
      +}
    • changedInput schema / properties / identifier / description
      Previous value: -"Internet Archive item identifier, e.g. \"prideprejudice00aust\" (Pride and Prejudice). Obtain from ia_search_items results."New value: +"Internet Archive item identifier, e.g. \"prideprejudice00aust\" (Pride and Prejudice), from ia_search_items results; or an archive.org item URL, such as https://archive.org/details/prideprejudice00aust or its download, stream, metadata, or embed form, read as the identifier it names. A download, stream, or storage-node URL naming a file reads that file when file is omitted."
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `invalid_continuation`: A continuation is unknown, expired, belongs to another item, or its file changed. `range_unavailable`: The download ignored or returned an invalid conditional byte range. `ambiguous_pagination`: Both a nonblank continuation and char_offset were supplied. `item_not_found`: The identifier does not exist in the Internet Archive. `no_text_file`: The item exists but contains no readable text file (DjVuTXT or plain-text). `download_forbidden`: Access to this item is restricted — it is in a login-required or limited collection. `archive_unavailable`: The Internet Archive Metadata API or the text file download did not answer within the request timeout, could not be reached, answered HTTP 5xx after retries, 429, or another 4xx, or the metadata response was unreadable. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `invalid_continuation`: A continuation is unknown, expired, belongs to another item, reads a different file than file names, or its file changed. `range_unavailable`: The download ignored or returned an invalid conditional byte range. `ambiguous_pagination`: Both a nonblank continuation and char_offset were supplied. `item_not_found`: The identifier does not exist in the Internet Archive. `invalid_identifier`: identifier holds \"/\" or \":\" but is not an archive.org item URL: a URL on another site, a Wayback Machine capture, or an archive.org page that names no item. `invalid_file`: file, or the file a download, stream, or storage-node URL names, is not in the item manifest or is not readable text. `no_text_file`: The item exists but lists no readable text file: no DjVuTXT, Text, or Plain Text file, and no .txt file other than Metadata sidecars. `download_forbidden`: Access to this item is restricted — it is in a login-required or limited collection. `archive_unavailable`: The Internet Archive Metadata API or the text file download did not answer within the request timeout, could not be reached, answered HTTP 5xx after retries, 429, or another 4xx, or the metadata response was unreadable. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "invalid_continuation",
      -  "range_unavailable",
      -  "ambiguous_pagination",
      -  "item_not_found",
      -  "no_text_file",
      -  "download_forbidden",
      -  "archive_unavailable"
      -]New value: +[
      +  "invalid_continuation",
      +  "range_unavailable",
      +  "ambiguous_pagination",
      +  "item_not_found",
      +  "invalid_identifier",
      +  "invalid_file",
      +  "no_text_file",
      +  "download_forbidden",
      +  "archive_unavailable"
      +]
    • changedOutput schema / properties / notice / description
      Previous value: -"Explains a max_chars clamp or why efficient continuation is unavailable, with the next char_offset or end-of-document status."New value: +"Explains a max_chars clamp or why efficient continuation is unavailable, with the next char_offset or end-of-document status, or — when file was omitted — how many readable text files the item holds and how to list them."
  4. Changed8 schema fields changed
    • removedInput schema / properties / char_offset / default
      Removed value: -0
    • changedInput schema / properties / char_offset / description
      Previous value: -"Character offset to start reading from (default 0). To read the next page, add max_chars to the previous char_offset."New value: +"Character offset to start reading from (default 0). For sequential pages use next_continuation as continuation instead. Omit char_offset when using continuation."
    • addedInput schema / properties / continuation
      Added value: +{
      +  "description": "Opaque next_continuation from the previous page. Omit char_offset when using it; blank is omitted.",
      +  "type": "string"
      +}
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `item_not_found`: The identifier does not exist in the Internet Archive. `no_text_file`: The item exists but contains no readable text file (DjVuTXT or plain-text). `download_forbidden`: Access to this item is restricted — it is in a login-required or limited collection. `archive_unavailable`: The Internet Archive Metadata API or the text file download did not answer within the request timeout, could not be reached, answered HTTP 5xx after retries, 429, or another 4xx, or the metadata response was unreadable. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `invalid_continuation`: A continuation is unknown, expired, belongs to another item, or its file changed. `range_unavailable`: The download ignored or returned an invalid conditional byte range. `ambiguous_pagination`: Both a nonblank continuation and char_offset were supplied. `item_not_found`: The identifier does not exist in the Internet Archive. `no_text_file`: The item exists but contains no readable text file (DjVuTXT or plain-text). `download_forbidden`: Access to this item is restricted — it is in a login-required or limited collection. `archive_unavailable`: The Internet Archive Metadata API or the text file download did not answer within the request timeout, could not be reached, answered HTTP 5xx after retries, 429, or another 4xx, or the metadata response was unreadable. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "item_not_found",
      -  "no_text_file",
      -  "download_forbidden",
      -  "archive_unavailable"
      -]New value: +[
      +  "invalid_continuation",
      +  "range_unavailable",
      +  "ambiguous_pagination",
      +  "item_not_found",
      +  "no_text_file",
      +  "download_forbidden",
      +  "archive_unavailable"
      +]
    • changedOutput schema / properties / has_more / description
      Previous value: -"True when there is more text beyond this slice. Increment char_offset by max_chars to read the next page."New value: +"True when there is more text beyond this slice. Use next_continuation, or add max_chars to char_offset if no token is available."
    • addedOutput schema / properties / next_continuation
      Added value: +{
      +  "description": "Opaque next-page token; use as continuation with the same identifier and omit char_offset. Expires after one hour.",
      +  "type": "string"
      +}
    • changedOutput schema / properties / notice / description
      Previous value: -"Set when max_chars exceeded the server maximum (IA_MAX_SNAPSHOT_CHARS) and was served at it, naming the char_offset of the next page, or saying the page reaches the end of the document."New value: +"Explains a max_chars clamp or why efficient continuation is unavailable, with the next char_offset or end-of-document status."
  5. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, openWorld, so the safety profile is covered; the description adds real behavior beyond that: one file per call, the default file-selection order, that a notice reports the count when an item holds several files, and that an oversized max_chars is served at the server maximum with a notice. It also discloses find's matching rules (case-insensitive letters, whitespace-run equivalence, OCR misreads and hyphenation breaking phrases), which is valuable operational context. Minor gap: it does not say what happens when no readable text file exists.

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 purpose, then paging, then find, then the sibling pointer, so the structure follows likely agent need. It is dense and a few clauses duplicate schema text (the default DjVuTXT/Text/Plain Text order appears twice), costing some tightness.

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?

An output schema exists, so return values need not be explained, yet the description still names the key output fields (next_continuation, match_offset) and how to feed them back. For a six-parameter paging tool with a non-obvious continuation protocol, nothing an agent needs to call it correctly 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 the baseline is 3, but the description adds workflow meaning the schema does not: how max_chars, next_continuation, continuation, and char_offset compose into paging, and how find interacts with char_offset and the continuation position. Some of it (the default file order) merely restates the file parameter's schema description, which keeps it from a 5.

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 ("Retrieve readable OCR DjVuTXT or plain text from an Internet Archive item") and scopes the content types it covers. It also distinguishes itself from the sibling ia_get_item by assigning file listing to that tool, so an agent can route correctly without opening either 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?

Gives explicit when-to-use guidance for each mode: max_chars plus next_continuation for paging, char_offset for direct access, find for jumping to a passage, and ia_get_item with format "DjVuTXT" to enumerate files. It also states the constraint that char_offset must be omitted when using continuation, which is exactly the kind of exclusion an agent needs.

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.