change_book_cover
Update a book's cover image in your Micro.blog collection by providing the bookshelf ID, book ID, and new cover URL.
Instructions
Change the cover for a book.
Args: bookshelf_id: The ID of the bookshelf book_id: The ID of the book cover_url: URL to the new cover image
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bookshelf_id | Yes | ||
| book_id | Yes | ||
| cover_url | Yes |
Implementation Reference
- micro_mcp_server/server.py:277-291 (handler)MCP tool handler for change_book_cover: wraps the MicroBooksClient method and serializes the result to JSON.@mcp.tool() async def change_book_cover(bookshelf_id: int, book_id: int, cover_url: str) -> str: """Change the cover for a book. Args: bookshelf_id: The ID of the bookshelf book_id: The ID of the book cover_url: URL to the new cover image """ try: result = await client.change_book_cover(bookshelf_id, book_id, cover_url) return json.dumps(result, indent=2) except Exception: logger.exception("Failed to change book cover") raise
- micro_mcp_server/server.py:118-127 (helper)MicroBooksClient helper method that makes HTTP POST request to Micro.blog API to update the book cover.async def change_book_cover(self, bookshelf_id: int, book_id: int, cover_url: str) -> dict: """Change the cover for a book.""" async with httpx.AsyncClient() as client: response = await client.post( urljoin(BASE_URL, f"/books/bookshelves/{bookshelf_id}/cover/{book_id}"), headers=self.headers, data={"cover_url": cover_url}, ) response.raise_for_status() return {"success": True, "message": "Book cover updated successfully"}