Skip to main content
Glama
7robots

Micro.blog Books MCP Server

by 7robots

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
NameRequiredDescriptionDefault
bookshelf_idYes
nameYes

Implementation Reference

  • 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), }, ], }; }
  • 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` }; }
  • 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"], }, },
  • 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:
  • 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"}

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/7robots/micro-mcp-server'

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