get_chapter
Retrieve details for a specific chapter from BookStack, including its pages, by providing 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 logic 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 schema definition including name, description, and input schema requiring a numeric 'id' for the chapter.{ 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 of 'get_chapter' in the contentToolNames array, which routes tool calls to the appropriate handler function.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 chapter by ID.async getChapter(id: number): Promise<Chapter> { const response: AxiosResponse<Chapter> = await this.api.get( `/chapters/${id}` ); return response.data; }