source-library

v4.3.0
io.github.Embassy-of-the-Free-Mind/source-library Checked 5 days ago Published 6 months ago

Search 22,000+ rare pre-modern texts with AI English translations, summaries, and 73K+ images.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

search_library

Full-text search across Source Library's 22,000+ rare historical books. Searches titles, authors, translations, and OCR text. Returns matching books and page snippets with citation URLs. ORIENTATION HINT: when the user has named a specific author or work, call get_book directly (or list_books to find the ID first) — the AI-generated book summary is usually the right first answer and saves repeated passage hunting.

ParameterTypeDescription
query *stringSearch query (searches titles, authors, translations, OCR text)
has_doibooleanOnly return books with DOIs
has_translationbooleanOnly return books with translations
languagestringFilter by original language (e.g., 'Latin', 'German', 'Greek', 'Sanskrit')
limitnumberMaximum results (default 10, max 100)
offsetnumberPagination offset (default 0)
sortstringSort order (default: relevance)
year_fromnumberFilter by publication year (start, inclusive)
year_tonumberFilter by publication year (end, inclusive)

list_books

Browse the catalog by metadata — filter by author/title fragment, language, category, or translation recency. Returns books with title, author, language, year, page counts, and translation progress. Use this to discover WHAT EXISTS by an author or in a tradition before searching content; for content matches (passages on a topic) use search_translations or search_concept.

ParameterTypeDescription
categorystringFilter by category
languagestringFilter by language (e.g., 'Latin', 'German', 'Greek')
limitnumberMaximum results (default 100, max 200)
searchstringFilter by title or author (diacritic-insensitive, e.g., 'bohme' matches 'Böhme')
skipnumberPagination offset (default 0)
sortstringSort order (default: recent-translation)

search_translations

Search inside translated page text across the entire library. THE tool for sweeping across many books for evidence on a theme. Unlike search_library (which matches titles/authors), this searches inside the actual text. Returns passage snippets with page numbers, book info, and citation URLs. ORIENTATION HINT: if the user has named a specific author or work, prefer get_book first — every book has an AI-generated summary + chapter outline that is usually the right first read. Use search_translations when looking for evidence across multiple books. (Also available as 'search_passages'.)

ParameterTypeDescription
query *stringSearch query — searches inside page translations and OCR text (e.g., 'divine providence', 'philosopher stone', 'harmony of the spheres')
book_idstringSearch within a specific book only
languagestringFilter by book's original language (e.g., 'Latin', 'German', 'Greek')
limitnumberMaximum results (default 20, max 50)
year_fromnumberFilter by publication year (start, inclusive)
year_tonumberFilter by publication year (end, inclusive)

search_concept

Conceptual / semantic passage search across the whole library. Use when the modern term won't literally appear in historical texts — e.g. "distributed cognition" maps to passages about active intellect, art of memory, wax tablet metaphors; "social contract" maps to pre-Hobbesian discussions of consent and authority. Ranks passages by cosine similarity on Gemini embeddings, so paraphrases and conceptually adjacent phrasings match even when no keyword overlaps. ORIENTATION HINT: if the user named a specific author or work, prefer get_book first — semantic search is expensive and best reserve…

ParameterTypeDescription
query *stringA concept or natural-language description — full sentences are fine. Unlike search_translations, this does NOT require words that appear in the corpus.
languagestringFilter by original language (e.g., Latin, German, Greek, Arabic, Chinese, Sanskrit, Hebrew, Persian, Tibetan). Use this filter when you want passages from a specific tradition — unfiltered English q…
limitnumberMax passages (default 15, max 50)
year_fromnumberFilter by publication year (start, inclusive)
year_tonumberFilter by publication year (end, inclusive)

search_within_book

Search inside a specific book's pages (OCR and translations). Returns matching pages with snippets and citation URLs. Use after finding a book to locate specific passages.

ParameterTypeDescription
book_id *stringThe book ID to search within
query *stringSearch query — finds matches in both original text (OCR) and English translations

get_book

Get a book's AI-generated summary, chapter list, index stats, edition metadata, DOI, page counts, and processing status. THIS IS THE RIGHT FIRST CALL whenever the user has named a specific author or work — the summary is typically a multi-paragraph orientation covering the book's argument, structure, and significance, often answering the question without any further searching. Pair with get_book_text to read selected chapters, or search_within_book to locate passages inside it.

ParameterTypeDescription
book_id *stringThe book ID

get_book_text

READ A BOOK — start here. Preferred: use 'chapter' param to read one chapter at a time (includes page markers like [Page 42] for citation). Or use page ranges (from/to) for focused reading. Call get_book first to see the chapter list. 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; always check truncated first. Budget limits apply to ano…

ParameterTypeDescription
book_id *stringThe book ID
chapternumberChapter index (0-based). Returns chapter text with embedded [Page N] markers for citation. Preferred over from/to. If the chapter has multiple parts, returns part 1 — check parts_total in response.
contentstringWhich text to return: 'ocr' (original), 'translation' (English), or 'both' (default)
formatstringResponse format: 'json' (structured, default) or 'plain' (concatenated text with page markers)
fromnumberStart page number (inclusive). Use with to for explicit page ranges. If the response has truncated=true, use the next from/to from truncation_note.
include_metadatabooleanInclude page-level metadata (model, language, page_type, columns)
partnumberPart number (1-based) for large chapters split into multiple parts.
tonumberEnd page number (inclusive). Recommended chunk size: 50 pages. If the response has truncated=true, use the next from/to from truncation_note.

get_quote

Get the exact translated text of a single page for quoting. Returns the full translation, original OCR text, and a formatted citation. ALWAYS use this tool before putting text in quotation marks — copy the exact text from the response. Do not paraphrase or reconstruct from memory.

ParameterTypeDescription
book_id *stringThe book ID or slug
page *numberPage number to quote from

search_images

Search the visual collection: 50,000+ illustrations extracted from book pages PLUS 23,000+ standalone artworks (paintings, frescoes, prints, sculptures from Met, Rijksmuseum, Wikimedia, NGA). Filter by type, subject, figure, symbol, year, book, or text query. Each result has a `source` field — `gallery` (illustration in a book) or `artwork` (standalone museum work). Use `type=painting` or `type=fresco` to find standalone works; `type=woodcut`, `type=engraving`, `type=emblem` etc. surface mostly book illustrations. The `source` parameter narrows the search: 'all' (default), 'gallery' (illustr…

ParameterTypeDescription
book_idstringOnly return images from a specific book or artwork id
figurestringFigure depicted (e.g., 'Mercury', 'philosopher', 'king')
limitnumberMaximum results to return (default 20, max 50)
min_qualitynumberMinimum gallery quality score 0-1 (default 0.5). Applies to gallery illustrations only.
querystringText search across descriptions, subjects, figures, titles, and artists (e.g., 'ouroboros', 'Raphael fresco', 'Botticelli')
sourcestringWhich collection to search. 'all' (default) returns both illustrations and standalone artworks, interleaved. 'gallery' = book illustrations only. 'artworks' = standalone paintings/prints/sculptures on…
subjectstringSubject filter (e.g., 'alchemy', 'astronomy', 'anatomy')
symbolstringSymbol depicted (e.g., 'ouroboros', 'caduceus', 'sun')
typestringImage type. For book illustrations: woodcut, engraving, emblem, diagram, frontispiece, portrait, illustration, map, chart, decorative, musical_score, symbol. For standalone artworks: painting, drawing…
year_fromnumberFilter by publication year (start)
year_tonumberFilter by publication year (end)

check_duplicate

Check if a book already exists in Source Library before importing. Uses 4-tier matching: source fingerprint, title+author normalization, keyword search, and semantic similarity. Returns confidence level, matches with URLs, and a suggestion (safe to import / review matches / likely duplicate). Use this BEFORE every import to avoid duplicates.

ParameterTypeDescription
title *stringBook title (original language or English)
authorstringAuthor name (any format: 'First Last', 'Last, First', etc.)
ia_idstringInternet Archive identifier (optional, for exact fingerprint match)
languagestringLanguage hint for semantic search (optional)
manifeststringIIIF manifest URL (optional, for exact fingerprint match)
yearstringPublication year (optional, for context)

submit_feedback

Submit feedback, bug reports, feature requests, or comments to the Source Library team. Messages go directly to the maintainers.

ParameterTypeDescription
message *stringYour feedback, bug report, or feature request (2-5000 characters)
emailstringYour email for follow-up (optional)
namestringYour name (optional)
pagestringRelated page URL or path (optional, e.g., 'https://sourcelibrary.org/book/...')