list_books
Retrieve a paginated listing of books available to the user from a BookStack wiki instance, with options to sort results and control page size.
Instructions
Get a listing of books visible to the user
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| count | No | Number of items per page | |
| page | No | Page number for pagination | |
| sort | No | Sort parameter |
Implementation Reference
- src/tools/content-tools.ts:547-551 (handler)The handler function for the 'list_books' tool. It parses the input arguments using PaginationSchema, fetches the list of books using the BookStack client, and formats the API response.case "list_books": { const params = PaginationSchema.parse(args); const result = await client.getBooks(params); return formatApiResponse(result.data, result.total); }
- src/tools/content-tools.ts:36-46 (schema)The schema definition for the 'list_books' tool, specifying the input schema with optional pagination parameters (page, count, sort).name: "list_books", description: "Get a listing of books 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:56-59 (registration)Registers the 'list_books' tool by including the output of createContentTools (which defines list_books) in the full list of tools provided to the MCP server.const allTools: Tool[] = [ ...createContentTools(bookStackClient), ...createSearchAndUserTools(bookStackClient), ];
- src/index.ts:124-126 (registration)Routes calls to 'list_books' (included in contentToolNames) to the handleContentTool function for execution.if (contentToolNames.includes(name)) { result = await handleContentTool(name, args, bookStackClient); } else if (searchUserToolNames.includes(name)) {