Skip to main content
Glama

Search Inside Books

openlibrary_search_inside
Read-only

Search 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

NameRequiredDescriptionDefault
limitNoMax 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.
queryYesText 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.
offsetNoZero-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

NameRequiredDescriptionDefault
errorNoPresent when the call failed. Absent on success.
totalNoTotal matching Internet Archive items across all pages.
noticeNoGuidance 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.
offsetNoZero-based offset of the first returned match.
matchesNoMatching items, up to limit, ordered by relevance.
totalCountNoTotal matching items across all pages — the upstream match count, reported even when this page is empty because offset ran past the end.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changed
    • changedInput schema / properties / limit / description
      Previous value: -"Max matching items to return. Each carries its own snippets, so higher values grow the response quickly — prefer 10–20."New value: +"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."
    • changedInput schema / properties / offset / description
      Previous value: -"Zero-based offset for pagination."New value: +"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."
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode. Declared by this tool: `upstream_unavailable`: Open Library's full-text search answered HTTP 200 without a result set — no hits object carrying a total. Other values are possible when a failure originates below the handler."New value: +"Machine-readable failure mode. Declared by this tool: `no_search_criteria`: The query is whitespace-only, so there is no text to search for. `offset_past_result_window`: offset is 10000 or more, past the first 10,000 results Open Library's full-text index serves. `upstream_unavailable`: Open Library's full-text search answered HTTP 200 without a result set — no hits object carrying a total. Other values are possible when a failure originates below the handler."
    • changedOutput schema / properties / error / properties / data / properties / reason / examples
      Previous value: -[
      -  "upstream_unavailable"
      -]New value: +[
      +  "no_search_criteria",
      +  "offset_past_result_window",
      +  "upstream_unavailable"
      +]
    • changedOutput schema / properties / notice / description
      Previous value: -"Guidance for an empty page or a requested limit above the page ceiling. Absent when neither applies."New value: +"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."
  2. Changed3 schema fields changed
    • changedInput schema / properties / limit / maximum
      Previous value: -100New value: +9007199254740991
    • changedOutput schema / properties / matches / items / properties / snippets / description
      Previous value: -"Passages containing the match, with the upstream highlight markers removed. The text output caps how many are rendered per item; this array is complete."New value: +"Every passage containing the match, with the upstream highlight markers removed."
    • changedOutput schema / properties / notice / description
      Previous value: -"Guidance when the page is empty (how to broaden a query that matched nothing, or which offset to retry when offset ran past the end) or when the text output capped a per-item snippet list. Absent when neither applies."New value: +"Guidance for an empty page or a requested limit above the page ceiling. Absent when neither applies."
  3. Changed2 schema fields changed
    • changedOutput schema / properties / error / properties / data / properties / reason / description
      Previous value: -"Machine-readable failure mode."New value: +"Machine-readable failure mode. Declared by this tool: `upstream_unavailable`: Open Library's full-text search answered HTTP 200 without a result set — no hits object carrying a total. Other values are possible when a failure originates below the handler."
    • addedOutput schema / properties / error / properties / data / properties / reason / examples
      Added value: +[
      +  "upstream_unavailable"
      +]
  4. Changed6 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedInput schema / additionalProperties
      Added value: +false
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • addedOutput schema / anyOf
      Added value: +[
      +  {
      +    "not": {
      +      "required": [
      +        "error"
      +      ]
      +    },
      +    "required": [
      +      "total",
      +      "offset",
      +      "matches"
      +    ]
      +  },
      +  {
      +    "required": [
      +      "error"
      +    ]
      +  }
      +]
    • addedOutput schema / properties / error
      Added value: +{
      +  "additionalProperties": {},
      +  "description": "Present when the call failed. Absent on success.",
      +  "properties": {
      +    "code": {
      +      "description": "JSON-RPC error code for this failure.",
      +      "maximum": 9007199254740991,
      +      "minimum": -9007199254740991,
      +      "type": "integer"
      +    },
      +    "data": {
      +      "additionalProperties": {},
      +      "properties": {
      +        "reason": {
      +          "description": "Machine-readable failure mode.",
      +          "type": "string"
      +        },
      +        "recovery": {
      +          "additionalProperties": {},
      +          "description": "Actionable next step for the caller.",
      +          "properties": {
      +            "hint": {
      +              "type": "string"
      +            }
      +          },
      +          "required": [
      +            "hint"
      +          ],
      +          "type": "object"
      +        },
      +        "retryable": {
      +          "description": "Whether retrying may succeed.",
      +          "type": "boolean"
      +        }
      +      },
      +      "type": "object"
      +    },
      +    "message": {
      +      "description": "Human-readable description of what went wrong.",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "code",
      +    "message"
      +  ],
      +  "type": "object"
      +}
    • removedOutput schema / required
      Removed value: -[
      -  "total",
      -  "offset",
      -  "matches"
      -]
  5. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only declare readOnly and openWorld, but the description adds the traits that actually matter here: the index is much slower (10–30 s), results are keyed to Internet Archive items rather than Open Library works, and each result carries snippets plus a relevance score. It also warns that higher limits bloat responses and that the index serves only its first 10,000 results.

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, quoting behavior, and latency are front-loaded before the routing guidance, which is the right order. The trailing paragraph about resolving ia_identifiers to works and editions is dense and long, but it earns its space by describing a non-obvious workflow.

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?

With an output schema present, the description need not explain return shapes, and it doesn't. It still covers the pieces an agent would otherwise get wrong: slow latency, the IA-item vs Open Library work identity mismatch, and how to cross-walk identifiers, plus pagination limits.

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 coverage is 100%, so all three parameters are already documented, including quoting behavior and the pagination ceiling. The description restates the quoting convention and hints that limit drives snippet volume, adding little that the schema does not already carry, so the baseline 3 applies.

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 (search the full text of Internet Archive–scanned books) and frames it as the "which book contains this passage?" lookup, explicitly excluding the metadata tools. The agent can distinguish it from openlibrary_search_books on purpose alone.

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 an explicit when-to-use rule ("Use it when the passage is the question") and names the alternative for the other case (openlibrary_search_books for title/author/subject). It goes further with a concrete next-step recipe for turning an ia_identifier into a catalogue record, including the fallback when the ia: lookup returns nothing.

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.