Skip to main content
Glama

get_campaign_message

Retrieve specific campaign message details by providing the campaign ID using this tool on the Klaviyo MCP Server, enabling efficient management of marketing automation workflows.

Input Schema

NameRequiredDescriptionDefault
idYesID of the campaign message to retrieve

Input Schema (JSON Schema)

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

Implementation Reference

  • Handler function that fetches the specific campaign message by ID from Klaviyo API, including template details, and returns formatted JSON response or error.
    async (params) => { try { const message = await klaviyoClient.get(`/campaign-messages/${params.id}/`, { include: "template" }); return { content: [{ type: "text", text: JSON.stringify(message, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving campaign message: ${error.message}` }], isError: true }; } },
  • Zod input schema defining the required 'id' parameter as a string with description.
    { id: z.string().describe("ID of the campaign message to retrieve") },
  • Full server.tool registration of the 'get_campaign_message' tool, including name, schema, handler, and description.
    server.tool( "get_campaign_message", { id: z.string().describe("ID of the campaign message to retrieve") }, async (params) => { try { const message = await klaviyoClient.get(`/campaign-messages/${params.id}/`, { include: "template" }); return { content: [{ type: "text", text: JSON.stringify(message, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving campaign message: ${error.message}` }], isError: true }; } }, { description: "Get a specific campaign message including template details" } );
  • src/server.js:37-37 (registration)
    High-level registration invocation that calls registerCampaignTools(server), which in turn registers the get_campaign_message tool.
    registerCampaignTools(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