Skip to main content
Glama

list_books

Retrieve a paginated list of books available in BookStack, with options to sort results and control display count for efficient content browsing.

Instructions

Get a listing of books visible to the user

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number for pagination
countNoNumber of items per page
sortNoSort parameter

Implementation Reference

  • The handler case for 'list_books' that validates input with PaginationSchema, calls client.getBooks(params), and formats the paginated response using formatApiResponse.
    case "list_books": {
      const params = PaginationSchema.parse(args);
      const result = await client.getBooks(params);
      return formatApiResponse(result.data, result.total);
    }
  • Tool metadata and input schema definition for 'list_books', specifying optional pagination parameters.
    {
      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" },
        },
      },
    },
  • Zod validation schema for pagination parameters used in the list_books handler.
    export const PaginationSchema = z
      .object({
        page: z.number().optional(),
        count: z.number().optional(),
        sort: z.string().optional(),
      })
      .optional();
  • src/index.ts:56-59 (registration)
    Incorporates the list_books tool (via createContentTools) into the complete list of tools advertised to the MCP client via listTools.
    const allTools: Tool[] = [
      ...createContentTools(bookStackClient),
      ...createSearchAndUserTools(bookStackClient),
    ];
  • src/index.ts:124-127 (registration)
    Dispatch logic in callTool handler that routes 'list_books' calls (as part of contentToolNames) to the appropriate handleContentTool function.
    if (contentToolNames.includes(name)) {
      result = await handleContentTool(name, args, bookStackClient);
    } else if (searchUserToolNames.includes(name)) {
      result = await handleSearchAndUserTool(name, args, bookStackClient);

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/lautarobarba/bookstack_mcp_server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server