get_book
Retrieve detailed information about a specific book from BookStack, including its content structure and organization, by providing the book ID.
Instructions
Get details of a specific book including its content structure
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Book ID |
Implementation Reference
- src/tools/content-tools.ts:553-557 (handler)MCP tool handler implementation for get_book: parses the book ID from input arguments, invokes BookStackClient.getBook(id), and returns a formatted API response.case "get_book": { const id = parseInteger(args.id); const result = await client.getBook(id); return formatApiResponse(result); }
- src/tools/content-tools.ts:48-58 (schema)Input schema for the get_book tool, defining a required numeric 'id' property for the Book ID.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/lib/bookstack-client.ts:90-93 (helper)Core helper method in BookStackClient that performs the HTTP GET request to fetch book details by ID from the BookStack API.async getBook(id: number): Promise<Book> { const response: AxiosResponse<Book> = await this.api.get(`/books/${id}`); return response.data; }
- src/index.ts:124-126 (registration)Registration and dispatch logic in the MCP server request handler: checks if tool name is in contentToolNames (which includes "get_book") and routes to handleContentTool.if (contentToolNames.includes(name)) { result = await handleContentTool(name, args, bookStackClient); } else if (searchUserToolNames.includes(name)) {
- src/index.ts:56-59 (registration)Tool registration: creates the list of available tools by spreading createContentTools (which defines get_book schema) into allTools, used for ListToolsRequest.const allTools: Tool[] = [ ...createContentTools(bookStackClient), ...createSearchAndUserTools(bookStackClient), ];