Skip to main content
Glama

get_webhooks

Retrieve webhooks from the Klaviyo MCP Server with configurable pagination, specifying page size and cursor for efficient data handling and integration.

Input Schema

NameRequiredDescriptionDefault
page_cursorNoCursor for pagination
page_sizeNoNumber of webhooks per page (1-100)

Input Schema (JSON Schema)

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

Implementation Reference

  • Primary registration of the 'get_webhooks' tool using server.tool(), including inline schema, handler, and description.
    "get_webhooks", { page_size: z.number().min(1).max(100).optional().describe("Number of webhooks per page (1-100)"), page_cursor: z.string().optional().describe("Cursor for pagination") }, async (params) => { try { const webhooks = await klaviyoClient.get('/webhooks/', params); return { content: [{ type: "text", text: JSON.stringify(webhooks, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving webhooks: ${error.message}` }], isError: true }; } }, { description: "Get webhooks from Klaviyo" } );
  • The handler function that executes the tool logic: fetches webhooks from Klaviyo API using klaviyoClient.get and formats the response.
    async (params) => { try { const webhooks = await klaviyoClient.get('/webhooks/', params); return { content: [{ type: "text", text: JSON.stringify(webhooks, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving webhooks: ${error.message}` }], isError: true }; } },
  • Input schema using Zod for pagination parameters: page_size (optional, 1-100) and page_cursor (optional).
    page_size: z.number().min(1).max(100).optional().describe("Number of webhooks per page (1-100)"), page_cursor: z.string().optional().describe("Cursor for pagination") },
  • src/server.js:43-43 (registration)
    High-level registration call that invokes registerWebhookTools to add webhook tools, including get_webhooks, to the MCP server.
    registerWebhookTools(server);
  • src/server.js:14-14 (registration)
    Import of the registerWebhookTools function used to register webhook tools.
    import { registerWebhookTools } from './tools/webhooks.js';

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