connacto
Back to Books

Books tools

Every tool in this module, with its full description, parameters, and return value. All of them require the module to be active first. See the Books overview for how to turn it on.

CRUD

Core tools

Create, read, update, and delete entries. Every module has exactly these four.

books_add_entry

Add a book to the user's Books module. Requires the module to be active — see create_database.

Parameters

NameTypeRequiredNotes
bookstringYesTitle of the book (author may be included, e.g. 'Dune by Frank Herbert').
statuswant_to_read | reading | readNoReading status: 'want_to_read' (on the list, not started), 'reading' (in progress), or 'read' (finished). Defaults to unset if omitted.
ratingnumberNoRating on a 1-5 scale, typically given once the book is marked 'read'.
notesstringNoFree-form notes about the book, e.g. thoughts, quotes, or reasons for reading it.
catalogIdstringNoId of a book_catalog row from books_confirm_match, to attach structured metadata (author, ISBN, year, page count, cover). Optional: book (free text) is always fully sufficient on its own to log a book, with or without a catalog match.

Returns

The created entry as JSON, including its id.

books_list_entries

List entries in the user's active Books module.

Parameters

NameTypeRequiredNotes
limitnumberNoMax entries to return (default 100, max 500).

Returns

Every entry in the active database, as a JSON array.

books_update_entry

Update fields on an existing Books entry.

Parameters

NameTypeRequiredNotes
entryIdstringYesID of the Books entry to update.
bookstringNoTitle of the book (author may be included, e.g. 'Dune by Frank Herbert').
statuswant_to_read | reading | readNoReading status: 'want_to_read' (on the list, not started), 'reading' (in progress), or 'read' (finished).
ratingnumberNoRating on a 1-5 scale, typically given once the book is marked 'read'.
notesstringNoFree-form notes about the book, e.g. thoughts, quotes, or reasons for reading it.
catalogIdstringNoId of a book_catalog row from books_confirm_match, to attach or replace structured metadata (author, ISBN, year, page count, cover). Optional: book (free text) is always fully sufficient on its own, and omitting this leaves the entry's existing catalog link unchanged.

Returns

The updated or deleted entry as JSON. Returns an error if entryId does not belong to an entry in the active database.

books_delete_entry

Delete an entry from the user's active Books module.

Parameters

NameTypeRequiredNotes
entryIdstringYesID of the Books entry to delete.

Returns

The updated or deleted entry as JSON. Returns an error if entryId does not belong to an entry in the active database.

Specialized

Purpose-built tools

Shortcuts and queries shaped around how Books is actually used, so your agent doesn't have to fetch every entry and filter them itself.

books_attach_photo

Attach a photo to an existing Books entry (replacing any photo already on it). If you have the image's raw bytes, pass photo_base64. If the user attached the image in a chat client (e.g. claude.ai), you cannot read its bytes: call this WITHOUT photo_base64 to get a one-time upload link, and give that link to the user so they can upload the photo themselves. The link expires in 30 minutes. Photos are stored privately; the returned viewPath is only viewable signed into the connacto web app as this user.

Parameters

NameTypeRequiredNotes
entryIdstringYesID of the Books entry to attach the photo to.
photo_base64stringNoThe photo, base64-encoded (no data: URI prefix). Omit when you cannot read the image bytes — the tool then returns an upload link for the user instead.
photo_content_typeimage/jpeg | image/png | image/webp | image/heicNoMIME type of the photo, if photo_base64 is set. Defaults to image/jpeg.

Returns

JSON with a private viewPath when photo_base64 was given, or an uploadUrl to hand the user when it was not.

books_list_currently_reading

List entries in the user's active Books module that have status 'reading'.

Parameters

None. Call it with an empty object.

Returns

Matching entries as a JSON array.

books_reading_stats

Return counts of entries by status (want_to_read/reading/read) and the average rating across entries with status 'read' and a non-null rating, for the user's active Books module.

Parameters

None. Call it with an empty object.

Returns

Counts by status, total entry count, average rating for read books, and how many read books were rated, as JSON.

books_lookup

Search Open Library for candidate books matching a title (and optional author). Makes exactly one live network call and writes nothing. Each candidate is annotated cached:true/false based on whether it's already present in the shared book catalog (see books_confirm_match). Zero matches is not an error: the book can still be logged by title alone via books_add_entry without a catalogId. To attach a candidate's metadata to an entry, call books_confirm_match with the chosen candidate's fields to get a catalogId, then pass that to books_add_entry/books_update_entry.

Parameters

NameTypeRequiredNotes
titlestringYesBook title to search for.
authorstringNoAuthor name, to narrow an ambiguous title search.
limitnumberNoMax candidates to return (default 5, max 10).

Returns

Up to limit candidates, each with title, author, first publish year, ISBN, page count, cover URL, up to 10 subjects, edition count, and cached (whether it is already in the local catalog), as JSON.

books_confirm_match

Cache one specific Open Library candidate (as returned by books_lookup) into the shared book catalog, then return its catalogId for use with books_add_entry/books_update_entry. Makes no network call: it upserts exactly the fields supplied, which should be copied verbatim from the chosen books_lookup candidate. This is a separate step from books_lookup, rather than auto-caching the top search hit, because the book catalog is shared across every user of connacto, not private per-user data. Free-text search over millions of works is routinely ambiguous (e.g. 'Dune' matches the novel, its sequels, and film tie-in editions), and auto-caching a guessed top hit risks a wrong match becoming permanent and visible to every future user who looks up that title. Re-fetching from Open Library here instead of trusting the supplied fields is also deliberately avoided: the values shown by books_lookup already are the confirmation, and a second fetch could silently return different data (e.g. a different edition's cover) than what was approved.

Parameters

NameTypeRequiredNotes
openLibraryIdstringYesOpen Library work id from a books_lookup candidate, e.g. 'OL27482W' (the '/works/' prefix stripped).
titlestringYesTitle, copied from the chosen books_lookup candidate.
authorstringNoAuthor, copied from the chosen books_lookup candidate.
isbnstringNoA single representative ISBN, copied from the chosen books_lookup candidate.
firstPublishYearnumberNoFirst publish year, copied from the chosen books_lookup candidate.
pageCountnumberNoPage count, copied from the chosen books_lookup candidate.
coverUrlstringNoCover image URL, copied from the chosen books_lookup candidate.
subjectsstring[]NoUp to 10 subjects, copied from the chosen books_lookup candidate.

Returns

The catalog row as JSON, including catalogId.