Skip to main content
Glama
hongfanmeng

Bookstore MCP Server

by hongfanmeng

get_books_in_stock

Retrieve available books currently in stock from the bookstore inventory to check what items are ready for purchase or management.

Instructions

Get books with count > 0.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'get_books_in_stock' tool, decorated with @mcp.tool() to register it. It filters and returns books where the stock count is greater than 0.
    @mcp.tool() def get_books_in_stock(): """Get books with count > 0.""" return [book for book in load_books() if book["count"] > 0]
  • Helper function used by get_books_in_stock to load the list of books from a JSON file.
    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