delete_profile
Remove customer profiles from Klaviyo by specifying the profile ID with this tool, ensuring accurate data management and compliance with user preferences.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ID of the profile to delete |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"id": {
"description": "ID of the profile to delete",
"type": "string"
}
},
"required": [
"id"
],
"type": "object"
}
Implementation Reference
- src/tools/profiles.js:156-168 (handler)Handler function that executes the delete_profile tool by sending a DELETE request to the Klaviyo profiles endpoint using klaviyoClient.del.async (params) => { try { await klaviyoClient.del(`/profiles/${params.id}/`); return { content: [{ type: "text", text: "Profile deleted successfully" }] }; } catch (error) { return { content: [{ type: "text", text: `Error deleting profile: ${error.message}` }], isError: true }; } },
- src/tools/profiles.js:153-155 (schema)Input schema using Zod for the delete_profile tool, requiring a profile 'id' string.{ id: z.string().describe("ID of the profile to delete") },
- src/tools/profiles.js:151-170 (registration)Registration of the delete_profile tool on the MCP server, including name, schema, handler, and description.server.tool( "delete_profile", { id: z.string().describe("ID of the profile to delete") }, async (params) => { try { await klaviyoClient.del(`/profiles/${params.id}/`); return { content: [{ type: "text", text: "Profile deleted successfully" }] }; } catch (error) { return { content: [{ type: "text", text: `Error deleting profile: ${error.message}` }], isError: true }; } }, { description: "Delete a profile from Klaviyo" } );
- src/server.js:32-32 (registration)Invocation of registerProfileTools(server), which registers the delete_profile tool among others.registerProfileTools(server);