Skip to main content
Glama

delete_webhook

Remove a specified webhook from the Klaviyo MCP Server by providing its unique ID, ensuring efficient management of webhook integrations and configurations.

Input Schema

NameRequiredDescriptionDefault
idYesID of the webhook to delete

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "id": { "description": "ID of the webhook to delete", "type": "string" } }, "required": [ "id" ], "type": "object" }

Implementation Reference

  • The handler function for the 'delete_webhook' tool. It takes the webhook ID from params and calls the Klaviyo client's delete method on the webhooks endpoint.
    async (params) => { try { await klaviyoClient.del(`/webhooks/${params.id}/`); return { content: [{ type: "text", text: "Webhook deleted successfully" }] }; } catch (error) { return { content: [{ type: "text", text: `Error deleting webhook: ${error.message}` }], isError: true }; } },
  • Zod input schema for the 'delete_webhook' tool, requiring a string 'id' parameter.
    { id: z.string().describe("ID of the webhook to delete") },
  • Registration of the 'delete_webhook' tool using server.tool(), including name, schema, handler, and description.
    server.tool( "delete_webhook", { id: z.string().describe("ID of the webhook to delete") }, async (params) => { try { await klaviyoClient.del(`/webhooks/${params.id}/`); return { content: [{ type: "text", text: "Webhook deleted successfully" }] }; } catch (error) { return { content: [{ type: "text", text: `Error deleting webhook: ${error.message}` }], isError: true }; } }, { description: "Delete a webhook from Klaviyo" } );
  • src/server.js:43-43 (registration)
    Invocation of registerWebhookTools which registers the delete_webhook tool among others.
    registerWebhookTools(server);
  • The generic del function from the Klaviyo client used in the tool handler to perform the HTTP DELETE request.
    export async function del(endpoint, data, fallbackFn) { return executeWithRetry( () => { const config = data ? { data } : undefined; return client.delete(endpoint, config); }, 'DELETE', endpoint, data, fallbackFn ).then(response => { // For DELETE requests that return 204 No Content if (response === undefined) { return { success: true }; } return response; }); }

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