rename_bookshelf
Change the name of an existing bookshelf in your Micro.blog book collection to better organize your reading materials and reflect updated categorization.
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
- dxt-extension/server/index.js:505-516 (handler)MCP tool call handler for 'rename_bookshelf' that extracts parameters and delegates to the MicroBooksClient.renameBookshelf method.case "rename_bookshelf": { const { bookshelf_id, name } = args; const result = await client.renameBookshelf(bookshelf_id, name); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
- dxt-extension/server/index.js:80-94 (helper)Core helper method in MicroBooksClient that validates inputs and makes the HTTP POST request to the Micro.blog API to rename a bookshelf.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` }; }
- dxt-extension/server/index.js:287-305 (registration)Tool registration entry in the list of available tools, including name, description, and input schema for MCP listTools response.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"], }, },
- modal/modal_http_server.py:213-223 (handler)Python FastMCP tool handler for 'rename_bookshelf' using decorator, delegates to client method (Modal variant).async def rename_bookshelf(bookshelf_id: int, name: str) -> str: """Rename a bookshelf. Args: bookshelf_id: The ID of the bookshelf to rename name: The new name for the bookshelf """ try: result = await client.rename_bookshelf(bookshelf_id, name) return json.dumps(result, indent=2) except Exception:
- modal/modal_http_server.py:52-62 (helper)Core helper in MicroBooksClient for Modal implementation that performs the API POST request.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"}