Skip to main content
Glama
hongfanmeng

Bookstore MCP Server

by hongfanmeng

get_all_books

Retrieve the complete inventory of books from the bookstore database to view available titles and manage stock.

Instructions

Get all books.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the get_all_books tool. Decorated with @mcp.tool() for registration and implementation. Returns the result of load_books().
    @mcp.tool() def get_all_books(): """Get all books.""" return load_books()
  • Helper function used by get_all_books to load the list of books from the JSON data file, handling errors gracefully.
    def load_books() -> list[dict]: try: with open(DATA_PATH, "r") as f: return json.load(f) except (FileNotFoundError, json.JSONDecodeError): return []

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hongfanmeng/bookstore-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server