Skip to main content
Glama

get_campaign_message

Retrieve specific campaign message details from Klaviyo using its unique ID to access content, settings, and performance data for marketing automation management.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the campaign message to retrieve

Implementation Reference

  • Handler function that fetches the campaign message from the Klaviyo API using the provided ID, includes template details, and returns JSON stringified 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 for the campaign message ID.
    { id: z.string().describe("ID of the campaign message to retrieve") },
  • Registration of the 'get_campaign_message' tool on the server using server.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)
    Call to registerCampaignTools function which registers the 'get_campaign_message' tool (and other campaign tools) on the main MCP server.
    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