Skip to main content
Glama
hongfanmeng

Bookstore MCP Server

by hongfanmeng

get_book_by_id

Retrieve detailed information about a specific book using its unique identifier. This tool helps users find book details by ID for inventory lookup or purchase verification.

Instructions

Get book by ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
book_idYes

Implementation Reference

  • The main handler function for the 'get_book_by_id' tool. It is decorated with @mcp.tool() for registration and implements the logic to load books from JSON and return the matching book by ID.
    @mcp.tool()
    def get_book_by_id(book_id: int):
        """Get book by ID."""
        books = load_books()
        return next((book for book in books if book["id"] == book_id), None)
Behavior2/5

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

With no annotations, the description carries the full burden but only states the action without behavioral details. It doesn't disclose if this is a read-only operation, requires authentication, has rate limits, or what the output looks like (e.g., book details or just availability). This leaves critical gaps for safe invocation.

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 extremely concise with just three words, front-loaded and zero waste. It efficiently conveys the core action without unnecessary elaboration, though this brevity contributes to gaps in other dimensions.

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 no annotations, 0% schema coverage, and no output schema, the description is incomplete. It doesn't address the tool's complexity (a lookup by ID), missing details on behavior, parameters, or return values, making it inadequate for reliable agent use.

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

Parameters2/5

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

Schema description coverage is 0%, so the description must compensate but adds no parameter semantics. It mentions 'by ID' but doesn't explain what 'book_id' represents (e.g., numeric identifier, format, source). This fails to clarify beyond the basic schema.

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

Purpose3/5

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

The description 'Get book by ID' clearly states the verb ('Get') and resource ('book'), but it's vague about what 'Get' entails (e.g., retrieve details, fetch metadata) and doesn't distinguish it from siblings like 'get_all_books' or 'search_books_by_title'. It's minimally adequate but lacks specificity.

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 is for retrieving a single book by its unique identifier, as opposed to using search tools for broader queries. The agent must infer usage from the name 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