Skip to main content
Glama

get_flow

Retrieve a specific marketing automation flow from Klaviyo using its unique ID to access flow details and configuration.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesID of the flow to retrieve

Implementation Reference

  • The handler function that implements the core logic of the 'get_flow' tool. It retrieves a specific flow by its ID from the Klaviyo API using klaviyoClient.get and returns the JSON response or an error message.
    async (params) => {
      try {
        const flow = await klaviyoClient.get(`/flows/${params.id}/`);
        return {
          content: [{ type: "text", text: JSON.stringify(flow, null, 2) }]
        };
      } catch (error) {
        return {
          content: [{ type: "text", text: `Error retrieving flow: ${error.message}` }],
          isError: true
        };
      }
    },
  • Zod schema defining the input parameters for the 'get_flow' tool: requires a string 'id' parameter.
    {
      id: z.string().describe("ID of the flow to retrieve")
    },
  • The server.tool call that registers the 'get_flow' tool, including name, input schema, handler function, and description.
      "get_flow",
      {
        id: z.string().describe("ID of the flow to retrieve")
      },
      async (params) => {
        try {
          const flow = await klaviyoClient.get(`/flows/${params.id}/`);
          return {
            content: [{ type: "text", text: JSON.stringify(flow, null, 2) }]
          };
        } catch (error) {
          return {
            content: [{ type: "text", text: `Error retrieving flow: ${error.message}` }],
            isError: true
          };
        }
      },
      { description: "Get a specific flow from Klaviyo" }
    );
  • src/server.js:39-39 (registration)
    High-level registration invocation of registerFlowTools(server), which internally registers the 'get_flow' tool.
    registerFlowTools(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