get_chapter
Retrieve chapter details and page contents from BookStack wiki using the chapter ID.
Instructions
Get details of a specific chapter including its pages
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | Chapter ID |
Implementation Reference
- src/tools/content-tools.ts:615-619 (handler)Handler function for the 'get_chapter' tool. Parses the input ID, fetches the chapter using the BookStack client, and formats the API response.case "get_chapter": { const id = parseInteger(args.id); const result = await client.getChapter(id); return formatApiResponse(result); }
- src/tools/content-tools.ts:176-186 (schema)Tool declaration including name, description, and input schema requiring a numeric chapter ID.{ name: "get_chapter", description: "Get details of a specific chapter including its pages", inputSchema: { type: "object", properties: { id: { type: "number", description: "Chapter ID" }, }, required: ["id"], }, },
- src/index.ts:76-100 (registration)Registration in the contentToolNames array, which determines if the tool call is routed to handleContentTool.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", ];
- src/lib/bookstack-client.ts:148-153 (helper)Helper method in BookStackClient that performs the actual API call to retrieve a specific chapter by ID.async getChapter(id: number): Promise<Chapter> { const response: AxiosResponse<Chapter> = await this.api.get( `/chapters/${id}` ); return response.data; }
- src/index.ts:56-59 (registration)Tools from createContentTools (which includes 'get_chapter') are added to allTools for listing available tools.const allTools: Tool[] = [ ...createContentTools(bookStackClient), ...createSearchAndUserTools(bookStackClient), ];