Skip to main content
Glama

get_campaign

Retrieve detailed campaign information by providing its unique ID using the Klaviyo MCP Server, enabling efficient campaign management and analysis.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the campaign to retrieve

Implementation Reference

  • The handler function for the 'get_campaign' tool. It fetches the specific campaign by ID using the Klaviyo client and returns the JSON data or an error response.
    async (params) => { try { const campaign = await klaviyoClient.get(`/campaigns/${params.id}/`); return { content: [{ type: "text", text: JSON.stringify(campaign, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving campaign: ${error.message}` }], isError: true }; } },
  • Zod schema for the input parameter 'id' of the campaign.
    id: z.string().describe("ID of the campaign to retrieve") },
  • The registration of the 'get_campaign' tool using server.tool, including name, schema, handler, and description.
    "get_campaign", { id: z.string().describe("ID of the campaign to retrieve") }, async (params) => { try { const campaign = await klaviyoClient.get(`/campaigns/${params.id}/`); return { content: [{ type: "text", text: JSON.stringify(campaign, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving campaign: ${error.message}` }], isError: true }; } }, { description: "Get a specific campaign from Klaviyo" } );

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