Skip to main content
Glama

get_list

Retrieve specific customer lists using an ID from the Klaviyo MCP Server. This tool simplifies accessing and managing list data for targeted marketing automation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the list to retrieve

Implementation Reference

  • Handler function that fetches the specified Klaviyo list by ID using klaviyoClient.get and returns formatted response or error.
    async (params) => { try { const list = await klaviyoClient.get(`/lists/${params.id}/`); return { content: [{ type: "text", text: JSON.stringify(list, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving list: ${error.message}` }], isError: true }; } },
  • Input validation schema for the 'get_list' tool using Zod, requiring a string 'id'.
    { id: z.string().describe("ID of the list to retrieve") },
  • Complete registration of the 'get_list' MCP tool, including name, schema, inline handler, and description.
    "get_list", { id: z.string().describe("ID of the list to retrieve") }, async (params) => { try { const list = await klaviyoClient.get(`/lists/${params.id}/`); return { content: [{ type: "text", text: JSON.stringify(list, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving list: ${error.message}` }], isError: true }; } }, { description: "Get a specific list from Klaviyo" } );
  • src/server.js:33-33 (registration)
    Invocation of registerListTools in the main server setup, which registers the 'get_list' tool among others.
    registerListTools(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