delete_book
Remove books from your personal library by ISBN to manage your reading list and keep your collection current.
Instructions
Removes a book from the library.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| isbn | Yes |
Implementation Reference
- server.py:129-142 (handler)Implementation of the 'delete_book' tool which removes a book record from the database.
@mcp.tool() def delete_book(isbn: str) -> str: """Removes a book from the library.""" conn = get_db_connection() cursor = conn.cursor() cursor.execute("DELETE FROM books WHERE isbn = ?", (isbn,)) conn.commit() changes = conn.total_changes conn.close() if changes > 0: return f"Success: Book {isbn} deleted." return f"Error: No book found with ISBN {isbn}."