list_chapters
Retrieve a paginated listing of chapters from BookStack wiki instances to view and manage chapter content with customizable sorting options.
Instructions
Get a listing of chapters visible to the user
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number for pagination | |
| count | No | Number of items per page | |
| sort | No | Sort parameter |
Implementation Reference
- src/tools/content-tools.ts:609-613 (handler)The execution logic for the 'list_chapters' tool. Parses arguments with PaginationSchema, calls BookStackClient.getChapters, and formats the response.case "list_chapters": { const params = PaginationSchema.parse(args); const result = await client.getChapters(params); return formatApiResponse(result.data, result.total); }
- src/tools/content-tools.ts:164-175 (schema)Tool definition object for 'list_chapters' including its name, description, and input JSON Schema.{ name: "list_chapters", description: "Get a listing of chapters visible to the user", inputSchema: { type: "object", properties: { page: { type: "number", description: "Page number for pagination" }, count: { type: "number", description: "Number of items per page" }, sort: { type: "string", description: "Sort parameter" }, }, }, },
- src/index.ts:57-59 (registration)Registers the 'list_chapters' tool (via createContentTools) into the allTools array provided to the MCP server's listTools handler....createContentTools(bookStackClient), ...createSearchAndUserTools(bookStackClient), ];
- src/index.ts:124-126 (registration)Routes calls to 'list_chapters' (listed in contentToolNames at line 83) to the handleContentTool function.if (contentToolNames.includes(name)) { result = await handleContentTool(name, args, bookStackClient); } else if (searchUserToolNames.includes(name)) {