rename_bookshelf
Change the name of a bookshelf in your Micro.blog book collection to better organize your reading materials and track your reading goals.
Instructions
Rename a bookshelf.
Args: bookshelf_id: The ID of the bookshelf to rename name: The new name for the bookshelf
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bookshelf_id | Yes | ||
| name | Yes |
Implementation Reference
- micro_mcp_server/server.py:58-67 (handler)Core handler in MicroBooksClient that sends POST request to Micro.blog API to rename the bookshelf.async def rename_bookshelf(self, bookshelf_id: int, name: str) -> dict: """Rename a bookshelf.""" async with httpx.AsyncClient() as client: response = await client.post( urljoin(BASE_URL, f"/books/bookshelves/{bookshelf_id}"), headers=self.headers, data={"name": name}, ) response.raise_for_status() return {"success": True, "message": f"Bookshelf renamed to '{name}' successfully"}
- dxt-extension/server/index.js:80-93 (handler)Core handler in MicroBooksClient that sends POST request to Micro.blog API to rename the bookshelf (JavaScript implementation).async renameBookshelf(bookshelfId, name) { if (!Number.isInteger(bookshelfId) || bookshelfId <= 0) { throw new Error("Bookshelf ID must be a positive integer"); } if (!name || typeof name !== 'string' || name.trim().length === 0) { throw new Error("Bookshelf name is required and must be a non-empty string"); } await this.makeRequest(`/books/bookshelves/${bookshelfId}`, { method: "POST", body: new URLSearchParams({ name: name.trim() }), }); return { success: true, message: `Bookshelf renamed to '${name.trim()}' successfully` };
- Core handler in MicroBooksClient that sends POST request to Micro.blog API to rename the bookshelf (DXT Python version).async def rename_bookshelf(self, bookshelf_id: int, name: str) -> dict: """Rename a bookshelf.""" async with httpx.AsyncClient() as client: response = await client.post( urljoin(BASE_URL, f"/books/bookshelves/{bookshelf_id}"), headers=self.headers, data={"name": name}, ) response.raise_for_status() return {"success": True, "message": f"Bookshelf renamed to '{name}' successfully"}
- modal/modal_http_server.py:52-61 (handler)Core handler in MicroBooksClient that sends POST request to Micro.blog API to rename the bookshelf (Modal version).async def rename_bookshelf(self, bookshelf_id: int, name: str) -> dict: """Rename a bookshelf.""" async with httpx.AsyncClient() as client: response = await client.post( urljoin(BASE_URL, f"/books/bookshelves/{bookshelf_id}"), headers=self.headers, data={"name": name}, ) response.raise_for_status() return {"success": True, "message": f"Bookshelf renamed to '{name}' successfully"}
- Input schema definition for the rename_bookshelf tool in the JS implementation.name: "rename_bookshelf", description: "Rename an existing bookshelf", inputSchema: { type: "object", properties: { bookshelf_id: { type: "integer", description: "The ID of the bookshelf to rename", minimum: 1, }, name: { type: "string", description: "The new name for the bookshelf", minLength: 1, }, }, required: ["bookshelf_id", "name"], },