get_form
Retrieve detailed form data from the Klaviyo MCP Server by providing the specific form ID, enabling streamlined management of marketing automation workflows.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ID of the form to retrieve |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"id": {
"description": "ID of the form to retrieve",
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
}
Implementation Reference
- src/tools/forms.js:35-47 (handler)Handler function that executes the get_form tool: fetches the form by ID from Klaviyo API and returns JSON or error.async (params) => { try { const form = await klaviyoClient.get(`/forms/${params.id}/`); return { content: [{ type: "text", text: JSON.stringify(form, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving form: ${error.message}` }], isError: true }; } },
- src/tools/forms.js:32-34 (schema)Input schema for get_form tool using Zod: requires 'id' as string.{ id: z.string().describe("ID of the form to retrieve") },
- src/tools/forms.js:30-49 (registration)Direct registration of the get_form tool via server.tool, including schema, handler, and description.server.tool( "get_form", { id: z.string().describe("ID of the form to retrieve") }, async (params) => { try { const form = await klaviyoClient.get(`/forms/${params.id}/`); return { content: [{ type: "text", text: JSON.stringify(form, null, 2) }] }; } catch (error) { return { content: [{ type: "text", text: `Error retrieving form: ${error.message}` }], isError: true }; } }, { description: "Get a specific form from Klaviyo" } );
- src/server.js:46-46 (registration)Top-level registration call that invokes registerFormTools to set up the get_form tool among others.registerFormTools(server);