Fetch book metadata from Open Library by title. Use when you need ISBN, author, cover image, subjects, or publication year for a book. Use for looking book entries, looking up ISBNs, or downloading cover art. Use when tool `openlibrary` is explicitly invoked or when you need to fill metadata for a new book entry.
src/i-like/libros/ entry.spa for Spanish editions).Open Library is a free community service. Respect their infrastructure:
fields parameter to request only the fields you need. Always set limit=3 or lower.cover_iUse the fetch_webpage tool to query the Search API. This avoids terminal confirmation prompts.
https://openlibrary.org/search.json?title=TITLE_URL_ENCODED&fields=key,title,author_name,first_publish_year,isbn,cover_i,number_of_pages_median,subject,edition_count&limit=3&lang=estitle author isbn coverReplace TITLE_URL_ENCODED with the URL-encoded book title.
Parse the JSON response. Each doc in docs[] contains:
| Field | Description |
|---|---|
key | Work key, e.g. /works/OL12345W |
title | Canonical title |
author_name | Array of author names |
first_publish_year | Year first published |
isbn | Array of all known ISBNs |
cover_i | Internal cover ID (use for cover URL) |
number_of_pages_median | Median page count across editions |
subject | Array of subjects/tags |
edition_count | Number of editions |
The isbn array contains many ISBNs across editions. Prefer a 13-digit ISBN (starts with 978 or 979).
To verify a candidate ISBN belongs to the desired language/edition, use the fetch_webpage tool:
https://openlibrary.org/isbn/{isbn}.jsonlanguages titleCheck the languages field (array of {"key": "/languages/spa"} objects) and title to confirm it matches. If it does not, try another ISBN-13 from the list. Do not check more than 3 ISBNs — if none match, ask the user to choose.
Use the cover_i value to build a cover URL that avoids the per-ISBN rate limit: