@buzzposter/mcp 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +7 -51
- package/dist/newsletter-studio.html +188 -1101
- package/dist/tools.d.ts +0 -2
- package/dist/tools.js +7 -51
- package/package.json +1 -20
package/dist/index.js
CHANGED
|
@@ -107,13 +107,6 @@ var BuzzPosterClient = class {
|
|
|
107
107
|
async deleteMedia(key) {
|
|
108
108
|
return this.request("DELETE", `/api/v1/media/${encodeURIComponent(key)}`);
|
|
109
109
|
}
|
|
110
|
-
// Newsletter Preview (no ESP required)
|
|
111
|
-
async createPreview(data) {
|
|
112
|
-
return this.request("POST", "/api/v1/newsletters/preview", data);
|
|
113
|
-
}
|
|
114
|
-
async updatePreview(id, data) {
|
|
115
|
-
return this.request("PUT", `/api/v1/newsletters/preview/${id}`, data);
|
|
116
|
-
}
|
|
117
110
|
// Newsletter
|
|
118
111
|
async listSubscribers(params) {
|
|
119
112
|
return this.request(
|
|
@@ -1147,8 +1140,8 @@ function registerNewsletterTools(server2, client2, options = {}) {
|
|
|
1147
1140
|
server2,
|
|
1148
1141
|
"create_newsletter",
|
|
1149
1142
|
{
|
|
1150
|
-
title: "Create Newsletter
|
|
1151
|
-
description: "
|
|
1143
|
+
title: "Create Newsletter Draft",
|
|
1144
|
+
description: "Push a newsletter to the user's ESP as a draft. Always call get_brand_voice first. Show an HTML preview to the user before calling this. Use table-based layouts, inline CSS only, 600px max width, email-safe fonts only (Arial, Helvetica, Georgia, Verdana), all images must use absolute URLs, keep under 102KB to avoid Gmail clipping. Optionally pass template_id to use an ESP-native template. Use list_esp_templates to discover available templates.",
|
|
1152
1145
|
inputSchema: {
|
|
1153
1146
|
subject: z5.string().describe("Email subject line"),
|
|
1154
1147
|
content: z5.string().describe("HTML content of the newsletter"),
|
|
@@ -1182,7 +1175,7 @@ function registerNewsletterTools(server2, client2, options = {}) {
|
|
|
1182
1175
|
previewText: args.preview_text
|
|
1183
1176
|
};
|
|
1184
1177
|
if (args.template_id) payload.templateId = args.template_id;
|
|
1185
|
-
const result = await client2.
|
|
1178
|
+
const result = await client2.createBroadcast(payload);
|
|
1186
1179
|
const response = {
|
|
1187
1180
|
...result,
|
|
1188
1181
|
subject: args.subject,
|
|
@@ -1198,15 +1191,15 @@ function registerNewsletterTools(server2, client2, options = {}) {
|
|
|
1198
1191
|
);
|
|
1199
1192
|
server2.tool(
|
|
1200
1193
|
"update_newsletter",
|
|
1201
|
-
"Update an existing newsletter
|
|
1194
|
+
"Update an existing newsletter draft.",
|
|
1202
1195
|
{
|
|
1203
|
-
|
|
1196
|
+
broadcast_id: z5.string().describe("The broadcast/newsletter ID to update"),
|
|
1204
1197
|
subject: z5.string().optional().describe("Updated subject line"),
|
|
1205
1198
|
content: z5.string().optional().describe("Updated HTML content"),
|
|
1206
1199
|
preview_text: z5.string().optional().describe("Updated preview text")
|
|
1207
1200
|
},
|
|
1208
1201
|
{
|
|
1209
|
-
title: "Update Newsletter
|
|
1202
|
+
title: "Update Newsletter Draft",
|
|
1210
1203
|
readOnlyHint: false,
|
|
1211
1204
|
destructiveHint: false,
|
|
1212
1205
|
idempotentHint: true,
|
|
@@ -1217,44 +1210,7 @@ function registerNewsletterTools(server2, client2, options = {}) {
|
|
|
1217
1210
|
if (args.subject) data.subject = args.subject;
|
|
1218
1211
|
if (args.content) data.content = args.content;
|
|
1219
1212
|
if (args.preview_text) data.previewText = args.preview_text;
|
|
1220
|
-
const result = await client2.
|
|
1221
|
-
const response = {
|
|
1222
|
-
...result,
|
|
1223
|
-
subject: args.subject,
|
|
1224
|
-
content: args.content,
|
|
1225
|
-
previewText: args.preview_text
|
|
1226
|
-
};
|
|
1227
|
-
return {
|
|
1228
|
-
content: [
|
|
1229
|
-
{ type: "text", text: JSON.stringify(response, null, 2) }
|
|
1230
|
-
]
|
|
1231
|
-
};
|
|
1232
|
-
}
|
|
1233
|
-
);
|
|
1234
|
-
server2.tool(
|
|
1235
|
-
"push_newsletter_to_esp",
|
|
1236
|
-
"Push a newsletter to the user's ESP as a draft broadcast. Requires ESP to be configured. Use create_newsletter first for preview, then push when the user is happy with the content.",
|
|
1237
|
-
{
|
|
1238
|
-
subject: z5.string().describe("Email subject line"),
|
|
1239
|
-
content: z5.string().describe("HTML content of the newsletter"),
|
|
1240
|
-
preview_text: z5.string().optional().describe("Preview text shown in email clients"),
|
|
1241
|
-
template_id: z5.string().optional().describe("ESP-native template ID")
|
|
1242
|
-
},
|
|
1243
|
-
{
|
|
1244
|
-
title: "Push Newsletter to ESP",
|
|
1245
|
-
readOnlyHint: false,
|
|
1246
|
-
destructiveHint: false,
|
|
1247
|
-
idempotentHint: false,
|
|
1248
|
-
openWorldHint: true
|
|
1249
|
-
},
|
|
1250
|
-
async (args) => {
|
|
1251
|
-
const payload = {
|
|
1252
|
-
subject: args.subject,
|
|
1253
|
-
content: args.content,
|
|
1254
|
-
previewText: args.preview_text
|
|
1255
|
-
};
|
|
1256
|
-
if (args.template_id) payload.templateId = args.template_id;
|
|
1257
|
-
const result = await client2.createBroadcast(payload);
|
|
1213
|
+
const result = await client2.updateBroadcast(args.broadcast_id, data);
|
|
1258
1214
|
const response = {
|
|
1259
1215
|
...result,
|
|
1260
1216
|
subject: args.subject,
|