Skip to main content
Glama
srgsanky

Personal Library MCP Server

by srgsanky

add_book

Adds new books to your personal library by entering ISBN, title, author, genre, and publication year. Track ownership and reading status to manage your collection.

Instructions

Adds a new book to the library.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
isbnYes
nameYes
authorYes
genreYes
yearYes
ownedNo
readNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • server.py:68-84 (handler)
    The handler function for the `add_book` tool, which inserts a new book record into the SQLite database.
    @mcp.tool()
    def add_book(isbn: str, name: str, author: str, genre: str, year: int, owned: bool = False, read: bool = False) -> str:
        """Adds a new book to the library."""
        metadata = json.dumps({"author": author, "genre": genre, "year": year})
        conn = get_db_connection()
        cursor = conn.cursor()
        try:
            cursor.execute("""
            INSERT INTO books (isbn, name, metadata, owned, read)
            VALUES (?, ?, ?, ?, ?)
            """, (isbn, name, metadata, int(owned), int(read)))
            conn.commit()
            return f"Success: Book '{name}' added with ISBN {isbn}."
        except sqlite3.IntegrityError:
            return f"Error: Book with ISBN {isbn} already exists."
        finally:
            conn.close()
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Adds' implies a mutation/write operation, but the description doesn't cover critical aspects like permissions needed, whether duplicates are allowed, error handling, or what the output contains. It lacks details on side effects, rate limits, or authentication requirements.

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 with zero waste. It's front-loaded with the core action and resource, making it easy to parse quickly. No extraneous information or redundancy is present.

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

Completeness3/5

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

Given the tool's complexity (7 parameters, mutation operation) and the presence of an output schema (which covers return values), the description is minimally adequate but incomplete. It states the basic purpose but lacks usage guidelines, parameter explanations, and behavioral details needed for a mutation tool with no annotations. The output schema helps, but the description should do more to guide the agent.

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?

With 0% schema description coverage and 7 parameters (5 required), the description adds no meaning beyond the schema. It doesn't explain what 'isbn', 'genre', 'owned', or other parameters represent, their formats, or constraints. The description fails to compensate for the schema's lack of parameter explanations.

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 ('Adds') and resource ('a new book to the library'), making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'update_book_status' or 'delete_book', which would require mentioning it's for creation rather than modification or removal.

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 'update_book_status' or 'delete_book'. It doesn't mention prerequisites (e.g., required fields), exclusions, or contextual cues for selection, leaving the agent to infer usage from the tool 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/srgsanky/mcp-demo'

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