Skip to main content
Glama
7robots

Micro.blog Books MCP Server

by 7robots

remove_book

Delete a book from a specified bookshelf in your Micro.blog book collection by providing the bookshelf and book IDs.

Instructions

Remove a book from a bookshelf.

Args: bookshelf_id: The ID of the bookshelf book_id: The ID of the book to remove

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
bookshelf_idYes
book_idYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler logic for the 'remove_book' tool call in the MCP server switch statement. It parses arguments, invokes the MicroBooksClient.removeBook method, and formats the response as MCP content.
    case "remove_book": {
      const { bookshelf_id, book_id } = args;
      const result = await client.removeBook(bookshelf_id, book_id);
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify(result, null, 2),
          },
        ],
      };
    }
  • Registration of the 'remove_book' tool in the tools list, including name, description, and input schema definition.
      name: "remove_book",
      description: "Remove a book from a bookshelf",
      inputSchema: {
        type: "object",
        properties: {
          bookshelf_id: {
            type: "integer",
            description: "The ID of the bookshelf",
            minimum: 1,
          },
          book_id: {
            type: "integer",
            description: "The ID of the book to remove",
            minimum: 1,
          },
        },
        required: ["bookshelf_id", "book_id"],
      },
    },
  • Core helper method in MicroBooksClient that performs the HTTP DELETE request to Micro.blog API to remove the book from the bookshelf.
    async removeBook(bookshelfId, bookId) {
      if (!Number.isInteger(bookshelfId) || bookshelfId <= 0) {
        throw new Error("Bookshelf ID must be a positive integer");
      }
      if (!Number.isInteger(bookId) || bookId <= 0) {
        throw new Error("Book ID must be a positive integer");
      }
    
      await this.makeRequest(`/books/bookshelves/${bookshelfId}/remove/${bookId}`, {
        method: "DELETE",
      });
    
      return { success: true, message: "Book removed from bookshelf successfully" };
    }
  • FastMCP tool handler and registration for 'remove_book'. Includes input parameters as schema, docstring description, calls client helper, returns JSON.
    @mcp.tool()
    async def remove_book(bookshelf_id: int, book_id: int) -> str:
        """Remove a book from a bookshelf.
        
        Args:
            bookshelf_id: The ID of the bookshelf
            book_id: The ID of the book to remove
        """
        try:
            result = await client.remove_book(bookshelf_id, book_id)
            return json.dumps(result, indent=2)
        except Exception:
            logger.exception("Failed to remove book")
            raise
  • Core implementation in MicroBooksClient that sends DELETE request to the Micro.blog Books API endpoint to remove the specified book from the bookshelf.
    async def remove_book(self, bookshelf_id: int, book_id: int) -> dict:
        """Remove a book from a bookshelf."""
        async with httpx.AsyncClient() as client:
            response = await client.delete(
                urljoin(BASE_URL, f"/books/bookshelves/{bookshelf_id}/remove/{book_id}"),
                headers=self.headers,
            )
            response.raise_for_status()
            return {"success": True, "message": "Book removed from bookshelf successfully"}
Behavior2/5

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

With no annotations provided, the description carries full burden but offers minimal behavioral insight. It states the action is 'Remove' but doesn't clarify if this is destructive (permanent deletion), reversible, requires specific permissions, or has side effects. For a mutation tool with zero annotation coverage, this is inadequate disclosure.

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 front-loaded with the core purpose in the first sentence, followed by parameter details in a clear 'Args:' section. It's appropriately sized with no redundant information, though the parameter explanations are brief but sufficient given the simple schema.

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 complexity (simple mutation with 2 parameters), the description covers the basic action and parameters. However, with no annotations and an output schema present (which isn't detailed here), it lacks behavioral context like side effects or permissions. It's minimally viable but leaves gaps for safe agent operation.

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 both parameters beyond the schema (which has 0% coverage). It specifies that 'bookshelf_id' identifies the bookshelf and 'book_id' identifies the book to remove, clarifying their roles. Since there are only 2 parameters and the description covers both adequately, it compensates well for the schema gap.

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 action ('Remove') and target resource ('a book from a bookshelf'), making the purpose immediately understandable. It distinguishes from siblings like 'move_book' (which relocates) and 'add_book' (which adds). However, it doesn't specify whether this is a permanent deletion or just removal from the shelf, leaving some 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?

No guidance is provided on when to use this tool versus alternatives like 'move_book' (which might relocate instead of remove) or prerequisites (e.g., whether the book must exist on the shelf). The description only states what it does, not when it's appropriate, leaving the agent to infer usage from 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