Skip to main content
Glama

list_images

Retrieve a paginated list of images from the BookStack gallery, with options to filter by image type and sort results.

Instructions

Get a listing of images in the gallery

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNoPage number for pagination
countNoNumber of items per page
sortNoSort parameter
filter_typeNoFilter images by type

Implementation Reference

  • Handler logic for the 'list_images' tool: destructures args, parses pagination params, calls BookStackClient.getImageGallery, and formats the API response.
    case "list_images": {
      const { filter_type, ...paginationArgs } = args;
      const params = PaginationSchema.parse(paginationArgs);
    
      const allParams = {
        ...params,
        filter_type,
      };
    
      const result = await client.getImageGallery(params);
      return formatApiResponse(result.data, result.total);
    }
  • MCP Tool definition for 'list_images', including name, description, and input JSON schema with pagination and optional filter_type.
      name: "list_images",
      description: "Get a listing of images in the gallery",
      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" },
          filter_type: {
            type: "string",
            enum: ["gallery", "drawio"],
            description: "Filter images by type",
          },
        },
      },
    },
  • src/index.ts:118-128 (registration)
    Registers 'list_images' in the searchUserToolNames array for dispatching tool calls to handleSearchAndUserTool.
      "list_images",
      "get_image",
      "update_image",
      "delete_image",
    ];
    
    if (contentToolNames.includes(name)) {
      result = await handleContentTool(name, args, bookStackClient);
    } else if (searchUserToolNames.includes(name)) {
      result = await handleSearchAndUserTool(name, args, bookStackClient);
    } else {
  • src/index.ts:62-66 (registration)
    Registers all tools (including 'list_images' via createSearchAndUserTools) for the MCP ListToolsRequestHandler.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: allTools,
      };
    });
  • BookStackClient helper method that performs the actual API GET request to '/image-gallery' endpoint to list images.
    async getImageGallery(
      params?: PaginationParams
    ): Promise<ApiResponse<ImageGallery[]>> {
      return this.get<ImageGallery>("/image-gallery", params);
    }

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