get_catalogs
Retrieve catalogs with customizable pagination options using the MCP tool on the Klaviyo server. Manage catalog data efficiently with page size and cursor parameters for streamlined workflows.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page_cursor | No | Cursor for pagination | |
| page_size | No | Number of catalogs per page (1-100) |
Implementation Reference
- src/tools/catalogs.js:12-25 (handler)Handler function that fetches catalogs from Klaviyo API endpoint '/catalogs/' using provided params, stringifies the result as JSON text content, or returns an error if the request fails.async (params) => { try { const catalogs = await klaviyoClient.get('/catalogs/', params); return { content: [{ type: "text", text: JSON.stringify(catalogs, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving catalogs: ${error.message}` }], isError: true }; } }, { description: "Get catalogs from Klaviyo" }
- src/tools/catalogs.js:8-11 (schema)Zod schema validating optional input parameters for pagination: page_size (number 1-100) and page_cursor (string).{ page_size: z.number().min(1).max(100).optional().describe("Number of catalogs per page (1-100)"), page_cursor: z.string().optional().describe("Cursor for pagination") },
- src/tools/catalogs.js:7-26 (registration)Direct registration of the 'get_catalogs' tool using server.tool(), including name, schema, handler, and description."get_catalogs", { page_size: z.number().min(1).max(100).optional().describe("Number of catalogs per page (1-100)"), page_cursor: z.string().optional().describe("Cursor for pagination") }, async (params) => { try { const catalogs = await klaviyoClient.get('/catalogs/', params); return { content: [{ type: "text", text: JSON.stringify(catalogs, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving catalogs: ${error.message}` }], isError: true }; } }, { description: "Get catalogs from Klaviyo" } );
- src/server.js:41-41 (registration)Top-level call to registerCatalogTools on the MCP server, which registers the get_catalogs tool along with other catalog-related tools.registerCatalogTools(server);