Search Inside Books
openlibrary_search_insideSearch the full text of books scanned by the Internet Archive — the "which book contains this passage?" lookup that the metadata tools cannot answer. Quote a phrase for an exact-phrase match; bare terms match anywhere in the text. Each result is an Internet Archive item with the matching passages as snippets, plus a relevance score. The full-text index is far slower than the metadata endpoints, and a search usually takes 10–30 seconds. Use it when the passage is the question, and use openlibrary_search_books to search by title, author, or subject. Results key on Internet Archive items rather than Open Library works. To reach the catalogue record, pass an ia_identifier to openlibrary_search_books as query "ia:<ia_identifier>", which returns its work and, in matching_edition, the edition holding that scan; when that matches nothing (a scan no edition records), search openlibrary_search_books by the item's title and creator and compare the ia_identifiers on its results. Each ia_identifier also reads at archive.org.
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": {
"query": "<query>"
},
"name": "openlibrary_search_inside"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Max matching items to return; values above 100 apply 100 when limit clamping is enabled. Each carries its own snippets, so higher values grow the response quickly — prefer 10–20. | |
| query | Yes | Text to find inside scanned books. Wrap in double quotes for an exact-phrase match (e.g., "the spice must flow"); unquoted terms match independently and return far broader results. | |
| offset | No | Zero-based offset for pagination, below 10000: the full-text index serves only its first 10,000 results, so a page that would run past them is shortened to end there. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Present when the call failed. Absent on success. | |
| total | No | Total matching Internet Archive items across all pages. | |
| notice | No | Guidance for an empty page, a requested limit above the page ceiling, or a page shortened to end at the 10,000-result window. Absent when none applies. | |
| offset | No | Zero-based offset of the first returned match. | |
| matches | No | Matching items, up to limit, ordered by relevance. | |
| totalCount | No | Total matching items across all pages — the upstream match count, reported even when this page is empty because offset ran past the end. |