Skip to main content
Glama
7robots

Micro.blog Books MCP Server

by 7robots

get_bookshelves

Retrieve all bookshelves from your Micro.blog account to organize book collections, track reading goals, and manage your digital library.

Instructions

Get all bookshelves from Micro.blog.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • MCP ServerRequestHandler for CallToolRequestSchema dispatches 'get_bookshelves' tool calls to the MicroBooksClient.getBookshelves() method and returns the JSON-formatted result.
    case "get_bookshelves": { const result = await client.getBookshelves(); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }
  • Explicit JSON schema definition for the 'get_bookshelves' tool, registered in the tools list for ListToolsRequestSchema response. Input is empty object (no parameters).
    { name: "get_bookshelves", description: "Get all bookshelves from Micro.blog", inputSchema: { type: "object", properties: {}, }, },
  • MicroBooksClient helper method implementing the core HTTP GET request to the Micro.blog '/books/bookshelves' API endpoint using a shared makeRequest utility.
    async getBookshelves() { return await this.makeRequest("/books/bookshelves"); }
  • FastMCP @tool()-decorated handler function for 'get_bookshelves' that invokes the client helper and returns indented JSON string.
    @mcp.tool() async def get_bookshelves() -> str: """Get all bookshelves from Micro.blog.""" try: result = await client.get_bookshelves() return json.dumps(result, indent=2) except Exception: logger.exception("Failed to get bookshelves") raise
  • MicroBooksClient class method containing the core implementation: async HTTP GET to Micro.blog '/books/bookshelves' with bearer auth, returns JSON dict.
    async def get_bookshelves(self) -> dict: """Get all bookshelves.""" async with httpx.AsyncClient() as client: response = await client.get( urljoin(BASE_URL, "/books/bookshelves"), headers=self.headers, ) response.raise_for_status() return response.json()

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