Skip to main content
Glama

get_book

Retrieve detailed information and content structure for a specific book from a BookStack wiki instance using its unique ID.

Instructions

Get details of a specific book including its content structure

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesBook ID

Implementation Reference

  • The main handler logic for the 'get_book' tool within the handleContentTool switch statement. It parses the book ID from input arguments, calls the BookStackClient's getBook method, and returns a formatted API response.
    case "get_book": {
      const id = parseInteger(args.id);
      const result = await client.getBook(id);
      return formatApiResponse(result);
    }
  • Tool schema definition for 'get_book', specifying the name, description, and input schema requiring a numeric 'id' parameter. Part of the createContentTools array.
      name: "get_book",
      description:
        "Get details of a specific book including its content structure",
      inputSchema: {
        type: "object",
        properties: {
          id: { type: "number", description: "Book ID" },
        },
        required: ["id"],
      },
    },
  • src/index.ts:76-126 (registration)
    Registers 'get_book' by including it in the contentToolNames array and routing calls to handleContentTool in the MCP server's CallToolRequest handler.
    const contentToolNames = [
      "list_books",
      "get_book",
      "create_book",
      "update_book",
      "delete_book",
      "export_book",
      "list_chapters",
      "get_chapter",
      "create_chapter",
      "update_chapter",
      "delete_chapter",
      "export_chapter",
      "list_pages",
      "get_page",
      "create_page",
      "update_page",
      "delete_page",
      "export_page",
      "list_shelves",
      "get_shelf",
      "create_shelf",
      "update_shelf",
      "delete_shelf",
    ];
    
    // Search and user tools
    const searchUserToolNames = [
      "search_all",
      "list_users",
      "get_user",
      "create_user",
      "update_user",
      "delete_user",
      "list_roles",
      "get_role",
      "create_role",
      "update_role",
      "delete_role",
      "list_attachments",
      "get_attachment",
      "delete_attachment",
      "list_images",
      "get_image",
      "update_image",
      "delete_image",
    ];
    
    if (contentToolNames.includes(name)) {
      result = await handleContentTool(name, args, bookStackClient);
    } else if (searchUserToolNames.includes(name)) {
  • Helper method in BookStackClient that performs the actual API GET request to retrieve a book by ID from the BookStack server.
    async getBook(id: number): Promise<Book> {
      const response: AxiosResponse<Book> = await this.api.get(`/books/${id}`);
      return response.data;
    }

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/lautarobarba/bookstack_mcp_server'

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