Skip to main content
Glama

get_catalog_items

Retrieve catalog items from Klaviyo using catalog ID with optional filtering and pagination for managing product data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
catalog_idYesID of the catalog
filterNoFilter query for catalog items
page_sizeNoNumber of items per page (1-100)
page_cursorNoCursor for pagination

Implementation Reference

  • Handler function that destructures catalog_id from params, calls klaviyoClient.get to fetch items from the specified catalog, stringifies the response as JSON, and handles errors.
    async (params) => {
      try {
        const { catalog_id, ...queryParams } = params;
        const items = await klaviyoClient.get(`/catalogs/${catalog_id}/items/`, queryParams);
        return {
          content: [{ type: "text", text: JSON.stringify(items, null, 2) }]
        };
      } catch (error) {
        return {
          content: [{ type: "text", text: `Error retrieving catalog items: ${error.message}` }],
          isError: true
        };
      }
    },
  • Input schema using Zod for validating tool parameters: required catalog_id, optional filter, page_size, and page_cursor.
    {
      catalog_id: z.string().describe("ID of the catalog"),
      filter: z.string().optional().describe("Filter query for catalog items"),
      page_size: z.number().min(1).max(100).optional().describe("Number of items per page (1-100)"),
      page_cursor: z.string().optional().describe("Cursor for pagination")
    },
  • Direct registration of the get_catalog_items tool using server.tool, including name, input schema, handler function, and description.
    server.tool(
      "get_catalog_items",
      {
        catalog_id: z.string().describe("ID of the catalog"),
        filter: z.string().optional().describe("Filter query for catalog items"),
        page_size: z.number().min(1).max(100).optional().describe("Number of items per page (1-100)"),
        page_cursor: z.string().optional().describe("Cursor for pagination")
      },
      async (params) => {
        try {
          const { catalog_id, ...queryParams } = params;
          const items = await klaviyoClient.get(`/catalogs/${catalog_id}/items/`, queryParams);
          return {
            content: [{ type: "text", text: JSON.stringify(items, null, 2) }]
          };
        } catch (error) {
          return {
            content: [{ type: "text", text: `Error retrieving catalog items: ${error.message}` }],
            isError: true
          };
        }
      },
      { description: "Get items from a catalog in Klaviyo" }
    );
  • src/server.js:41-41 (registration)
    Invocation of registerCatalogTools which performs the tool registrations including get_catalog_items.
    registerCatalogTools(server);

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/ivan-rivera-projects/Klaviyo-MCP-Server-Enhanced'

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