get_books_in_stock
Retrieve all books currently available in the bookstore inventory that are in stock and ready for purchase.
Instructions
Get books with count > 0.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/bookstore_mcp/server.py:54-57 (handler)The handler function for the 'get_books_in_stock' tool. It uses a list comprehension to filter and return only books where the 'count' field is greater than 0, by loading the books data via the load_books helper.@mcp.tool() def get_books_in_stock(): """Get books with count > 0.""" return [book for book in load_books() if book["count"] > 0]