get_flow
Retrieve a specific marketing automation flow from Klaviyo using its unique ID to access flow details and configuration.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ID of the flow to retrieve |
Implementation Reference
- src/tools/flows.js:35-47 (handler)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 }; } },
- src/tools/flows.js:32-34 (schema)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") },
- src/tools/flows.js:31-49 (registration)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);