get_images
Retrieve filtered images in bulk from the Klaviyo MCP Server by specifying query filters, page size, and pagination cursor for efficient data handling.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filter | No | Filter query for images | |
| page_cursor | No | Cursor for pagination | |
| page_size | No | Number of images per page (1-100) |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"filter": {
"description": "Filter query for images",
"type": "string"
},
"page_cursor": {
"description": "Cursor for pagination",
"type": "string"
},
"page_size": {
"description": "Number of images per page (1-100)",
"maximum": 100,
"minimum": 1,
"type": "number"
}
},
"type": "object"
}
Implementation Reference
- src/tools/images.js:13-25 (handler)Handler function that calls klaviyoClient.get to fetch images from '/images/' endpoint with provided params, formats as JSON text content or error.async (params) => { try { const images = await klaviyoClient.get('/images/', params); return { content: [{ type: "text", text: JSON.stringify(images, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving images: ${error.message}` }], isError: true }; } },
- src/tools/images.js:8-12 (schema)Zod input schema defining optional parameters: filter (string), page_size (number 1-100), page_cursor (string).{ filter: z.string().optional().describe("Filter query for images"), page_size: z.number().min(1).max(100).optional().describe("Number of images per page (1-100)"), page_cursor: z.string().optional().describe("Cursor for pagination") },
- src/tools/images.js:6-27 (registration)Direct registration of the get_images tool on the MCP server, including name, schema, handler, and description.server.tool( "get_images", { filter: z.string().optional().describe("Filter query for images"), page_size: z.number().min(1).max(100).optional().describe("Number of images per page (1-100)"), page_cursor: z.string().optional().describe("Cursor for pagination") }, async (params) => { try { const images = await klaviyoClient.get('/images/', params); return { content: [{ type: "text", text: JSON.stringify(images, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving images: ${error.message}` }], isError: true }; } }, { description: "Get images from Klaviyo" } );
- src/server.js:48-48 (registration)Top-level call to registerImageTools(server), which in turn registers the get_images tool.registerImageTools(server);