Skip to main content
Glama
xytangme

NeoDB MCP Server

Official
by xytangme

search-books

Search for books in the NeoDB catalog using queries to find specific titles, authors, or topics.

Instructions

Search items in catalog

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query for books

Implementation Reference

  • Handler for the 'search-books' tool: validates input query, performs HTTP GET to NeoDB /api/catalog/search endpoint with query param, processes response, formats books using helper, returns TextContent.
    elif name == "search-books":
        """
        https://neodb.social/developer/#/catalog/catalog_api_search_item
        #TBD category and page parameters not supported
        """
        query = arguments.get("query")
        if not query:
            raise ValueError("Missing query parameter")
    
        async with httpx.AsyncClient() as client:
            search_data, status_code = await make_neodb_request(
                client, 
                access_token,
                f"/api/catalog/search?query={query}&page=1",
                api_base
            )
    
            if status_code != 200:
                error_message = {
                    400: "Bad request",
                }.get(status_code, f"Request failed with status code: {status_code}")
                
                return [types.TextContent(type="text", text=error_message)]
    
            if not search_data:
                return [types.TextContent(type="text", text=f"Failed to search books")]
    
            books = search_data.get("data", [])
            if not books:
                return [types.TextContent(type="text", text=f"No books found for query: {query}")]
    
            # Format each book into a concise string
            formatted_books = [format_book(book) for book in books]
            books_text = f"Search results for '{query}':\n\n" + "\n".join(formatted_books)
    
            return [
                types.TextContent(
                    type="text",
                    text=books_text
                )
            ]
  • Registers the 'search-books' tool with MCP server via list_tools(), including description and inputSchema.
    types.Tool(
        name="search-books",
        description="Search items in catalog",
        inputSchema={
            "type": "object",
            "properties": {
                "query": {
                    "type": "string",
                    "description": "Search query for books",
                }
            },
            "required": ["query"],
        },
    ),
  • Utility function to format individual book data into a multi-line string representation, called by search-books handler.
    def format_book(book: dict) -> str:
        """Format a book into a concise string."""
        return (
            f"Title: {book.get('title', 'Unknown')}\n"
            f"Author: {book.get('author', 'Unknown')}\n"
            f"Rating: {book.get('rating', 'N/A')}\n"
            f"Description: {book.get('description', 'No description available')}\n"
            "---"
        )
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral disclosure. 'Search items in catalog' implies a read-only operation but doesn't specify whether it returns partial/full matches, supports pagination, has rate limits, or requires authentication. For a search tool with zero annotation coverage, this leaves significant behavioral gaps.

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

Conciseness4/5

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

The description is a single, efficient sentence with no wasted words. It's appropriately sized for a simple tool, though it could be more specific. The structure is straightforward but lacks front-loading of critical details.

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, no output schema, and a simple but vague description, this is incomplete for effective tool use. The description doesn't explain what 'items' are, what 'catalog' refers to, or what the search returns. For a search tool with one parameter, more context about behavior and results is needed.

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

Parameters3/5

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

Schema description coverage is 100% with one parameter 'query' fully documented in the schema. The description adds no parameter-specific information beyond what's in the schema. According to guidelines, when schema coverage is high (>80%), the baseline is 3 even with no param info in description.

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 'Search items in catalog' states a general purpose (searching items) but is vague about the resource domain. It mentions 'catalog' which implies books given the tool name, but doesn't explicitly state 'books' or differentiate from potential sibling tools like get-book. The verb 'search' is clear, but the resource specification is incomplete.

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?

The description provides no guidance on when to use this tool versus alternatives like get-book or get-user-info. There's no mention of use cases, prerequisites, or exclusions. The agent must infer usage from the tool name and context 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/xytangme/neodb-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server