Skip to main content
Glama

libofcongress-mcp-server

Get Newspaper Page

libofcongress_get_newspaper_page
Read-only

Retrieve the full text of one LOC page — a historical newspaper page, or a book or manuscript page — or, with match, only the passages around your search terms, with its publication metadata: for newspapers the title, issue date, place of publication, indexed states, and edition; for every page its sequence, the page count, and the item_title and item_id of the issue, book, or manuscript it belongs to — pass item_id to libofcongress_get_item to list every page of the item. Pass the url field from a libofcongress_search_newspapers result, or a pages[].page_url from libofcongress_get_item (has_text true), or a Chronicling America page link (…/ed-N/seq-M/) — do not construct this URL manually. A dense newspaper page runs to 50,000 characters: to find the article a search hit on, pass the search query as match and read the passages around it rather than the whole page. The text is OCR, or for some manuscripts a volunteer transcription; OCR quality varies by digitization batch and era, and 19th-century and degraded materials may contain fragmented text, garbled words, and line-break artifacts that are surfaced as-is. When a page exists but has no digitized text, ocr_available is false and ocr_text is empty — this is a data property, not an error.

Input Schema

NameRequiredDescriptionDefault
matchNoReturn the passages around these terms instead of the whole page — pass the query you gave libofcongress_search_newspapers (e.g., titanic, or "the titanic" iceberg); the q= in a search result url is not read as match. Words separated by spaces are separate terms, any of which matches; a double-quoted span is one phrase. Each matches case-insensitively as literal text, with line breaks read as spaces; OCR misreads are not repaired. When set, ocr_text is empty, matches holds up to 10 passages of about 300 characters either side of each occurrence — when they need more, occurrences of the rarest terms come first, so a common word only fills the slots left — and match_count counts every occurrence. Omit match for the whole page. Up to 200 characters; blank is ignored.
page_urlYesA LOC page URL: the url field from a libofcongress_search_newspapers result (e.g., "https://www.loc.gov/resource/sn83045462/1905-03-15/ed-1/?sp=1"), or a pages[].page_url from libofcongress_get_item for a newspaper, book, or manuscript page (e.g., "https://www.loc.gov/resource/mss93930.mss93930-001/?sp=3"). Also accepted: the same /resource/ URL over http or without "www.", a newspaper page path ending /ed-N/seq-M/, and a Chronicling America page link (`chroniclingamerica.loc.gov/lccn/<lccn>/<date>/ed-N/seq-M/`); each is read as its https://www.loc.gov/resource/…/?sp=M page. Pass the value as returned — do not construct page URLs.

Output Schema

NameRequiredDescriptionDefault
dateNoIssue publication date (YYYY-MM-DD).
errorNoPresent when the call failed. Absent on success.
noticeNoSet when ocr_available is true but the page's text came back empty, saying why: the text service did not answer this call (retry), its answer could not be read as text (retrying will not help), or the page's text is empty — a blank page, including one LOC sends as the placeholder [NO TEXT AVAILABLE FOR THIS PAGE]. Distinguishes these from a genuinely image-only page (where ocr_available is false), which carries no notice. With match set on a page that has text, set instead when nothing matched or when some occurrences fall outside the passages returned — those are read on the whole page, by calling again without match. Absent otherwise.
statesNoEvery US state LOC indexes this newspaper title under (e.g., ["georgia", "south carolina"]), in LOC order — possibly more than the state of publication. Absent when LOC lists no state.
editionNoEdition number of the issue (e.g., "1"). Absent when LOC gives none.
item_idNoID of the item this page belongs to: the newspaper issue (e.g., "sn83030214/1912-04-16/ed-1"), book, or manuscript volume (e.g., "mm77093930"). Pass it to libofcongress_get_item to list every page of the item, each with its page_url and has_text — for an article continued on a later page, or the next page of a book. Absent when LOC names no item.
matchesNoPresent only when match is set: passages of the page text around the occurrences of the match terms, in page order — about 300 characters either side of each occurrence, overlapping passages merged up to 1,200 characters, never overlapping, at most 10, chosen around the rarest terms first when more would be needed. Empty when nothing matched or the page has no text.
ocr_textNoFull plain text of this page: OCR, or for some manuscripts a volunteer transcription. Empty string when match is set (read matches instead), when ocr_available is false, or when the page is blank or its text could not be retrieved (see notice). May contain fragmented words, line-break artifacts, and misspellings inherent to historical OCR — do not attempt to repair.
page_urlNoThe LOC resource URL for this page, in the https://www.loc.gov/resource/…?sp=N form the input was read as.
sequenceNoPage sequence number within the issue, volume, or folder.
item_titleNoTitle of the item this page belongs to, on every page type: the book or manuscript title, or for a newspaper page the issue title with place and date (e.g., "New-York tribune (New York [N.Y.]), April 16, 1912"). Absent when LOC gives none.
match_countNoPresent only when match is set: occurrences of every match term on the page, including those beyond the passages returned. 0 when nothing matched or the page has no text.
ocr_availableNoTrue when LOC lists OCR or transcribed text for this page, even if the text it returns is empty (see notice). False for image-only pages where no text has been produced.
segment_countNoNumber of pages in the issue, volume, or folder. Absent when LOC gives none.
newspaper_titleNoTitle of the newspaper publication. Absent when LOC gives none.
place_of_publicationNoWhere the newspaper was published, as LOC catalogs it (e.g., "Charleston, S.C."). Absent when LOC gives none.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed8 schema fields changed
    • addedInput schema / properties / match
      Added value: +{
      +  "description": "Return the passages around these terms instead of the whole page — pass the query you gave libofcongress_search_newspapers (e.g., titanic, or \"the titanic\" iceberg); the q= in a search result url is not read as match. Words separated by spaces are separate terms, any of which matches; a double-quoted span is one phrase. Each matches case-insensitively as literal text, with line breaks read as spaces; OCR misreads are not repaired. When set, ocr_text is empty, matches holds up to 10 passages of about 300 characters either side of each occurrence — when they need more, occurrences of the rarest terms come first, so a common word only fills the slots left — and match_count counts every occurrence. Omit match for the whole page. Up to 200 characters; blank is ignored.",
      +  "maxLength": 200,
      +  "type": "string"
      +}
    • addedOutput schema / properties / item_id
      Added value: +{
      +  "description": "ID of the item this page belongs to: the newspaper issue (e.g., \"sn83030214/1912-04-16/ed-1\"), book, or manuscript volume (e.g., \"mm77093930\"). Pass it to libofcongress_get_item to list every page of the item, each with its page_url and has_text — for an article continued on a later page, or the next page of a book. Absent when LOC names no item.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / item_title
      Added value: +{
      +  "description": "Title of the item this page belongs to, on every page type: the book or manuscript title, or for a newspaper page the issue title with place and date (e.g., \"New-York tribune (New York [N.Y.]), April 16, 1912\"). Absent when LOC gives none.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / match_count
      Added value: +{
      +  "description": "Present only when match is set: occurrences of every match term on the page, including those beyond the passages returned. 0 when nothing matched or the page has no text.",
      +  "maximum": 9007199254740991,
      +  "minimum": -9007199254740991,
      +  "type": "integer"
      +}
    • addedOutput schema / properties / matches
      Added value: +{
      +  "description": "Present only when match is set: passages of the page text around the occurrences of the match terms, in page order — about 300 characters either side of each occurrence, overlapping passages merged up to 1,200 characters, never overlapping, at most 10, chosen around the rarest terms first when more would be needed. Empty when nothing matched or the page has no text.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
    • changedOutput schema / properties / notice / description
      Previous value: -"Set when ocr_available is true but ocr_text is empty, saying why: the text service did not answer this call (retry), its answer could not be read as text (retrying will not help), or the page's text is empty. Distinguishes these from a genuinely image-only page (where ocr_available is false). Absent when text was returned or the page has none."New value: +"Set when ocr_available is true but the page's text came back empty, saying why: the text service did not answer this call (retry), its answer could not be read as text (retrying will not help), or the page's text is empty — a blank page, including one LOC sends as the placeholder [NO TEXT AVAILABLE FOR THIS PAGE]. Distinguishes these from a genuinely image-only page (where ocr_available is false), which carries no notice. With match set on a page that has text, set instead when nothing matched or when some occurrences fall outside the passages returned — those are read on the whole page, by calling again without match. Absent otherwise."
    • changedOutput schema / properties / ocr_available / description
      Previous value: -"True when LOC holds OCR or transcribed text for this page. False for image-only pages where no text has been produced."New value: +"True when LOC lists OCR or transcribed text for this page, even if the text it returns is empty (see notice). False for image-only pages where no text has been produced."
    • changedOutput schema / properties / ocr_text / description
      Previous value: -"Full plain text of this page: OCR, or for some manuscripts a volunteer transcription. Empty string when ocr_available is false, or when the text could not be retrieved (see notice). May contain fragmented words, line-break artifacts, and misspellings inherent to historical OCR — do not attempt to repair."New value: +"Full plain text of this page: OCR, or for some manuscripts a volunteer transcription. Empty string when match is set (read matches instead), when ocr_available is false, or when the page is blank or its text could not be retrieved (see notice). May contain fragmented words, line-break artifacts, and misspellings inherent to historical OCR — do not attempt to repair."
  2. Changed9 schema fields changed
    • changedInput schema / properties / page_url / description
      Previous value: -"The url field from a libofcongress_search_newspapers result (e.g., \"https://www.loc.gov/resource/sn83045462/1905-03-15/ed-1/seq-1/\"). Always pass the value directly from search results — do not construct or modify this URL."New value: +"A LOC page URL: the url field from a libofcongress_search_newspapers result (e.g., \"https://www.loc.gov/resource/sn83045462/1905-03-15/ed-1/?sp=1\"), or a pages[].page_url from libofcongress_get_item for a newspaper, book, or manuscript page (e.g., \"https://www.loc.gov/resource/mss93930.mss93930-001/?sp=3\"). Also accepted: the same /resource/ URL over http or without \"www.\", a newspaper page path ending /ed-N/seq-M/, and a Chronicling America page link (`chroniclingamerica.loc.gov/lccn/<lccn>/<date>/ed-N/seq-M/`); each is read as its https://www.loc.gov/resource/…/?sp=M page. Pass the value as returned — do not construct page URLs."
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `invalid_page_url`: page_url does not begin with https://www.loc.gov/resource/. `page_not_found`: The URL does not resolve to a valid LOC newspaper page resource. `rate_limit_exceeded`: LOC API rate limit exceeded; requests are blocked for approximately 1 hour. `server_busy`: More Library of Congress requests are queued on this server than can start within this call's time budget. `request_timed_out`: The Library of Congress did not respond within the 50-second request budget. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `invalid_page_url`: page_url is not one LOC page: neither a loc.gov /resource/ URL nor a Chronicling America page link ending /ed-N/seq-M/. `page_not_found`: The URL does not resolve to a LOC page resource. `rate_limit_exceeded`: LOC API rate limit exceeded; requests are blocked for approximately 1 hour. `server_busy`: More Library of Congress requests are queued on this server than can start within this call's time budget. `request_timed_out`: The Library of Congress did not respond within the 50-second request budget. `upstream_unavailable`: The Library of Congress could not be reached, or answered with an error status, a bot challenge or other HTML page, or an unreadable response instead of its JSON. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "invalid_page_url",
      -  "page_not_found",
      -  "rate_limit_exceeded",
      -  "server_busy",
      -  "request_timed_out"
      -]New value: +[
      +  "invalid_page_url",
      +  "page_not_found",
      +  "rate_limit_exceeded",
      +  "server_busy",
      +  "request_timed_out",
      +  "upstream_unavailable"
      +]
    • changedOutput schema / properties / notice / description
      Previous value: -"Set when ocr_available is true but ocr_text is empty — the page has digitized OCR, but the text service did not return it this call. Distinguishes a transient retrieval miss from a genuinely image-only page (where ocr_available is false). Absent when OCR text was returned or the page has no OCR."New value: +"Set when ocr_available is true but ocr_text is empty, saying why: the text service did not answer this call (retry), its answer could not be read as text (retrying will not help), or the page's text is empty. Distinguishes these from a genuinely image-only page (where ocr_available is false). Absent when text was returned or the page has none."
    • changedOutput schema / properties / ocr_available / description
      Previous value: -"True when digitized OCR text exists for this page. False for image-only digitization batches where OCR has not been applied."New value: +"True when LOC holds OCR or transcribed text for this page. False for image-only pages where no text has been produced."
    • changedOutput schema / properties / ocr_text / description
      Previous value: -"Full plain-text OCR content for the page. Empty string when ocr_available is false. May contain fragmented words, line-break artifacts, and misspellings inherent to historical OCR — do not attempt to repair."New value: +"Full plain text of this page: OCR, or for some manuscripts a volunteer transcription. Empty string when ocr_available is false, or when the text could not be retrieved (see notice). May contain fragmented words, line-break artifacts, and misspellings inherent to historical OCR — do not attempt to repair."
    • changedOutput schema / properties / page_url / description
      Previous value: -"The LOC resource URL for this newspaper page."New value: +"The LOC resource URL for this page, in the https://www.loc.gov/resource/…?sp=N form the input was read as."
    • changedOutput schema / properties / segment_count / description
      Previous value: -"Number of pages in the issue. Absent when LOC gives none."New value: +"Number of pages in the issue, volume, or folder. Absent when LOC gives none."
    • changedOutput schema / properties / sequence / description
      Previous value: -"Page sequence number within the issue."New value: +"Page sequence number within the issue, volume, or folder."
  3. Changed2 schema fields changed
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `invalid_page_url`: page_url does not begin with https://www.loc.gov/resource/. `page_not_found`: The URL does not resolve to a valid LOC newspaper page resource. `rate_limit_exceeded`: LOC API rate limit exceeded; requests are blocked for approximately 1 hour. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `invalid_page_url`: page_url does not begin with https://www.loc.gov/resource/. `page_not_found`: The URL does not resolve to a valid LOC newspaper page resource. `rate_limit_exceeded`: LOC API rate limit exceeded; requests are blocked for approximately 1 hour. `server_busy`: More Library of Congress requests are queued on this server than can start within this call's time budget. `request_timed_out`: The Library of Congress did not respond within the 50-second request budget. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "invalid_page_url",
      -  "page_not_found",
      -  "rate_limit_exceeded"
      -]New value: +[
      +  "invalid_page_url",
      +  "page_not_found",
      +  "rate_limit_exceeded",
      +  "server_busy",
      +  "request_timed_out"
      +]
  4. Changed9 schema fields changed
    • changedOutput schema / properties / date / description
      Previous value: -"Issue publication date."New value: +"Issue publication date (YYYY-MM-DD)."
    • changedOutput schema / properties / edition / description
      Previous value: -"Edition or publication context identifier."New value: +"Edition number of the issue (e.g., \"1\"). Absent when LOC gives none."
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `page_not_found`: The URL does not resolve to a valid LOC newspaper page resource. `rate_limit_exceeded`: LOC API rate limit exceeded; requests are blocked for approximately 1 hour. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `invalid_page_url`: page_url does not begin with https://www.loc.gov/resource/. `page_not_found`: The URL does not resolve to a valid LOC newspaper page resource. `rate_limit_exceeded`: LOC API rate limit exceeded; requests are blocked for approximately 1 hour. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "page_not_found",
      -  "rate_limit_exceeded"
      -]New value: +[
      +  "invalid_page_url",
      +  "page_not_found",
      +  "rate_limit_exceeded"
      +]
    • changedOutput schema / properties / newspaper_title / description
      Previous value: -"Title of the newspaper publication."New value: +"Title of the newspaper publication. Absent when LOC gives none."
    • addedOutput schema / properties / place_of_publication
      Added value: +{
      +  "description": "Where the newspaper was published, as LOC catalogs it (e.g., \"Charleston, S.C.\"). Absent when LOC gives none.",
      +  "type": "string"
      +}
    • addedOutput schema / properties / segment_count
      Added value: +{
      +  "description": "Number of pages in the issue. Absent when LOC gives none.",
      +  "type": "number"
      +}
    • removedOutput schema / properties / state
      Removed value: -{
      -  "description": "State where the newspaper was published.",
      -  "type": "string"
      -}
    • addedOutput schema / properties / states
      Added value: +{
      +  "description": "Every US state LOC indexes this newspaper title under (e.g., [\"georgia\", \"south carolina\"]), in LOC order — possibly more than the state of publication. Absent when LOC lists no state.",
      +  "items": {
      +    "type": "string"
      +  },
      +  "type": "array"
      +}
  5. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnlyHint/openWorldHint annotations, the description discloses the 50,000-character page size and the match workaround, that text is OCR or volunteer transcription with batch-/era-dependent quality artifacts, and crucially that ocr_available=false with empty ocr_text is a data property rather than an error. These are exactly the failure modes an agent would otherwise misread.

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?

Purpose is front-loaded and nearly every clause carries information (metadata fields, URL sources, OCR caveats), so little is filler. It is, however, a single very dense em-dash chain that is harder to parse than a two- or three-sentence split would be, and the 'do not construct this URL manually' point is stated twice.

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?

Despite an output schema existing (so return values need not be explained), the description still maps the metadata an agent will get and covers the edge cases that matter: empty-but-valid pages, OCR degradation, and match truncation to ~300-char passages with match_count. Nothing needed 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.

Parameters3/5

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

Schema description coverage is 100% and both parameters already carry rich inline docs, including the page_url source forms and the match passage mechanics. The description's parameter guidance largely restates the schema (URL sourcing, don't construct manually), adding little that isn't already structured. Baseline 3 applies when the schema does the heavy lifting.

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 (retrieve) and resource (one LOC page), and immediately delimits variants: a newspaper/page vs. book/manuscript page, and full text vs. match passages. It also names the sibling tools it works alongside (libofcongress_search_newspapers, libofcongress_get_item), so an agent can place it precisely in the family.

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 routing is given: pass page_url from a search_newspapers result or a pages[].page_url from get_item, use match for pinpointing an article on a dense page, and omit it for the whole page. It also states the negative case ('do not construct this URL manually') and points to libofcongress_get_item for listing an item's pages.

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.