Skip to main content
Glama
7robots

Micro.blog Books MCP Server

by 7robots

get_bookshelf_books

Retrieve books from a specific Micro.blog bookshelf by providing the bookshelf ID to access your organized book collection.

Instructions

Get books in a specific bookshelf.

Args: bookshelf_id: The ID of the bookshelf to get books from

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bookshelf_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler for get_bookshelf_books: calls the MicroBooksClient method and returns JSON stringified result with docstring defining input schema.
    @mcp.tool()
    async def get_bookshelf_books(bookshelf_id: int) -> str:
        """Get books in a specific bookshelf.
        
        Args:
            bookshelf_id: The ID of the bookshelf to get books from
        """
        try:
            result = await client.get_bookshelf_books(bookshelf_id)
            return json.dumps(result, indent=2)
        except Exception:
            logger.exception("Failed to get bookshelf books")
            raise
  • Helper method in MicroBooksClient that performs HTTP GET request to Micro.blog API to fetch books from a specific bookshelf.
    async def get_bookshelf_books(self, bookshelf_id: int) -> dict:
        """Get books in a specific bookshelf."""
        async with httpx.AsyncClient() as client:
            response = await client.get(
                urljoin(BASE_URL, f"/books/bookshelves/{bookshelf_id}"),
                headers=self.headers,
            )
            response.raise_for_status()
            return response.json()
  • Handler case in CallToolRequestSchema switch for get_bookshelf_books: extracts bookshelf_id, calls client method, returns formatted text content.
    case "get_bookshelf_books": {
      const { bookshelf_id } = args;
      const result = await client.getBookshelfBooks(bookshelf_id);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • Tool schema definition including name, description, and inputSchema specifying bookshelf_id as required positive integer.
      name: "get_bookshelf_books",
      description: "Get books in a specific bookshelf",
      inputSchema: {
        type: "object",
        properties: {
          bookshelf_id: {
            type: "integer",
            description: "The ID of the bookshelf to get books from",
            minimum: 1,
          },
        },
        required: ["bookshelf_id"],
      },
    },
  • Helper method in MicroBooksClient that validates bookshelfId and makes HTTP request to fetch books from the bookshelf.
    async getBookshelfBooks(bookshelfId) {
      if (!Number.isInteger(bookshelfId) || bookshelfId <= 0) {
        throw new Error("Bookshelf ID must be a positive integer");
      }
      return await this.makeRequest(`/books/bookshelves/${bookshelfId}`);
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool 'Get books,' implying a read-only operation, but does not clarify aspects like whether it returns all books or is paginated, what format the output takes, or any error conditions. For a tool with no annotations, this leaves significant gaps in understanding its behavior.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, with the main purpose stated first ('Get books in a specific bookshelf.') followed by parameter details. It avoids unnecessary words, though the structure could be slightly improved by integrating the parameter explanation more seamlessly rather than as a separate 'Args:' section.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (1 parameter) and the presence of an output schema, the description is minimally adequate. It covers the basic purpose and parameter semantics but lacks behavioral details (e.g., output format, pagination) that the output schema might address. Without annotations, it should do more to explain the tool's operation, but the output schema reduces the burden slightly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaningful context for the single parameter: 'bookshelf_id: The ID of the bookshelf to get books from.' This clarifies the parameter's role beyond the schema, which only provides a title and type. Since schema description coverage is 0%, the description compensates well by explaining the parameter's purpose, though it could add more detail (e.g., format or source of the ID).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Get books in a specific bookshelf.' It specifies the verb ('Get') and resource ('books in a specific bookshelf'), making it easy to understand. However, it does not explicitly differentiate from sibling tools like 'get_bookshelves' (which likely lists bookshelves rather than books within one), leaving room for slight ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It does not mention sibling tools like 'get_bookshelves' (for listing bookshelves) or 'add_book' (for adding books), nor does it specify prerequisites or exclusions. Usage is implied only by the tool name and description, lacking explicit context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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