Skip to main content
Glama
hongfanmeng

Bookstore MCP Server

by hongfanmeng

get_all_books

Retrieve a complete list of all books available in the bookstore inventory for browsing or management purposes.

Instructions

Get all books.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function for the 'get_all_books' MCP tool. Decorated with @mcp.tool() to register it with the FastMCP server. Executes by calling the load_books helper to return all books from the JSON data file.
    @mcp.tool() def get_all_books(): """Get all books.""" return load_books()
  • Supporting helper function used by get_all_books (and other tools) to load the books data from books.json, returning an empty list on errors.
    def load_books() -> list[dict]: try: with open(DATA_PATH, "r") as f: return json.load(f) except (FileNotFoundError, json.JSONDecodeError): return []
  • The @mcp.tool() decorator registers the get_all_books function as an MCP tool.
    @mcp.tool()

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