Google Books API Integration

#1
Agents-MCP-Hackathon org

Google Books API Integration

This PR adds two MCP tools for integration with Google Books API.
Those tools can be tested with Gradio UI in two dedicated tabs:

  • Google Books - Search: search books with filters (title, author, isbn, genre) and return a json with the list of books info. Each book has only some basic information ('lite' version of the book), but full information are available with the other tool described below.
    Response object looks like this:
{
  "kind": "books#volumes",
  "totalItems": 1000000,
  "items": [
    {
      "kind": "books#volume",
      "id": "pZ49u0fSuGsC",
      "etag": "kCfPFbplXAM",
      "selfLink": "https://www.googleapis.com/books/v1/volumes/pZ49u0fSuGsC",
      "volumeInfo": {
        "title": "Professional Test Driven Development with C#",
        "subtitle": "Developing Real World Applications with TDD",
        "authors": [
          "James Bender",
          "Jeff McWherter"
        ],
       ...
       },
       ...
     },
    ...
   ]
}
  • Google Books - Get Book By Id: this tool can be useful to retrieve a book by its Google Books ID, returning a json with all information about the book.
    In case of success, the returned json looks like a single item from the previous tool's response object (plus some additional fields).
    In case of non-existent book, the returned json looks like this:
{
  "error": {
    "code": 404,
    "message": "The volume ID could not be found.",
    "errors": [
      {
        "message": "The volume ID could not be found.",
        "domain": "global",
        "reason": "notFound"
      }
    ]
  }
}
Agents-MCP-Hackathon org

@gmacario please review and merge if it's ok. Tested locally with no issues.

Agents-MCP-Hackathon org

Thank you for your contribution @aleche28 !

Merging PR

gmacario changed pull request status to merged

Sign up or log in to comment