Skip to main content
Glama

get_list

Retrieve a specific email marketing list from Klaviyo using its unique ID to access subscriber data and manage audience segments.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the list to retrieve

Implementation Reference

  • Registers the 'get_list' MCP tool on the server with input schema, handler function, 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" } );
  • The handler function that implements the core logic of the 'get_list' tool: fetches the list by ID from Klaviyo API and returns JSON 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 }; } },
  • Zod input schema for the 'get_list' tool, requiring a string 'id' parameter.
    { id: z.string().describe("ID of the list to retrieve") },

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