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 []
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It only states the filtering condition ('count > 0') without mentioning other traits like whether this is a read-only operation, if it requires authentication, how results are returned (e.g., pagination, format), or any rate limits. This is a significant gap for a tool with zero annotation coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that directly states the tool's purpose without any wasted words. It is appropriately sized and front-loaded, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It doesn't explain what the return values look like (e.g., list of books with details), behavioral aspects like safety or performance, or how it differs from sibling tools. For a tool with no structured data support, this leaves critical gaps for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has 0 parameters, and schema description coverage is 100%, so no parameter documentation is needed. The description adds value by clarifying the semantic filtering ('count > 0'), which isn't captured in the empty schema, earning a score above the baseline of 3 for zero-parameter tools.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and resource 'books' with a specific condition 'with count > 0', making the purpose understandable. However, it doesn't explicitly differentiate from siblings like 'get_all_books' (which might include out-of-stock books) or 'check_availability' (which might check a specific book), leaving room for ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. For example, it doesn't specify if this should be used for inventory checks instead of 'check_availability', or if it's preferred over 'get_all_books' for filtering in-stock items, leaving the agent to infer usage from the name and description alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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