search_all
Search across books, chapters, pages, and shelves in BookStack to find specific content using a query string.
Instructions
Search across all content types (books, chapters, pages, shelves) in BookStack
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search query string (required) | |
| page | No | Page number for pagination | |
| count | No | Number of items per page (default 20, max 500) |
Implementation Reference
- src/tools/search-user-tools.ts:337-354 (handler)Handler implementation for the 'search_all' tool. Parses arguments, validates query, calls BookStackClient.search method, and formats the API response.case "search_all": { const { query, page, count } = args; if (!query || typeof query !== "string") { throw new Error("Search query is required and must be a string"); } const params = { query, page: page ? parseInteger(page) : undefined, count: count ? parseInteger(count) : undefined, }; const result = await client.search(query, { page: page ? parseInteger(page) : undefined, count: count ? parseInteger(count) : undefined, }); return formatApiResponse(result.data, result.total); }
- src/tools/search-user-tools.ts:13-35 (schema)Input schema definition for the 'search_all' tool, including properties for query (required), page, and count.{ name: "search_all", description: "Search across all content types (books, chapters, pages, shelves) in BookStack", inputSchema: { type: "object", properties: { query: { type: "string", description: "Search query string (required)", }, page: { type: "number", description: "Page number for pagination", }, count: { type: "number", description: "Number of items per page (default 20, max 500)", }, }, required: ["query"], }, },
- src/index.ts:56-59 (registration)Registration of the 'search_all' tool as part of the allTools array via createSearchAndUserTools, used in MCP server tool listing.const allTools: Tool[] = [ ...createContentTools(bookStackClient), ...createSearchAndUserTools(bookStackClient), ];
- src/index.ts:62-66 (registration)MCP server request handler for listing tools, which includes 'search_all' from allTools.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: allTools, }; });
- src/index.ts:124-128 (registration)Dispatch logic in CallToolRequestHandler that routes calls to 'search_all' to the handleSearchAndUserTool function.if (contentToolNames.includes(name)) { result = await handleContentTool(name, args, bookStackClient); } else if (searchUserToolNames.includes(name)) { result = await handleSearchAndUserTool(name, args, bookStackClient); } else {