@buzzposter/mcp 0.3.4 → 0.3.6

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/tools.js CHANGED
@@ -1378,16 +1378,267 @@ This will permanently delete this media file. Call this tool again with confirme
1378
1378
  );
1379
1379
  }
1380
1380
 
1381
- // src/tools/rss.ts
1381
+ // src/tools/newsletter.ts
1382
1382
  import { z as z4 } from "zod";
1383
+ function registerNewsletterTools(server, client, options = {}) {
1384
+ server.tool(
1385
+ "manage_newsletters",
1386
+ "Create, update, send, schedule, or list newsletters.\n\nIMPORTANT \u2014 Template-based creation:\n1. Call get_context with include_newsletter_template=true to get the user's template with section IDs\n2. Call create with template_id + sections array (NOT raw content HTML)\n3. The server assembles styled HTML from the template design + your section content\n\nOnly use raw content HTML if the user has no templates or explicitly asks for custom HTML.",
1387
+ {
1388
+ action: z4.enum(["create", "update", "send", "schedule", "list"]),
1389
+ broadcast_id: z4.string().optional().describe("Newsletter ID (update/send/schedule)"),
1390
+ subject: z4.string().optional().describe("Subject line (create/update, also search keyword for list)"),
1391
+ content: z4.string().optional().describe("Raw HTML content (create/update). Only use when no template is available or user explicitly requests custom HTML. When a template exists, use sections instead."),
1392
+ sections: z4.array(z4.object({
1393
+ section_id: z4.string().describe("Section ID from the template's section config"),
1394
+ heading: z4.string().optional(),
1395
+ body: z4.string().optional().describe("Section body (basic HTML OK: p, strong, em, a, ul/li)"),
1396
+ image_url: z4.string().optional(),
1397
+ image_alt: z4.string().optional(),
1398
+ cta_text: z4.string().optional(),
1399
+ cta_url: z4.string().optional(),
1400
+ quote: z4.string().optional(),
1401
+ quote_attribution: z4.string().optional()
1402
+ })).optional().describe("Structured section content matching the template's section IDs. PREFERRED over raw content \u2014 preserves the user's template design and style."),
1403
+ preview_text: z4.string().optional().describe("Preview text (create/update)"),
1404
+ template_id: z4.string().optional().describe("BuzzPoster template ID (from newsletter_templates). Used with sections to auto-generate HTML."),
1405
+ esp_template_id: z4.string().optional().describe("ESP-native template ID (Kit: email_template_id, Beehiiv: post_template_id). Distinct from template_id which references BuzzPoster templates."),
1406
+ scheduled_for: z4.string().optional().describe("ISO datetime (schedule)"),
1407
+ page: z4.string().optional().describe("Page number (list)"),
1408
+ status: z4.string().optional().describe("Filter status (list)"),
1409
+ from_date: z4.string().optional().describe("ISO date from (list)"),
1410
+ to_date: z4.string().optional().describe("ISO date to (list)"),
1411
+ confirmed: z4.boolean().default(false).describe("Confirm action (send/schedule)")
1412
+ },
1413
+ {
1414
+ title: "Manage Newsletters",
1415
+ readOnlyHint: false,
1416
+ destructiveHint: true,
1417
+ idempotentHint: false,
1418
+ openWorldHint: true
1419
+ },
1420
+ async (args) => {
1421
+ if (args.action === "create") {
1422
+ if (!args.subject) {
1423
+ return { content: [{ type: "text", text: "subject is required for create." }], isError: true };
1424
+ }
1425
+ if (!args.content && !args.sections) {
1426
+ return { content: [{ type: "text", text: "content or sections is required for create." }], isError: true };
1427
+ }
1428
+ const payload = {
1429
+ subject: args.subject,
1430
+ previewText: args.preview_text
1431
+ };
1432
+ if (args.content) payload.content = args.content;
1433
+ if (args.sections) payload.sections = args.sections;
1434
+ if (args.template_id) payload.templateId = args.template_id;
1435
+ if (args.esp_template_id) payload.espTemplateId = args.esp_template_id;
1436
+ const result = await client.createBroadcast(payload);
1437
+ const r = result;
1438
+ const response = {
1439
+ id: r.id,
1440
+ subject: args.subject,
1441
+ content: args.content ?? r.renderedHtml ?? void 0,
1442
+ previewText: args.preview_text,
1443
+ previewUrl: r.previewUrl,
1444
+ editUrl: r.editUrl,
1445
+ status: "draft"
1446
+ };
1447
+ return {
1448
+ content: [
1449
+ { type: "text", text: JSON.stringify(response) }
1450
+ ]
1451
+ };
1452
+ }
1453
+ if (args.action === "update") {
1454
+ if (!args.broadcast_id) {
1455
+ return { content: [{ type: "text", text: "broadcast_id is required for update." }], isError: true };
1456
+ }
1457
+ const data = {};
1458
+ if (args.subject) data.subject = args.subject;
1459
+ if (args.content) data.content = args.content;
1460
+ if (args.preview_text) data.previewText = args.preview_text;
1461
+ const result = await client.updateBroadcast(args.broadcast_id, data);
1462
+ const r = result;
1463
+ const response = {
1464
+ id: args.broadcast_id,
1465
+ subject: args.subject ?? r.subject,
1466
+ content: args.content ?? r.renderedHtml ?? void 0,
1467
+ previewText: args.preview_text,
1468
+ previewUrl: r.previewUrl,
1469
+ editUrl: r.editUrl,
1470
+ status: r.status ?? "draft"
1471
+ };
1472
+ return {
1473
+ content: [
1474
+ { type: "text", text: JSON.stringify(response) }
1475
+ ]
1476
+ };
1477
+ }
1478
+ if (args.action === "send") {
1479
+ if (!options.allowDirectSend) {
1480
+ return {
1481
+ content: [{
1482
+ type: "text",
1483
+ text: "Direct send is disabled. Enable it in your BuzzPoster dashboard settings under Publishing Rules."
1484
+ }],
1485
+ isError: true
1486
+ };
1487
+ }
1488
+ if (!args.broadcast_id) {
1489
+ return { content: [{ type: "text", text: "broadcast_id is required for send." }], isError: true };
1490
+ }
1491
+ if (args.confirmed !== true) {
1492
+ let subscriberCount = "unknown";
1493
+ let rulesText = "";
1494
+ try {
1495
+ const subData = await client.listSubscribers({ perPage: "1" });
1496
+ subscriberCount = String(subData?.totalCount ?? subData?.total ?? subData?.subscribers?.length ?? "unknown");
1497
+ } catch {
1498
+ }
1499
+ try {
1500
+ const rules = await client.getPublishingRules();
1501
+ rulesText = `
1502
+ ### Safety Checks
1503
+ `;
1504
+ rulesText += `- Double confirmation required: ${rules.requireDoubleConfirmNewsletter ? "**yes**" : "no"}
1505
+ `;
1506
+ rulesText += `- Immediate send allowed: ${rules.allowImmediateSend ? "yes" : "**no**"}
1507
+ `;
1508
+ if (rules.requiredDisclaimer) {
1509
+ rulesText += `- Required disclaimer: "${rules.requiredDisclaimer}"
1510
+ `;
1511
+ }
1512
+ } catch {
1513
+ }
1514
+ let espText = "";
1515
+ try {
1516
+ const account = await client.getAccount();
1517
+ espText = account?.espProvider ? `**ESP:** ${account.espProvider}
1518
+ ` : "";
1519
+ } catch {
1520
+ }
1521
+ const preview = `## Send Newsletter Confirmation
1522
+
1523
+ **Broadcast ID:** ${args.broadcast_id}
1524
+ **Subscribers:** ~${subscriberCount} recipients
1525
+ ` + espText + rulesText + `
1526
+ **This action cannot be undone.** Once sent, the email goes to every subscriber.
1527
+
1528
+ Call this tool again with confirmed=true to send.`;
1529
+ return { content: [{ type: "text", text: preview }] };
1530
+ }
1531
+ await client.sendBroadcast(args.broadcast_id);
1532
+ return {
1533
+ content: [{ type: "text", text: "Newsletter sent successfully." }]
1534
+ };
1535
+ }
1536
+ if (args.action === "schedule") {
1537
+ if (!args.broadcast_id) {
1538
+ return { content: [{ type: "text", text: "broadcast_id is required for schedule." }], isError: true };
1539
+ }
1540
+ if (!args.scheduled_for) {
1541
+ return { content: [{ type: "text", text: "scheduled_for is required for schedule." }], isError: true };
1542
+ }
1543
+ if (args.confirmed !== true) {
1544
+ let subscriberCount = "unknown";
1545
+ let rulesText = "";
1546
+ try {
1547
+ const subData = await client.listSubscribers({ perPage: "1" });
1548
+ subscriberCount = String(
1549
+ subData?.totalCount ?? subData?.total ?? subData?.subscribers?.length ?? "unknown"
1550
+ );
1551
+ } catch {
1552
+ }
1553
+ try {
1554
+ const rules = await client.getPublishingRules();
1555
+ rulesText = `
1556
+ ### Safety Checks
1557
+ `;
1558
+ rulesText += `- Double confirmation required: ${rules.requireDoubleConfirmNewsletter ? "**yes**" : "no"}
1559
+ `;
1560
+ rulesText += `- Immediate send allowed: ${rules.allowImmediateSend ? "yes" : "**no**"}
1561
+ `;
1562
+ if (rules.requiredDisclaimer) {
1563
+ rulesText += `- Required disclaimer: "${rules.requiredDisclaimer}"
1564
+ `;
1565
+ }
1566
+ } catch {
1567
+ }
1568
+ let espText = "";
1569
+ try {
1570
+ const account = await client.getAccount();
1571
+ espText = account?.espProvider ? `**ESP:** ${account.espProvider}
1572
+ ` : "";
1573
+ } catch {
1574
+ }
1575
+ const preview = `## Schedule Newsletter Confirmation
1576
+
1577
+ **Broadcast ID:** ${args.broadcast_id}
1578
+ **Scheduled for:** ${args.scheduled_for}
1579
+ **Subscribers:** ~${subscriberCount} recipients
1580
+ ` + espText + rulesText + `
1581
+ Scheduling can typically be cancelled or rescheduled later, but please verify the time is correct.
1582
+
1583
+ Call this tool again with confirmed=true to schedule.`;
1584
+ return { content: [{ type: "text", text: preview }] };
1585
+ }
1586
+ await client.scheduleBroadcast(args.broadcast_id, {
1587
+ scheduledFor: args.scheduled_for
1588
+ });
1589
+ return {
1590
+ content: [{
1591
+ type: "text",
1592
+ text: `Newsletter scheduled successfully for ${args.scheduled_for}.`
1593
+ }]
1594
+ };
1595
+ }
1596
+ if (args.action === "list") {
1597
+ const params = {};
1598
+ if (args.page) params.page = args.page;
1599
+ if (args.status) params.status = args.status;
1600
+ if (args.from_date) params.fromDate = args.from_date;
1601
+ if (args.to_date) params.toDate = args.to_date;
1602
+ if (args.subject) params.subject = args.subject;
1603
+ const result = await client.listBroadcasts(params);
1604
+ const broadcasts = result?.broadcasts ?? [];
1605
+ if (broadcasts.length === 0) {
1606
+ return {
1607
+ content: [{ type: "text", text: "No newsletters found matching your filters." }]
1608
+ };
1609
+ }
1610
+ let text = `## Newsletters (${broadcasts.length}`;
1611
+ if (result?.totalCount != null) text += ` of ${result.totalCount}`;
1612
+ text += ")\n\n";
1613
+ for (const b of broadcasts) {
1614
+ const status = (b.status ?? "unknown").toUpperCase();
1615
+ const date = b.sentAt ? new Date(b.sentAt).toLocaleString() : b.createdAt ? new Date(b.createdAt).toLocaleString() : "";
1616
+ text += `- **[${status}]** "${b.subject ?? "(no subject)"}"
1617
+ `;
1618
+ text += ` ID: ${b.id}`;
1619
+ if (date) text += ` | ${b.sentAt ? "Sent" : "Created"}: ${date}`;
1620
+ text += "\n";
1621
+ }
1622
+ return { content: [{ type: "text", text }] };
1623
+ }
1624
+ return {
1625
+ content: [{ type: "text", text: `Unknown action: ${args.action}` }],
1626
+ isError: true
1627
+ };
1628
+ }
1629
+ );
1630
+ }
1631
+
1632
+ // src/tools/rss.ts
1633
+ import { z as z5 } from "zod";
1383
1634
  function registerRssTools(server, client) {
1384
1635
  server.tool(
1385
1636
  "rss",
1386
1637
  "Fetch RSS/Atom feed entries or extract full article content from a URL. Returns og_image when available.",
1387
1638
  {
1388
- action: z4.enum(["fetch_feed", "fetch_article"]),
1389
- url: z4.string().describe("Feed or article URL"),
1390
- limit: z4.number().optional().describe("Max feed entries (fetch_feed, default 100)")
1639
+ action: z5.enum(["fetch_feed", "fetch_article"]),
1640
+ url: z5.string().describe("Feed or article URL"),
1641
+ limit: z5.number().optional().describe("Max feed entries (fetch_feed, default 100)")
1391
1642
  },
1392
1643
  {
1393
1644
  title: "RSS Tools",
@@ -1457,13 +1708,13 @@ function registerRssTools(server, client) {
1457
1708
  }
1458
1709
 
1459
1710
  // src/tools/account.ts
1460
- import { z as z5 } from "zod";
1711
+ import { z as z6 } from "zod";
1461
1712
  function registerAccountTools(server, client) {
1462
1713
  server.tool(
1463
1714
  "manage_account",
1464
1715
  "Get account details/connections or check health status of connected social accounts.",
1465
1716
  {
1466
- action: z5.enum(["get_details", "check_health"])
1717
+ action: z6.enum(["get_details", "check_health"])
1467
1718
  },
1468
1719
  {
1469
1720
  title: "Manage Account",
@@ -1562,21 +1813,21 @@ ${lines.join("\n")}`;
1562
1813
  }
1563
1814
 
1564
1815
  // src/tools/brand-voice.ts
1565
- import { z as z6 } from "zod";
1816
+ import { z as z7 } from "zod";
1566
1817
  function registerBrandVoiceTools(server, client) {
1567
1818
  server.tool(
1568
1819
  "manage_brand_voice",
1569
1820
  "Get, create, or update the brand voice profile. Call with action 'get' before creating content.",
1570
1821
  {
1571
- action: z6.enum(["get", "create", "update"]),
1572
- name: z6.string().max(80).optional().describe("Voice name (create required, update optional)"),
1573
- description: z6.string().max(2e3).optional().describe("Voice description (create/update)"),
1574
- dos: z6.array(z6.string().max(200)).max(15).optional().describe("Writing rules to follow (create/update)"),
1575
- donts: z6.array(z6.string().max(200)).max(15).optional().describe("Things to avoid (create/update)"),
1576
- platform_rules: z6.record(z6.string().max(300)).optional().describe("Per-platform guidelines (create/update)"),
1577
- platform_examples: z6.record(z6.array(z6.string().max(500)).max(3)).optional().describe("Per-platform examples (create/update)"),
1578
- example_posts: z6.array(z6.string().max(500)).max(5).optional().describe("Example posts (create/update)"),
1579
- confirmed: z6.boolean().default(false).describe("Confirm write (create/update)")
1822
+ action: z7.enum(["get", "create", "update"]),
1823
+ name: z7.string().max(80).optional().describe("Voice name (create required, update optional)"),
1824
+ description: z7.string().max(2e3).optional().describe("Voice description (create/update)"),
1825
+ dos: z7.array(z7.string().max(200)).max(15).optional().describe("Writing rules to follow (create/update)"),
1826
+ donts: z7.array(z7.string().max(200)).max(15).optional().describe("Things to avoid (create/update)"),
1827
+ platform_rules: z7.record(z7.string().max(300)).optional().describe("Per-platform guidelines (create/update)"),
1828
+ platform_examples: z7.record(z7.array(z7.string().max(500)).max(3)).optional().describe("Per-platform examples (create/update)"),
1829
+ example_posts: z7.array(z7.string().max(500)).max(5).optional().describe("Example posts (create/update)"),
1830
+ confirmed: z7.boolean().default(false).describe("Confirm write (create/update)")
1580
1831
  },
1581
1832
  {
1582
1833
  title: "Manage Brand Voice",
@@ -1748,7 +1999,7 @@ function registerBrandVoiceTools(server, client) {
1748
1999
  }
1749
2000
 
1750
2001
  // src/tools/audience.ts
1751
- import { z as z7 } from "zod";
2002
+ import { z as z8 } from "zod";
1752
2003
  function formatAudience(audience) {
1753
2004
  const lines = [];
1754
2005
  lines.push(`## ${audience.name}${audience.isDefault ? " (default)" : ""}`);
@@ -1795,17 +2046,17 @@ function registerAudienceTools(server, client) {
1795
2046
  "manage_audiences",
1796
2047
  "List, get, create, update, or delete audience profiles.",
1797
2048
  {
1798
- action: z7.enum(["list", "get", "create", "update", "delete"]),
1799
- name: z7.string().max(100).optional().describe("Audience name (get/create/update/delete)"),
1800
- description: z7.string().max(500).optional().describe("Description (create/update)"),
1801
- demographics: z7.string().max(500).optional().describe("Demographics (create/update)"),
1802
- pain_points: z7.array(z7.string().max(200)).max(10).optional().describe("Pain points, full list (create/update)"),
1803
- motivations: z7.array(z7.string().max(200)).max(10).optional().describe("Motivations, full list (create/update)"),
1804
- preferred_platforms: z7.array(z7.string()).max(6).optional().describe("Active platforms, full list (create/update)"),
1805
- tone_notes: z7.string().max(500).optional().describe("Tone guidance (create/update)"),
1806
- content_preferences: z7.string().max(500).optional().describe("Content preferences (create/update)"),
1807
- is_default: z7.boolean().optional().describe("Set as default (create/update)"),
1808
- confirmed: z7.boolean().default(false).describe("Confirm write (create/update/delete)")
2049
+ action: z8.enum(["list", "get", "create", "update", "delete"]),
2050
+ name: z8.string().max(100).optional().describe("Audience name (get/create/update/delete)"),
2051
+ description: z8.string().max(500).optional().describe("Description (create/update)"),
2052
+ demographics: z8.string().max(500).optional().describe("Demographics (create/update)"),
2053
+ pain_points: z8.array(z8.string().max(200)).max(10).optional().describe("Pain points, full list (create/update)"),
2054
+ motivations: z8.array(z8.string().max(200)).max(10).optional().describe("Motivations, full list (create/update)"),
2055
+ preferred_platforms: z8.array(z8.string()).max(6).optional().describe("Active platforms, full list (create/update)"),
2056
+ tone_notes: z8.string().max(500).optional().describe("Tone guidance (create/update)"),
2057
+ content_preferences: z8.string().max(500).optional().describe("Content preferences (create/update)"),
2058
+ is_default: z8.boolean().optional().describe("Set as default (create/update)"),
2059
+ confirmed: z8.boolean().default(false).describe("Confirm write (create/update/delete)")
1809
2060
  },
1810
2061
  {
1811
2062
  title: "Manage Audiences",
@@ -2000,7 +2251,7 @@ Call again with confirmed=true to delete.` }]
2000
2251
  }
2001
2252
 
2002
2253
  // src/tools/calendar.ts
2003
- import { z as z8 } from "zod";
2254
+ import { z as z9 } from "zod";
2004
2255
  import { registerAppTool as registerAppTool3 } from "@modelcontextprotocol/ext-apps/server";
2005
2256
  var BASE_CHAR_LIMITS2 = {
2006
2257
  twitter: 280,
@@ -2021,15 +2272,15 @@ function registerCalendarTools(server, client) {
2021
2272
  title: "Manage Content Calendar",
2022
2273
  description: "View content calendar, add posts to queue, or view queue schedule.",
2023
2274
  inputSchema: {
2024
- action: z8.enum(["get_calendar", "schedule_to_queue", "get_queue"]),
2025
- from: z8.string().optional().describe("ISO date from (get_calendar)"),
2026
- to: z8.string().optional().describe("ISO date to (get_calendar)"),
2027
- status: z8.string().optional().describe("Filter status (get_calendar)"),
2028
- type: z8.string().optional().describe("Filter type: social_post or newsletter (get_calendar)"),
2029
- content: z8.string().optional().describe("Post text (schedule_to_queue)"),
2030
- platforms: z8.array(z8.string()).optional().describe("Target platforms (schedule_to_queue)"),
2031
- media_urls: z8.array(z8.string()).optional().describe("Media URLs (schedule_to_queue)"),
2032
- confirmed: z8.boolean().default(false).describe("Confirm scheduling (schedule_to_queue)")
2275
+ action: z9.enum(["get_calendar", "schedule_to_queue", "get_queue"]),
2276
+ from: z9.string().optional().describe("ISO date from (get_calendar)"),
2277
+ to: z9.string().optional().describe("ISO date to (get_calendar)"),
2278
+ status: z9.string().optional().describe("Filter status (get_calendar)"),
2279
+ type: z9.string().optional().describe("Filter type: social_post or newsletter (get_calendar)"),
2280
+ content: z9.string().optional().describe("Post text (schedule_to_queue)"),
2281
+ platforms: z9.array(z9.string()).optional().describe("Target platforms (schedule_to_queue)"),
2282
+ media_urls: z9.array(z9.string()).optional().describe("Media URLs (schedule_to_queue)"),
2283
+ confirmed: z9.boolean().default(false).describe("Confirm scheduling (schedule_to_queue)")
2033
2284
  },
2034
2285
  annotations: {
2035
2286
  readOnlyHint: false,
@@ -2256,7 +2507,7 @@ Next slot: ${slotDate2.toLocaleString()} (${dayNames[slotDate2.getDay()]})
2256
2507
  }
2257
2508
 
2258
2509
  // src/tools/sources.ts
2259
- import { z as z9 } from "zod";
2510
+ import { z as z10 } from "zod";
2260
2511
  var TYPE_LABELS = {
2261
2512
  feed: "RSS Feed",
2262
2513
  website: "Website",
@@ -2282,17 +2533,17 @@ function registerSourceTools(server, client) {
2282
2533
  "manage_sources",
2283
2534
  "List, add, update, or remove content sources (RSS feeds, websites, channels). Max 10 sources.",
2284
2535
  {
2285
- action: z9.enum(["list", "add", "update", "remove"]),
2286
- source_id: z9.number().optional().describe("Source ID (update/remove)"),
2287
- name: z9.string().optional().describe("Display name (add/update)"),
2288
- url: z9.string().optional().describe("Source URL (add/update)"),
2289
- type: z9.enum(SOURCE_TYPES).optional().describe("Source type (add/update)"),
2290
- category: z9.string().optional().describe("Category for organization (add/update)"),
2291
- tags: z9.array(z9.string()).optional().describe("Tags for filtering (add/update)"),
2292
- notes: z9.string().optional().describe("Notes about the source (add/update)"),
2293
- searchQuery: z9.string().optional().describe("Search keyword for 'search' type (add/update)"),
2294
- isActive: z9.boolean().optional().describe("Active status (update)"),
2295
- confirmed: z9.boolean().default(false).describe("Confirm removal (remove)")
2536
+ action: z10.enum(["list", "add", "update", "remove"]),
2537
+ source_id: z10.number().optional().describe("Source ID (update/remove)"),
2538
+ name: z10.string().optional().describe("Display name (add/update)"),
2539
+ url: z10.string().optional().describe("Source URL (add/update)"),
2540
+ type: z10.enum(SOURCE_TYPES).optional().describe("Source type (add/update)"),
2541
+ category: z10.string().optional().describe("Category for organization (add/update)"),
2542
+ tags: z10.array(z10.string()).optional().describe("Tags for filtering (add/update)"),
2543
+ notes: z10.string().optional().describe("Notes about the source (add/update)"),
2544
+ searchQuery: z10.string().optional().describe("Search keyword for 'search' type (add/update)"),
2545
+ isActive: z10.boolean().optional().describe("Active status (update)"),
2546
+ confirmed: z10.boolean().default(false).describe("Confirm removal (remove)")
2296
2547
  },
2297
2548
  {
2298
2549
  title: "Manage Content Sources",
@@ -2398,7 +2649,7 @@ This will permanently remove this content source. Call again with confirmed=true
2398
2649
  }
2399
2650
 
2400
2651
  // src/tools/wordpress.ts
2401
- import { z as z10 } from "zod";
2652
+ import { z as z11 } from "zod";
2402
2653
  import { registerAppTool as registerAppTool4 } from "@modelcontextprotocol/ext-apps/server";
2403
2654
  function mapWpStatus(wpStatus) {
2404
2655
  switch (wpStatus) {
@@ -2447,26 +2698,26 @@ function registerWordPressTools(server, client) {
2447
2698
  title: "Manage WordPress",
2448
2699
  description: "CRUD WordPress posts/pages, upload media, list categories/tags.",
2449
2700
  inputSchema: {
2450
- action: z10.enum(["create_post", "update_post", "publish_post", "list_posts", "get_post", "create_page", "delete_post", "upload_media", "list_categories", "list_tags"]),
2451
- post_id: z10.number().optional().describe("WordPress post/page ID (update/publish/get/delete)"),
2452
- title: z10.string().optional().describe("Title (create_post/create_page/update)"),
2453
- content: z10.string().optional().describe("HTML content (create_post/create_page/update)"),
2454
- wp_status: z10.enum(["draft", "publish", "pending", "private", "future"]).optional().describe("Post status (create_post/create_page/update, default draft)"),
2455
- categories: z10.array(z10.number()).optional().describe("Category IDs (create_post/update)"),
2456
- tags: z10.array(z10.number()).optional().describe("Tag IDs (create_post/update)"),
2457
- featured_media: z10.number().optional().describe("Featured image ID (create_post/create_page/update)"),
2458
- excerpt: z10.string().optional().describe("Excerpt (create_post/create_page/update)"),
2459
- date: z10.string().optional().describe("ISO 8601 date (create_post/update, required for 'future')"),
2460
- slug: z10.string().optional().describe("URL slug (create_post/create_page/update)"),
2461
- per_page: z10.string().optional().describe("Results per page (list_posts)"),
2462
- page: z10.string().optional().describe("Page number (list_posts)"),
2463
- search: z10.string().optional().describe("Search keyword (list_posts)"),
2464
- filter_categories: z10.string().optional().describe("Filter by category IDs, comma-separated (list_posts)"),
2465
- filter_tags: z10.string().optional().describe("Filter by tag IDs, comma-separated (list_posts)"),
2466
- force: z10.boolean().default(false).describe("Permanent delete instead of trash (delete_post)"),
2467
- url: z10.string().optional().describe("Public image URL (upload_media)"),
2468
- filename: z10.string().optional().describe("Filename for upload (upload_media)"),
2469
- confirmed: z10.boolean().default(false).describe("Confirm action (create non-draft/publish/delete)")
2701
+ action: z11.enum(["create_post", "update_post", "publish_post", "list_posts", "get_post", "create_page", "delete_post", "upload_media", "list_categories", "list_tags"]),
2702
+ post_id: z11.number().optional().describe("WordPress post/page ID (update/publish/get/delete)"),
2703
+ title: z11.string().optional().describe("Title (create_post/create_page/update)"),
2704
+ content: z11.string().optional().describe("HTML content (create_post/create_page/update)"),
2705
+ wp_status: z11.enum(["draft", "publish", "pending", "private", "future"]).optional().describe("Post status (create_post/create_page/update, default draft)"),
2706
+ categories: z11.array(z11.number()).optional().describe("Category IDs (create_post/update)"),
2707
+ tags: z11.array(z11.number()).optional().describe("Tag IDs (create_post/update)"),
2708
+ featured_media: z11.number().optional().describe("Featured image ID (create_post/create_page/update)"),
2709
+ excerpt: z11.string().optional().describe("Excerpt (create_post/create_page/update)"),
2710
+ date: z11.string().optional().describe("ISO 8601 date (create_post/update, required for 'future')"),
2711
+ slug: z11.string().optional().describe("URL slug (create_post/create_page/update)"),
2712
+ per_page: z11.string().optional().describe("Results per page (list_posts)"),
2713
+ page: z11.string().optional().describe("Page number (list_posts)"),
2714
+ search: z11.string().optional().describe("Search keyword (list_posts)"),
2715
+ filter_categories: z11.string().optional().describe("Filter by category IDs, comma-separated (list_posts)"),
2716
+ filter_tags: z11.string().optional().describe("Filter by tag IDs, comma-separated (list_posts)"),
2717
+ force: z11.boolean().default(false).describe("Permanent delete instead of trash (delete_post)"),
2718
+ url: z11.string().optional().describe("Public image URL (upload_media)"),
2719
+ filename: z11.string().optional().describe("Filename for upload (upload_media)"),
2720
+ confirmed: z11.boolean().default(false).describe("Confirm action (create non-draft/publish/delete)")
2470
2721
  },
2471
2722
  annotations: {
2472
2723
  readOnlyHint: false,
@@ -2850,7 +3101,7 @@ ${args.force ? "WARNING: This will permanently delete the post and cannot be und
2850
3101
  }
2851
3102
 
2852
3103
  // src/tools/ghost.ts
2853
- import { z as z11 } from "zod";
3104
+ import { z as z12 } from "zod";
2854
3105
  import { registerAppTool as registerAppTool5 } from "@modelcontextprotocol/ext-apps/server";
2855
3106
  function mapGhostStatus(ghostStatus) {
2856
3107
  switch (ghostStatus) {
@@ -2889,22 +3140,22 @@ function registerGhostTools(server, client) {
2889
3140
  title: "Manage Ghost",
2890
3141
  description: "CRUD Ghost posts, send newsletters, list members/newsletters.",
2891
3142
  inputSchema: {
2892
- action: z11.enum(["create", "update", "publish", "list", "get", "send_newsletter", "list_members", "list_newsletters"]),
2893
- post_id: z11.string().optional().describe("Ghost post ID (update/publish/get/send_newsletter)"),
2894
- title: z11.string().optional().describe("Post title (create/update)"),
2895
- html: z11.string().optional().describe("HTML content (create/update)"),
2896
- status: z11.enum(["draft", "published", "scheduled"]).optional().describe("Post status (create/update, default draft)"),
2897
- tags: z11.array(z11.string()).optional().describe("Tag names (create/update)"),
2898
- featured: z11.boolean().optional().describe("Featured flag (create/update)"),
2899
- custom_excerpt: z11.string().optional().describe("Custom excerpt (create/update)"),
2900
- feature_image: z11.string().optional().describe("Feature image URL (create/update)"),
2901
- updated_at: z11.string().optional().describe("Collision detection timestamp (update/publish/send_newsletter)"),
2902
- newsletter_id: z11.string().optional().describe("Newsletter ID (send_newsletter)"),
2903
- email_only: z11.boolean().default(false).describe("Email only, no publish (send_newsletter)"),
2904
- limit: z11.string().optional().describe("Results per page (list/list_members)"),
2905
- page: z11.string().optional().describe("Page number (list/list_members)"),
2906
- filter: z11.string().optional().describe("NQL filter (list_members)"),
2907
- confirmed: z11.boolean().default(false).describe("Confirm action (create non-draft/publish/send_newsletter)")
3143
+ action: z12.enum(["create", "update", "publish", "list", "get", "send_newsletter", "list_members", "list_newsletters"]),
3144
+ post_id: z12.string().optional().describe("Ghost post ID (update/publish/get/send_newsletter)"),
3145
+ title: z12.string().optional().describe("Post title (create/update)"),
3146
+ html: z12.string().optional().describe("HTML content (create/update)"),
3147
+ status: z12.enum(["draft", "published", "scheduled"]).optional().describe("Post status (create/update, default draft)"),
3148
+ tags: z12.array(z12.string()).optional().describe("Tag names (create/update)"),
3149
+ featured: z12.boolean().optional().describe("Featured flag (create/update)"),
3150
+ custom_excerpt: z12.string().optional().describe("Custom excerpt (create/update)"),
3151
+ feature_image: z12.string().optional().describe("Feature image URL (create/update)"),
3152
+ updated_at: z12.string().optional().describe("Collision detection timestamp (update/publish/send_newsletter)"),
3153
+ newsletter_id: z12.string().optional().describe("Newsletter ID (send_newsletter)"),
3154
+ email_only: z12.boolean().default(false).describe("Email only, no publish (send_newsletter)"),
3155
+ limit: z12.string().optional().describe("Results per page (list/list_members)"),
3156
+ page: z12.string().optional().describe("Page number (list/list_members)"),
3157
+ filter: z12.string().optional().describe("NQL filter (list_members)"),
3158
+ confirmed: z12.boolean().default(false).describe("Confirm action (create non-draft/publish/send_newsletter)")
2908
3159
  },
2909
3160
  annotations: {
2910
3161
  readOnlyHint: false,
@@ -3278,7 +3529,7 @@ Call this tool again with confirmed=true to send.`;
3278
3529
  }
3279
3530
 
3280
3531
  // src/tools/image-templates.ts
3281
- import { z as z12 } from "zod";
3532
+ import { z as z13 } from "zod";
3282
3533
  import {
3283
3534
  registerAppResource as registerAppResource3,
3284
3535
  registerAppTool as registerAppTool6,
@@ -3317,13 +3568,13 @@ function registerImageTemplateTools(server, client) {
3317
3568
  title: "Manage Images",
3318
3569
  description: "Generate branded images, list templates, or list formats/dimensions.",
3319
3570
  inputSchema: {
3320
- action: z12.enum(["generate", "list_templates", "list_formats"]),
3321
- template_id: z12.string().optional().describe("Image template ID, omit for default (generate)"),
3322
- article_image_url: z12.string().optional().describe("Background image URL (generate)"),
3323
- headline: z12.string().optional().describe("Headline text overlay (generate)"),
3324
- summary: z12.string().optional().describe("Summary text below headline (generate)"),
3325
- formats: z12.array(z12.string()).optional().describe("Output formats: square, portrait, landscape, wide, story (generate)"),
3326
- platforms: z12.array(z12.string()).optional().describe("Platform shortcuts: instagram, facebook, linkedin, twitter (generate)")
3571
+ action: z13.enum(["generate", "list_templates", "list_formats"]),
3572
+ template_id: z13.string().optional().describe("Image template ID, omit for default (generate)"),
3573
+ article_image_url: z13.string().optional().describe("Background image URL (generate)"),
3574
+ headline: z13.string().optional().describe("Headline text overlay (generate)"),
3575
+ summary: z13.string().optional().describe("Summary text below headline (generate)"),
3576
+ formats: z13.array(z13.string()).optional().describe("Output formats: square, portrait, landscape, wide, story (generate)"),
3577
+ platforms: z13.array(z13.string()).optional().describe("Platform shortcuts: instagram, facebook, linkedin, twitter (generate)")
3327
3578
  },
3328
3579
  annotations: {
3329
3580
  readOnlyHint: false,
@@ -3463,21 +3714,21 @@ function registerImageTemplateTools(server, client) {
3463
3714
  }
3464
3715
 
3465
3716
  // src/tools/publishing-rules.ts
3466
- import { z as z13 } from "zod";
3717
+ import { z as z14 } from "zod";
3467
3718
  function registerPublishingRulesTools(server, client) {
3468
3719
  server.tool(
3469
3720
  "manage_publishing_rules",
3470
3721
  "Get or update publishing safety rules (immediate publish, blocked words, daily limits, default actions, Twitter Premium).",
3471
3722
  {
3472
- action: z13.enum(["get", "update"]),
3473
- allow_immediate_publish: z13.boolean().optional().describe("Allow immediate social publish (update)"),
3474
- allow_immediate_send: z13.boolean().optional().describe("Allow immediate newsletter send (update)"),
3475
- social_default_action: z13.enum(["draft", "schedule", "publish"]).optional().describe("Default social action (update)"),
3476
- newsletter_default_action: z13.enum(["draft", "schedule", "send"]).optional().describe("Default newsletter action (update)"),
3477
- max_posts_per_day: z13.number().int().min(1).max(100).nullable().optional().describe("Max posts/day, null=unlimited (update)"),
3478
- blocked_words: z13.array(z13.string().max(100)).max(200).nullable().optional().describe("Blocked words list (update)"),
3479
- twitter_premium: z13.boolean().optional().describe("Enable 25K char Twitter limit (update)"),
3480
- confirmed: z13.boolean().default(false).describe("Confirm update (update)")
3723
+ action: z14.enum(["get", "update"]),
3724
+ allow_immediate_publish: z14.boolean().optional().describe("Allow immediate social publish (update)"),
3725
+ allow_immediate_send: z14.boolean().optional().describe("Allow immediate newsletter send (update)"),
3726
+ social_default_action: z14.enum(["draft", "schedule", "publish"]).optional().describe("Default social action (update)"),
3727
+ newsletter_default_action: z14.enum(["draft", "schedule", "send"]).optional().describe("Default newsletter action (update)"),
3728
+ max_posts_per_day: z14.number().int().min(1).max(100).nullable().optional().describe("Max posts/day, null=unlimited (update)"),
3729
+ blocked_words: z14.array(z14.string().max(100)).max(200).nullable().optional().describe("Blocked words list (update)"),
3730
+ twitter_premium: z14.boolean().optional().describe("Enable 25K char Twitter limit (update)"),
3731
+ confirmed: z14.boolean().default(false).describe("Confirm update (update)")
3481
3732
  },
3482
3733
  {
3483
3734
  title: "Manage Publishing Rules",
@@ -3559,15 +3810,22 @@ function registerPublishingRulesTools(server, client) {
3559
3810
  }
3560
3811
 
3561
3812
  // src/tools/context.ts
3562
- import { z as z14 } from "zod";
3813
+ import { z as z15 } from "zod";
3563
3814
  function registerContextTools(server, client) {
3564
3815
  server.tool(
3565
3816
  "get_context",
3566
3817
  "Get brand voice, audience, and knowledge in one call for content creation.",
3567
3818
  {
3568
- platform: z14.string().optional().describe("Filter voice rules for platform"),
3569
- topic: z14.string().optional().describe("Filter knowledge items by topic/tag"),
3570
- include_newsletter_stats: z14.boolean().optional().describe("Include recent analytics")
3819
+ platform: z15.string().optional().describe("Filter voice rules for platform"),
3820
+ topic: z15.string().optional().describe("Filter knowledge items by topic/tag"),
3821
+ include_newsletter_stats: z15.boolean().optional().describe("Include recent analytics")
3822
+ },
3823
+ {
3824
+ title: "Get Context",
3825
+ readOnlyHint: true,
3826
+ destructiveHint: false,
3827
+ idempotentHint: true,
3828
+ openWorldHint: true
3571
3829
  },
3572
3830
  async (args) => {
3573
3831
  const params = {};
@@ -3634,13 +3892,13 @@ function registerContextTools(server, client) {
3634
3892
  }
3635
3893
 
3636
3894
  // src/tools/team.ts
3637
- import { z as z15 } from "zod";
3895
+ import { z as z16 } from "zod";
3638
3896
  function registerTeamTools(server, client) {
3639
3897
  server.tool(
3640
3898
  "manage_team",
3641
3899
  "Manage team members, invitations, and organizations. List members, invite or remove members, manage invitations, and list organizations.",
3642
3900
  {
3643
- action: z15.enum([
3901
+ action: z16.enum([
3644
3902
  "list_members",
3645
3903
  "invite_member",
3646
3904
  "remove_member",
@@ -3648,10 +3906,10 @@ function registerTeamTools(server, client) {
3648
3906
  "revoke_invitation",
3649
3907
  "list_organizations"
3650
3908
  ]),
3651
- email: z15.string().optional().describe("Email address (invite_member)"),
3652
- role: z15.string().optional().describe("Role for the member (invite_member), e.g. 'admin', 'member'"),
3653
- member_id: z15.string().optional().describe("Member ID (remove_member)"),
3654
- invitation_id: z15.string().optional().describe("Invitation ID (revoke_invitation)")
3909
+ email: z16.string().optional().describe("Email address (invite_member)"),
3910
+ role: z16.string().optional().describe("Role for the member (invite_member), e.g. 'admin', 'member'"),
3911
+ member_id: z16.string().optional().describe("Member ID (remove_member)"),
3912
+ invitation_id: z16.string().optional().describe("Invitation ID (revoke_invitation)")
3655
3913
  },
3656
3914
  {
3657
3915
  title: "Manage Team",
@@ -3770,6 +4028,7 @@ export {
3770
4028
  registerImageTemplateTools,
3771
4029
  registerInsightsTools,
3772
4030
  registerMediaTools,
4031
+ registerNewsletterTools,
3773
4032
  registerPostPreviewResource,
3774
4033
  registerPostTools,
3775
4034
  registerPublishingRulesTools,