Skip to main content
Glama

get_events

Retrieve filtered events from Klaviyo using pagination. Specify filters, page size, and cursor to manage event data efficiently for marketing automation.

Input Schema

NameRequiredDescriptionDefault
filterNoFilter query for events
page_cursorNoCursor for pagination
page_sizeNoNumber of events per page (1-100)

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "filter": { "description": "Filter query for events", "type": "string" }, "page_cursor": { "description": "Cursor for pagination", "type": "string" }, "page_size": { "description": "Number of events per page (1-100)", "maximum": 100, "minimum": 1, "type": "number" } }, "type": "object" }

Implementation Reference

  • The handler function that implements the core logic of the 'get_events' tool. It calls the Klaviyo client to fetch events based on parameters and handles errors.
    async (params) => { try { const events = await klaviyoClient.get('/events/', params); return { content: [{ type: "text", text: JSON.stringify(events, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving events: ${error.message}` }], isError: true }; } },
  • Zod schema defining the input parameters for the 'get_events' tool: filter, page_size, and page_cursor.
    { filter: z.string().optional().describe("Filter query for events"), page_size: z.number().min(1).max(100).optional().describe("Number of events per page (1-100)"), page_cursor: z.string().optional().describe("Cursor for pagination") },
  • The server.tool registration for the 'get_events' tool, including name, schema, handler, and description.
    server.tool( "get_events", { filter: z.string().optional().describe("Filter query for events"), page_size: z.number().min(1).max(100).optional().describe("Number of events per page (1-100)"), page_cursor: z.string().optional().describe("Cursor for pagination") }, async (params) => { try { const events = await klaviyoClient.get('/events/', params); return { content: [{ type: "text", text: JSON.stringify(events, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving events: ${error.message}` }], isError: true }; } }, { description: "Get events from Klaviyo" } );
  • src/server.js:35-35 (registration)
    Top-level call to registerEventTools, which includes the 'get_events' tool registration.
    registerEventTools(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