Skip to main content
Glama

get_profile

Retrieve a specific customer profile from Klaviyo using its unique ID to access contact details and marketing data.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the profile to retrieve

Implementation Reference

  • Handler function that executes the get_profile tool: fetches profile data from Klaviyo API by ID and returns formatted JSON response or error.
    async (params) => { try { const profile = await klaviyoClient.get(`/profiles/${params.id}/`); return { content: [{ type: "text", text: JSON.stringify(profile, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving profile: ${error.message}` }], isError: true }; } },
  • Input schema validation using Zod for the get_profile tool, requiring a string 'id' parameter.
    { id: z.string().describe("ID of the profile to retrieve") },
  • Tool registration call within registerProfileTools function, defining name, schema, handler, and description for get_profile.
    server.tool( "get_profile", { id: z.string().describe("ID of the profile to retrieve") }, async (params) => { try { const profile = await klaviyoClient.get(`/profiles/${params.id}/`); return { content: [{ type: "text", text: JSON.stringify(profile, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving profile: ${error.message}` }], isError: true }; } }, { description: "Get a specific profile from Klaviyo" } );
  • src/server.js:32-32 (registration)
    Invocation of registerProfileTools to register all profile-related tools, including get_profile, on the MCP server.
    registerProfileTools(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