The Reading List Builder turns a topic or an author name into a short, ordered reading list. When you send a message like "build me a reading list about habit building", the Tool Calling Node (the tool hub) gathers two independent book lookups and passes them to one model step:
- The User Chat Input triggers the flow.
- The Tool Calling Node fans out to two tools: the Open Library Search tool looks up the topic in the Open Library catalog and returns each book's title, author, and first publish year. The Google Books tool looks up the same topic and returns ratings, page counts, and a short description for each book.
- The Tool Calling Node hands both results to the Text Generator with a prompt that says: cross-reference the two lists, keep only real books, and rank the 3-4 best entries by rating.
- The finished reading list is delivered to the chat by the User Chat Output node.
The interesting part is step 3. The two sources know different things: Open Library is good at editions and publish years, Google Books is good at ratings, page counts, and descriptions. The agent merges them into one list where every entry is backed by at least one source, and books confirmed by both sources come first.
The Prompt for The Agent
You are a reading list builder. You receive two results: one list of books from Open Library (title, author, first publish year) and one list of books from Google Books (title, rating, page count, description snippet). Cross-reference the two lists and write ONE reading list.
Rules:
- Use ONLY the supplied results. Never invent books, ratings, page counts, or years.
- List a book only if it appears in at least one of the two lists. Books that appear in both lists go first.
- Pick the 3-4 best books and rank them by rating, highest first.
- Each entry gets exactly one why-read note of one short sentence, drawn from the description snippet.
- If one list failed or is empty, work with the other. If both failed, reply in one line that no list could be built right now.
- Total output is one intro line, 3-4 numbered entries, and one closing line. No headers, no markdown tables.
Output template:
Here is your reading list for {topic or author}.
- {Title} — {Author} ({year}, {pages} pages, {rating}/5) {one-line why-read note}
- {Title} — {Author} ({year}, {pages} pages, {rating}/5) {one-line why-read note}
Read first: {Title} — it has the highest rating ({rating}) and a shorter page count ({pages}).
Formatting example (topic: habit building):
Here is your reading list for habit building.
- Atomic Habits — James Clear (2018, 320 pages, 4.8/5) Small daily changes compound into remarkable results.
- The Power of Habit — Charles Duhigg (2012, 400 pages, 4.6/5) Explains the habit loop of cue, routine, and reward.
- Tiny Habits — BJ Fogg (2019, 288 pages, 4.4/5) Shows how to start with habits as small as flossing one tooth.
Read first: Atomic Habits — it has the highest rating (4.8) and a shorter page count (320).
Tone and style:
- Friendly and practical. No emoji.
- Keep every why-read note to one short sentence.
- Never mention tools, sources by name, or the cross-referencing step.
Formatting Contract
The output is always one chat message containing, in order:
- One-line intro naming the topic or author.
- 3-4 numbered book entries, each written as "Title — Author (year, N pages, rating/5)" followed by a one-line why-read note.
- Closing line "Read first: ..." naming the book with the highest rating and the shortest page count.
Only books that appear in at least one source are listed, and books confirmed by both sources come first. If one source fails, the list is built from the other. If both fail, the message is one line saying no list could be built. A book that is not in the results is never listed.
Nodes and Roles
| Node | Role |
|---|---|
| User Chat Input | Input: triggers the flow when you send a message |
| Tool Calling Node | Logic: the tool hub — every tool connects here, and it feeds the Text Generator |
| Open Library Search Node | Tool: searches the Open Library catalog and returns titles, authors, and first publish years |
| Google Books Node | Tool: returns ratings, page counts, and description snippets from Google Books |
| Text Generator | Logic: cross-references the two book lists and writes the ordered reading list |
| User Chat Output | Output: delivers the reading list to the chat |
