claude-plugin-wordpress-manager 2.3.1 → 2.6.0

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.
Files changed (65) hide show
  1. package/.claude-plugin/plugin.json +15 -3
  2. package/CHANGELOG.md +62 -0
  3. package/agents/wp-content-strategist.md +104 -0
  4. package/agents/wp-distribution-manager.md +98 -0
  5. package/docs/GUIDE.md +183 -23
  6. package/docs/plans/2026-03-01-tier3-wcop-design.md +373 -0
  7. package/docs/plans/2026-03-01-tier3-wcop-implementation.md +915 -0
  8. package/hooks/hooks.json +18 -0
  9. package/package.json +18 -3
  10. package/servers/wp-rest-bridge/build/tools/buffer.d.ts +3 -0
  11. package/servers/wp-rest-bridge/build/tools/buffer.js +205 -0
  12. package/servers/wp-rest-bridge/build/tools/comments.d.ts +6 -6
  13. package/servers/wp-rest-bridge/build/tools/gsc.d.ts +3 -0
  14. package/servers/wp-rest-bridge/build/tools/gsc.js +354 -0
  15. package/servers/wp-rest-bridge/build/tools/index.d.ts +38 -38
  16. package/servers/wp-rest-bridge/build/tools/index.js +12 -0
  17. package/servers/wp-rest-bridge/build/tools/mailchimp.d.ts +3 -0
  18. package/servers/wp-rest-bridge/build/tools/mailchimp.js +265 -0
  19. package/servers/wp-rest-bridge/build/tools/media.d.ts +2 -2
  20. package/servers/wp-rest-bridge/build/tools/multisite-sites.d.ts +2 -2
  21. package/servers/wp-rest-bridge/build/tools/plugin-repository.d.ts +1 -1
  22. package/servers/wp-rest-bridge/build/tools/search.d.ts +2 -2
  23. package/servers/wp-rest-bridge/build/tools/sendgrid.d.ts +3 -0
  24. package/servers/wp-rest-bridge/build/tools/sendgrid.js +255 -0
  25. package/servers/wp-rest-bridge/build/tools/unified-content.d.ts +8 -8
  26. package/servers/wp-rest-bridge/build/tools/unified-taxonomies.d.ts +4 -4
  27. package/servers/wp-rest-bridge/build/tools/users.d.ts +6 -6
  28. package/servers/wp-rest-bridge/build/tools/wc-coupons.d.ts +1 -1
  29. package/servers/wp-rest-bridge/build/tools/wc-customers.d.ts +3 -3
  30. package/servers/wp-rest-bridge/build/tools/wc-orders.d.ts +4 -4
  31. package/servers/wp-rest-bridge/build/tools/wc-products.d.ts +8 -8
  32. package/servers/wp-rest-bridge/build/tools/wc-webhooks.d.ts +4 -4
  33. package/servers/wp-rest-bridge/build/types.d.ts +122 -0
  34. package/servers/wp-rest-bridge/build/wordpress.d.ts +14 -0
  35. package/servers/wp-rest-bridge/build/wordpress.js +151 -0
  36. package/servers/wp-rest-bridge/package.json +1 -0
  37. package/skills/wordpress-router/references/decision-tree.md +8 -2
  38. package/skills/wp-content/SKILL.md +2 -0
  39. package/skills/wp-content-attribution/SKILL.md +2 -0
  40. package/skills/wp-content-optimization/SKILL.md +172 -0
  41. package/skills/wp-content-optimization/references/content-freshness.md +234 -0
  42. package/skills/wp-content-optimization/references/headline-optimization.md +171 -0
  43. package/skills/wp-content-optimization/references/meta-optimization.md +243 -0
  44. package/skills/wp-content-optimization/references/readability-analysis.md +201 -0
  45. package/skills/wp-content-optimization/references/seo-content-scoring.md +245 -0
  46. package/skills/wp-content-optimization/scripts/content_optimization_inspect.mjs +237 -0
  47. package/skills/wp-content-repurposing/SKILL.md +1 -0
  48. package/skills/wp-monitoring/SKILL.md +1 -0
  49. package/skills/wp-programmatic-seo/SKILL.md +2 -0
  50. package/skills/wp-search-console/SKILL.md +121 -0
  51. package/skills/wp-search-console/references/competitor-gap-analysis.md +226 -0
  52. package/skills/wp-search-console/references/content-seo-feedback.md +181 -0
  53. package/skills/wp-search-console/references/gsc-setup.md +110 -0
  54. package/skills/wp-search-console/references/indexing-management.md +182 -0
  55. package/skills/wp-search-console/references/keyword-tracking.md +181 -0
  56. package/skills/wp-search-console/scripts/search_console_inspect.mjs +178 -0
  57. package/skills/wp-social-email/SKILL.md +152 -0
  58. package/skills/wp-social-email/references/audience-segmentation.md +173 -0
  59. package/skills/wp-social-email/references/buffer-social-publishing.md +124 -0
  60. package/skills/wp-social-email/references/content-to-distribution.md +156 -0
  61. package/skills/wp-social-email/references/distribution-analytics.md +208 -0
  62. package/skills/wp-social-email/references/mailchimp-integration.md +145 -0
  63. package/skills/wp-social-email/references/sendgrid-transactional.md +165 -0
  64. package/skills/wp-social-email/scripts/distribution_inspect.mjs +165 -0
  65. package/skills/wp-webhooks/SKILL.md +1 -0
@@ -34,14 +34,14 @@ export declare const toolHandlers: {
34
34
  name: string;
35
35
  topic: string;
36
36
  delivery_url: string;
37
- status?: "active" | "paused" | "disabled" | undefined;
38
37
  secret?: string | undefined;
38
+ status?: "active" | "paused" | "disabled" | undefined;
39
39
  }, {
40
40
  name: string;
41
41
  topic: string;
42
42
  delivery_url: string;
43
- status?: "active" | "paused" | "disabled" | undefined;
44
43
  secret?: string | undefined;
44
+ status?: "active" | "paused" | "disabled" | undefined;
45
45
  }>>) => Promise<{
46
46
  toolResult: {
47
47
  content: {
@@ -68,18 +68,18 @@ export declare const toolHandlers: {
68
68
  status: import("zod").ZodOptional<import("zod").ZodEnum<["active", "paused", "disabled"]>>;
69
69
  }, "strict", import("zod").ZodTypeAny, {
70
70
  id: number;
71
+ secret?: string | undefined;
71
72
  status?: "active" | "paused" | "disabled" | undefined;
72
73
  name?: string | undefined;
73
74
  topic?: string | undefined;
74
75
  delivery_url?: string | undefined;
75
- secret?: string | undefined;
76
76
  }, {
77
77
  id: number;
78
+ secret?: string | undefined;
78
79
  status?: "active" | "paused" | "disabled" | undefined;
79
80
  name?: string | undefined;
80
81
  topic?: string | undefined;
81
82
  delivery_url?: string | undefined;
82
- secret?: string | undefined;
83
83
  }>>) => Promise<{
84
84
  toolResult: {
85
85
  content: {
@@ -296,14 +296,14 @@ export declare const toolHandlers: {
296
296
  email: import("zod").ZodString;
297
297
  site_id: import("zod").ZodOptional<import("zod").ZodString>;
298
298
  }, "strict", import("zod").ZodTypeAny, {
299
+ email: string;
299
300
  slug: string;
300
301
  title: string;
301
- email: string;
302
302
  site_id?: string | undefined;
303
303
  }, {
304
+ email: string;
304
305
  slug: string;
305
306
  title: string;
306
- email: string;
307
307
  site_id?: string | undefined;
308
308
  }>>) => Promise<{
309
309
  toolResult: {
@@ -566,9 +566,9 @@ export declare const toolHandlers: {
566
566
  per_page: number;
567
567
  search?: string | undefined;
568
568
  }, {
569
+ search?: string | undefined;
569
570
  page?: number | undefined;
570
571
  per_page?: number | undefined;
571
- search?: string | undefined;
572
572
  }>>) => Promise<{
573
573
  toolResult: {
574
574
  content: {
@@ -705,15 +705,15 @@ export declare const toolHandlers: {
705
705
  order: "asc" | "desc";
706
706
  role: "author" | "customer" | "all" | "administrator" | "editor" | "contributor" | "subscriber";
707
707
  search?: string | undefined;
708
- orderby?: "id" | "name" | "registered_date" | undefined;
709
708
  email?: string | undefined;
709
+ orderby?: "id" | "name" | "registered_date" | undefined;
710
710
  }, {
711
+ search?: string | undefined;
712
+ email?: string | undefined;
711
713
  page?: number | undefined;
712
714
  per_page?: number | undefined;
713
- search?: string | undefined;
714
715
  orderby?: "id" | "name" | "registered_date" | undefined;
715
716
  order?: "asc" | "desc" | undefined;
716
- email?: string | undefined;
717
717
  role?: "author" | "customer" | "all" | "administrator" | "editor" | "contributor" | "subscriber" | undefined;
718
718
  }>>) => Promise<{
719
719
  toolResult: {
@@ -836,7 +836,7 @@ export declare const toolHandlers: {
836
836
  per_page: number;
837
837
  order: "asc" | "desc";
838
838
  status?: "trash" | "pending" | "any" | "processing" | "on-hold" | "completed" | "cancelled" | "refunded" | "failed" | undefined;
839
- orderby?: "slug" | "date" | "id" | "title" | undefined;
839
+ orderby?: "id" | "slug" | "date" | "title" | undefined;
840
840
  after?: string | undefined;
841
841
  before?: string | undefined;
842
842
  customer?: number | undefined;
@@ -844,7 +844,7 @@ export declare const toolHandlers: {
844
844
  page?: number | undefined;
845
845
  per_page?: number | undefined;
846
846
  status?: "trash" | "pending" | "any" | "processing" | "on-hold" | "completed" | "cancelled" | "refunded" | "failed" | undefined;
847
- orderby?: "slug" | "date" | "id" | "title" | undefined;
847
+ orderby?: "id" | "slug" | "date" | "title" | undefined;
848
848
  order?: "asc" | "desc" | undefined;
849
849
  after?: string | undefined;
850
850
  before?: string | undefined;
@@ -893,11 +893,11 @@ export declare const toolHandlers: {
893
893
  id: import("zod").ZodNumber;
894
894
  status: import("zod").ZodEnum<["pending", "processing", "on-hold", "completed", "cancelled", "refunded", "failed"]>;
895
895
  }, "strict", import("zod").ZodTypeAny, {
896
- status: "pending" | "processing" | "on-hold" | "completed" | "cancelled" | "refunded" | "failed";
897
896
  id: number;
898
- }, {
899
897
  status: "pending" | "processing" | "on-hold" | "completed" | "cancelled" | "refunded" | "failed";
898
+ }, {
900
899
  id: number;
900
+ status: "pending" | "processing" | "on-hold" | "completed" | "cancelled" | "refunded" | "failed";
901
901
  }>>) => Promise<{
902
902
  toolResult: {
903
903
  content: {
@@ -1013,17 +1013,17 @@ export declare const toolHandlers: {
1013
1013
  order: "asc" | "desc";
1014
1014
  search?: string | undefined;
1015
1015
  status?: "draft" | "pending" | "private" | "publish" | "any" | undefined;
1016
- orderby?: "slug" | "date" | "id" | "title" | "price" | "popularity" | "rating" | undefined;
1016
+ orderby?: "id" | "slug" | "date" | "title" | "price" | "popularity" | "rating" | undefined;
1017
1017
  category?: number | undefined;
1018
1018
  tag?: number | undefined;
1019
1019
  sku?: string | undefined;
1020
1020
  stock_status?: "instock" | "outofstock" | "onbackorder" | undefined;
1021
1021
  }, {
1022
+ search?: string | undefined;
1022
1023
  page?: number | undefined;
1023
1024
  per_page?: number | undefined;
1024
- search?: string | undefined;
1025
1025
  status?: "draft" | "pending" | "private" | "publish" | "any" | undefined;
1026
- orderby?: "slug" | "date" | "id" | "title" | "price" | "popularity" | "rating" | undefined;
1026
+ orderby?: "id" | "slug" | "date" | "title" | "price" | "popularity" | "rating" | undefined;
1027
1027
  order?: "asc" | "desc" | undefined;
1028
1028
  category?: number | undefined;
1029
1029
  tag?: number | undefined;
@@ -1102,8 +1102,8 @@ export declare const toolHandlers: {
1102
1102
  src: string;
1103
1103
  }>, "many">>;
1104
1104
  }, "strict", import("zod").ZodTypeAny, {
1105
- status: "draft" | "pending" | "private" | "publish";
1106
1105
  type: "simple" | "grouped" | "external" | "variable";
1106
+ status: "draft" | "pending" | "private" | "publish";
1107
1107
  name: string;
1108
1108
  categories?: {
1109
1109
  id: number;
@@ -1123,8 +1123,8 @@ export declare const toolHandlers: {
1123
1123
  }[] | undefined;
1124
1124
  }, {
1125
1125
  name: string;
1126
- status?: "draft" | "pending" | "private" | "publish" | undefined;
1127
1126
  type?: "simple" | "grouped" | "external" | "variable" | undefined;
1127
+ status?: "draft" | "pending" | "private" | "publish" | undefined;
1128
1128
  categories?: {
1129
1129
  id: number;
1130
1130
  }[] | undefined;
@@ -1250,13 +1250,13 @@ export declare const toolHandlers: {
1250
1250
  order: "asc" | "desc";
1251
1251
  search?: string | undefined;
1252
1252
  parent?: number | undefined;
1253
- orderby?: "slug" | "id" | "name" | "count" | undefined;
1253
+ orderby?: "id" | "slug" | "name" | "count" | undefined;
1254
1254
  }, {
1255
+ search?: string | undefined;
1255
1256
  page?: number | undefined;
1256
1257
  per_page?: number | undefined;
1257
- search?: string | undefined;
1258
1258
  parent?: number | undefined;
1259
- orderby?: "slug" | "id" | "name" | "count" | undefined;
1259
+ orderby?: "id" | "slug" | "name" | "count" | undefined;
1260
1260
  order?: "asc" | "desc" | undefined;
1261
1261
  }>>) => Promise<{
1262
1262
  toolResult: {
@@ -1309,9 +1309,9 @@ export declare const toolHandlers: {
1309
1309
  }>;
1310
1310
  wp_search: (params: {
1311
1311
  search: string;
1312
+ type?: string | undefined;
1312
1313
  page?: number | undefined;
1313
1314
  per_page?: number | undefined;
1314
- type?: string | undefined;
1315
1315
  _embed?: boolean | undefined;
1316
1316
  _fields?: string | undefined;
1317
1317
  include_pagination?: boolean | undefined;
@@ -1327,13 +1327,13 @@ export declare const toolHandlers: {
1327
1327
  }>;
1328
1328
  list_comments: (params: {
1329
1329
  post?: number | undefined;
1330
+ search?: string | undefined;
1331
+ type?: string | undefined;
1330
1332
  page?: number | undefined;
1331
1333
  per_page?: number | undefined;
1332
- search?: string | undefined;
1333
1334
  status?: "approve" | "hold" | "spam" | "trash" | undefined;
1334
- type?: string | undefined;
1335
1335
  author?: number | number[] | undefined;
1336
- orderby?: "post" | "type" | "date" | "parent" | "id" | "include" | "date_gmt" | undefined;
1336
+ orderby?: "post" | "id" | "type" | "date" | "parent" | "include" | "date_gmt" | undefined;
1337
1337
  order?: "asc" | "desc" | undefined;
1338
1338
  after?: string | undefined;
1339
1339
  _embed?: boolean | undefined;
@@ -1453,9 +1453,9 @@ export declare const toolHandlers: {
1453
1453
  };
1454
1454
  }>;
1455
1455
  search_plugin_repository: (params: {
1456
+ search: string;
1456
1457
  page: number;
1457
1458
  per_page: number;
1458
- search: string;
1459
1459
  }) => Promise<{
1460
1460
  toolResult: {
1461
1461
  content: {
@@ -1493,10 +1493,10 @@ export declare const toolHandlers: {
1493
1493
  };
1494
1494
  }>;
1495
1495
  list_users: (params: {
1496
+ search?: string | undefined;
1496
1497
  page?: number | undefined;
1497
1498
  per_page?: number | undefined;
1498
- search?: string | undefined;
1499
- orderby?: "url" | "slug" | "id" | "name" | "include" | "registered_date" | "email" | undefined;
1499
+ orderby?: "url" | "id" | "email" | "slug" | "name" | "include" | "registered_date" | undefined;
1500
1500
  order?: "asc" | "desc" | undefined;
1501
1501
  _embed?: boolean | undefined;
1502
1502
  _fields?: string | undefined;
@@ -1601,10 +1601,10 @@ export declare const toolHandlers: {
1601
1601
  update_user: (params: {
1602
1602
  id: number;
1603
1603
  url?: string | undefined;
1604
+ email?: string | undefined;
1604
1605
  slug?: string | undefined;
1605
1606
  description?: string | undefined;
1606
1607
  name?: string | undefined;
1607
- email?: string | undefined;
1608
1608
  roles?: string[] | undefined;
1609
1609
  username?: string | undefined;
1610
1610
  first_name?: string | undefined;
@@ -1658,16 +1658,16 @@ export declare const toolHandlers: {
1658
1658
  _fields: import("zod").ZodOptional<import("zod").ZodString>;
1659
1659
  include_pagination: import("zod").ZodOptional<import("zod").ZodBoolean>;
1660
1660
  }, "strict", import("zod").ZodTypeAny, {
1661
+ search?: string | undefined;
1661
1662
  page?: number | undefined;
1662
1663
  per_page?: number | undefined;
1663
- search?: string | undefined;
1664
1664
  _embed?: boolean | undefined;
1665
1665
  _fields?: string | undefined;
1666
1666
  include_pagination?: boolean | undefined;
1667
1667
  }, {
1668
+ search?: string | undefined;
1668
1669
  page?: number | undefined;
1669
1670
  per_page?: number | undefined;
1670
- search?: string | undefined;
1671
1671
  _embed?: boolean | undefined;
1672
1672
  _fields?: string | undefined;
1673
1673
  include_pagination?: boolean | undefined;
@@ -1968,12 +1968,12 @@ export declare const toolHandlers: {
1968
1968
  }>;
1969
1969
  list_terms: (params: {
1970
1970
  taxonomy: string;
1971
+ search?: string | undefined;
1971
1972
  page?: number | undefined;
1972
1973
  per_page?: number | undefined;
1973
- search?: string | undefined;
1974
1974
  slug?: string | undefined;
1975
1975
  parent?: number | undefined;
1976
- orderby?: "slug" | "id" | "description" | "name" | "include" | "term_group" | "count" | undefined;
1976
+ orderby?: "id" | "slug" | "description" | "name" | "include" | "term_group" | "count" | undefined;
1977
1977
  order?: "asc" | "desc" | undefined;
1978
1978
  _embed?: boolean | undefined;
1979
1979
  _fields?: string | undefined;
@@ -2078,9 +2078,9 @@ export declare const toolHandlers: {
2078
2078
  }>;
2079
2079
  list_content: (params: {
2080
2080
  content_type: string;
2081
+ search?: string | undefined;
2081
2082
  page?: number | undefined;
2082
2083
  per_page?: number | undefined;
2083
- search?: string | undefined;
2084
2084
  slug?: string | undefined;
2085
2085
  status?: string | undefined;
2086
2086
  author?: number | number[] | undefined;
@@ -2104,8 +2104,8 @@ export declare const toolHandlers: {
2104
2104
  };
2105
2105
  }>;
2106
2106
  get_content: (params: {
2107
- content_type: string;
2108
2107
  id: number;
2108
+ content_type: string;
2109
2109
  _embed?: boolean | undefined;
2110
2110
  _fields?: string | undefined;
2111
2111
  }) => Promise<{
@@ -2143,8 +2143,8 @@ export declare const toolHandlers: {
2143
2143
  };
2144
2144
  }>;
2145
2145
  update_content: (params: {
2146
- content_type: string;
2147
2146
  id: number;
2147
+ content_type: string;
2148
2148
  slug?: string | undefined;
2149
2149
  status?: string | undefined;
2150
2150
  author?: number | undefined;
@@ -2169,8 +2169,8 @@ export declare const toolHandlers: {
2169
2169
  };
2170
2170
  }>;
2171
2171
  delete_content: (params: {
2172
- content_type: string;
2173
2172
  id: number;
2173
+ content_type: string;
2174
2174
  force?: boolean | undefined;
2175
2175
  }) => Promise<{
2176
2176
  toolResult: {
@@ -15,6 +15,10 @@ import { wcSettingTools, wcSettingHandlers } from './wc-settings.js';
15
15
  import { multisiteSiteTools, multisiteSiteHandlers } from './multisite-sites.js';
16
16
  import { multisiteNetworkTools, multisiteNetworkHandlers } from './multisite-network.js';
17
17
  import { wcWebhookTools, wcWebhookHandlers } from './wc-webhooks.js';
18
+ import { mailchimpTools, mailchimpHandlers } from './mailchimp.js';
19
+ import { bufferTools, bufferHandlers } from './buffer.js';
20
+ import { sendgridTools, sendgridHandlers } from './sendgrid.js';
21
+ import { gscTools, gscHandlers } from './gsc.js';
18
22
  // Combine all tools
19
23
  export const allTools = [
20
24
  ...unifiedContentTools, // 8 tools
@@ -34,6 +38,10 @@ export const allTools = [
34
38
  ...multisiteSiteTools, // 5 tools
35
39
  ...multisiteNetworkTools, // 5 tools
36
40
  ...wcWebhookTools, // 4 tools
41
+ ...mailchimpTools, // 7 tools
42
+ ...bufferTools, // 5 tools
43
+ ...sendgridTools, // 6 tools
44
+ ...gscTools, // 8 tools
37
45
  ];
38
46
  // Combine all handlers
39
47
  export const toolHandlers = {
@@ -54,4 +62,8 @@ export const toolHandlers = {
54
62
  ...multisiteSiteHandlers,
55
63
  ...multisiteNetworkHandlers,
56
64
  ...wcWebhookHandlers,
65
+ ...mailchimpHandlers,
66
+ ...bufferHandlers,
67
+ ...sendgridHandlers,
68
+ ...gscHandlers,
57
69
  };
@@ -0,0 +1,3 @@
1
+ import { Tool } from '@modelcontextprotocol/sdk/types.js';
2
+ export declare const mailchimpTools: Tool[];
3
+ export declare const mailchimpHandlers: Record<string, Function>;
@@ -0,0 +1,265 @@
1
+ import { makeMailchimpRequest, hasMailchimp } from '../wordpress.js';
2
+ import { z } from 'zod';
3
+ // ── Zod Schemas ─────────────────────────────────────────────────
4
+ const mcListAudiencesSchema = z.object({}).strict();
5
+ const mcGetAudienceMembersSchema = z.object({
6
+ list_id: z.string().describe('Audience (list) ID'),
7
+ status: z.enum(['subscribed', 'unsubscribed', 'cleaned', 'pending']).optional()
8
+ .describe('Filter members by subscription status'),
9
+ count: z.number().optional().default(100)
10
+ .describe('Number of members to return (default 100)'),
11
+ offset: z.number().optional()
12
+ .describe('Number of members to skip (for pagination)'),
13
+ }).strict();
14
+ const mcCreateCampaignSchema = z.object({
15
+ type: z.enum(['regular', 'plaintext', 'absplit'])
16
+ .describe('Campaign type'),
17
+ list_id: z.string().describe('Audience (list) ID to send to'),
18
+ subject_line: z.string().describe('Email subject line'),
19
+ from_name: z.string().describe('Sender name shown to recipients'),
20
+ reply_to: z.string().describe('Reply-to email address'),
21
+ }).strict();
22
+ const mcUpdateCampaignContentSchema = z.object({
23
+ campaign_id: z.string().describe('Campaign ID'),
24
+ html: z.string().describe('HTML content for the campaign email'),
25
+ }).strict();
26
+ const mcSendCampaignSchema = z.object({
27
+ campaign_id: z.string().describe('Campaign ID to send'),
28
+ }).strict();
29
+ const mcGetCampaignReportSchema = z.object({
30
+ campaign_id: z.string().describe('Campaign ID to get report for'),
31
+ }).strict();
32
+ const mcAddSubscriberSchema = z.object({
33
+ list_id: z.string().describe('Audience (list) ID'),
34
+ email_address: z.string().describe('Subscriber email address'),
35
+ status: z.enum(['subscribed', 'unsubscribed', 'cleaned', 'pending'])
36
+ .describe('Subscription status'),
37
+ merge_fields: z.record(z.any()).optional()
38
+ .describe('Merge fields (e.g. FNAME, LNAME)'),
39
+ tags: z.array(z.string()).optional()
40
+ .describe('Tags to assign to the subscriber'),
41
+ }).strict();
42
+ // ── Tool Definitions ────────────────────────────────────────────
43
+ export const mailchimpTools = [
44
+ {
45
+ name: "mc_list_audiences",
46
+ description: "Lists all Mailchimp audiences (lists) with member counts and stats",
47
+ inputSchema: {
48
+ type: "object",
49
+ properties: {},
50
+ },
51
+ },
52
+ {
53
+ name: "mc_get_audience_members",
54
+ description: "Gets members of a Mailchimp audience with optional status filter",
55
+ inputSchema: {
56
+ type: "object",
57
+ properties: {
58
+ list_id: { type: "string", description: "Audience (list) ID" },
59
+ status: {
60
+ type: "string",
61
+ enum: ["subscribed", "unsubscribed", "cleaned", "pending"],
62
+ description: "Filter members by subscription status",
63
+ },
64
+ count: { type: "number", description: "Number of members to return (default 100)" },
65
+ offset: { type: "number", description: "Number of members to skip (for pagination)" },
66
+ },
67
+ required: ["list_id"],
68
+ },
69
+ },
70
+ {
71
+ name: "mc_create_campaign",
72
+ description: "Creates a new Mailchimp email campaign",
73
+ inputSchema: {
74
+ type: "object",
75
+ properties: {
76
+ type: {
77
+ type: "string",
78
+ enum: ["regular", "plaintext", "absplit"],
79
+ description: "Campaign type",
80
+ },
81
+ list_id: { type: "string", description: "Audience (list) ID to send to" },
82
+ subject_line: { type: "string", description: "Email subject line" },
83
+ from_name: { type: "string", description: "Sender name shown to recipients" },
84
+ reply_to: { type: "string", description: "Reply-to email address" },
85
+ },
86
+ required: ["type", "list_id", "subject_line", "from_name", "reply_to"],
87
+ },
88
+ },
89
+ {
90
+ name: "mc_update_campaign_content",
91
+ description: "Sets the HTML content of a Mailchimp campaign",
92
+ inputSchema: {
93
+ type: "object",
94
+ properties: {
95
+ campaign_id: { type: "string", description: "Campaign ID" },
96
+ html: { type: "string", description: "HTML content for the campaign email" },
97
+ },
98
+ required: ["campaign_id", "html"],
99
+ },
100
+ },
101
+ {
102
+ name: "mc_send_campaign",
103
+ description: "Sends a Mailchimp campaign to its audience (DESTRUCTIVE — triggers real emails)",
104
+ inputSchema: {
105
+ type: "object",
106
+ properties: {
107
+ campaign_id: { type: "string", description: "Campaign ID to send" },
108
+ },
109
+ required: ["campaign_id"],
110
+ },
111
+ },
112
+ {
113
+ name: "mc_get_campaign_report",
114
+ description: "Gets performance report for a sent Mailchimp campaign (opens, clicks, bounces)",
115
+ inputSchema: {
116
+ type: "object",
117
+ properties: {
118
+ campaign_id: { type: "string", description: "Campaign ID to get report for" },
119
+ },
120
+ required: ["campaign_id"],
121
+ },
122
+ },
123
+ {
124
+ name: "mc_add_subscriber",
125
+ description: "Adds or updates a subscriber in a Mailchimp audience",
126
+ inputSchema: {
127
+ type: "object",
128
+ properties: {
129
+ list_id: { type: "string", description: "Audience (list) ID" },
130
+ email_address: { type: "string", description: "Subscriber email address" },
131
+ status: {
132
+ type: "string",
133
+ enum: ["subscribed", "unsubscribed", "cleaned", "pending"],
134
+ description: "Subscription status",
135
+ },
136
+ merge_fields: { type: "object", description: "Merge fields (e.g. FNAME, LNAME)" },
137
+ tags: {
138
+ type: "array",
139
+ items: { type: "string" },
140
+ description: "Tags to assign to the subscriber",
141
+ },
142
+ },
143
+ required: ["list_id", "email_address", "status"],
144
+ },
145
+ },
146
+ ];
147
+ // ── Handlers ────────────────────────────────────────────────────
148
+ export const mailchimpHandlers = {
149
+ mc_list_audiences: async (_params) => {
150
+ if (!hasMailchimp()) {
151
+ return { toolResult: { isError: true, content: [{ type: "text", text: "Mailchimp not configured. Add mailchimp_api_key to WP_SITES_CONFIG." }] } };
152
+ }
153
+ try {
154
+ const response = await makeMailchimpRequest("GET", "/lists");
155
+ return { toolResult: { content: [{ type: "text", text: JSON.stringify(response, null, 2) }] } };
156
+ }
157
+ catch (error) {
158
+ const errorMessage = error.response?.data?.detail || error.message;
159
+ return { toolResult: { isError: true, content: [{ type: "text", text: `Error listing audiences: ${errorMessage}` }] } };
160
+ }
161
+ },
162
+ mc_get_audience_members: async (params) => {
163
+ if (!hasMailchimp()) {
164
+ return { toolResult: { isError: true, content: [{ type: "text", text: "Mailchimp not configured. Add mailchimp_api_key to WP_SITES_CONFIG." }] } };
165
+ }
166
+ try {
167
+ const { list_id, status, count, offset } = params;
168
+ const query = {};
169
+ if (status)
170
+ query.status = status;
171
+ if (count !== undefined)
172
+ query.count = count;
173
+ if (offset !== undefined)
174
+ query.offset = offset;
175
+ const qs = Object.entries(query).map(([k, v]) => `${k}=${v}`).join('&');
176
+ const endpoint = `/lists/${list_id}/members${qs ? '?' + qs : ''}`;
177
+ const response = await makeMailchimpRequest("GET", endpoint);
178
+ return { toolResult: { content: [{ type: "text", text: JSON.stringify(response, null, 2) }] } };
179
+ }
180
+ catch (error) {
181
+ const errorMessage = error.response?.data?.detail || error.message;
182
+ return { toolResult: { isError: true, content: [{ type: "text", text: `Error getting audience members: ${errorMessage}` }] } };
183
+ }
184
+ },
185
+ mc_create_campaign: async (params) => {
186
+ if (!hasMailchimp()) {
187
+ return { toolResult: { isError: true, content: [{ type: "text", text: "Mailchimp not configured. Add mailchimp_api_key to WP_SITES_CONFIG." }] } };
188
+ }
189
+ try {
190
+ const { type, list_id, subject_line, from_name, reply_to } = params;
191
+ const body = {
192
+ type,
193
+ recipients: { list_id },
194
+ settings: { subject_line, from_name, reply_to },
195
+ };
196
+ const response = await makeMailchimpRequest("POST", "/campaigns", body);
197
+ return { toolResult: { content: [{ type: "text", text: JSON.stringify(response, null, 2) }] } };
198
+ }
199
+ catch (error) {
200
+ const errorMessage = error.response?.data?.detail || error.message;
201
+ return { toolResult: { isError: true, content: [{ type: "text", text: `Error creating campaign: ${errorMessage}` }] } };
202
+ }
203
+ },
204
+ mc_update_campaign_content: async (params) => {
205
+ if (!hasMailchimp()) {
206
+ return { toolResult: { isError: true, content: [{ type: "text", text: "Mailchimp not configured. Add mailchimp_api_key to WP_SITES_CONFIG." }] } };
207
+ }
208
+ try {
209
+ const { campaign_id, html } = params;
210
+ const response = await makeMailchimpRequest("PUT", `/campaigns/${campaign_id}/content`, { html });
211
+ return { toolResult: { content: [{ type: "text", text: JSON.stringify(response, null, 2) }] } };
212
+ }
213
+ catch (error) {
214
+ const errorMessage = error.response?.data?.detail || error.message;
215
+ return { toolResult: { isError: true, content: [{ type: "text", text: `Error updating campaign content: ${errorMessage}` }] } };
216
+ }
217
+ },
218
+ mc_send_campaign: async (params) => {
219
+ if (!hasMailchimp()) {
220
+ return { toolResult: { isError: true, content: [{ type: "text", text: "Mailchimp not configured. Add mailchimp_api_key to WP_SITES_CONFIG." }] } };
221
+ }
222
+ try {
223
+ const { campaign_id } = params;
224
+ const response = await makeMailchimpRequest("POST", `/campaigns/${campaign_id}/actions/send`);
225
+ return { toolResult: { content: [{ type: "text", text: JSON.stringify(response ?? { success: true, message: "Campaign sent successfully" }, null, 2) }] } };
226
+ }
227
+ catch (error) {
228
+ const errorMessage = error.response?.data?.detail || error.message;
229
+ return { toolResult: { isError: true, content: [{ type: "text", text: `Error sending campaign: ${errorMessage}` }] } };
230
+ }
231
+ },
232
+ mc_get_campaign_report: async (params) => {
233
+ if (!hasMailchimp()) {
234
+ return { toolResult: { isError: true, content: [{ type: "text", text: "Mailchimp not configured. Add mailchimp_api_key to WP_SITES_CONFIG." }] } };
235
+ }
236
+ try {
237
+ const { campaign_id } = params;
238
+ const response = await makeMailchimpRequest("GET", `/reports/${campaign_id}`);
239
+ return { toolResult: { content: [{ type: "text", text: JSON.stringify(response, null, 2) }] } };
240
+ }
241
+ catch (error) {
242
+ const errorMessage = error.response?.data?.detail || error.message;
243
+ return { toolResult: { isError: true, content: [{ type: "text", text: `Error getting campaign report: ${errorMessage}` }] } };
244
+ }
245
+ },
246
+ mc_add_subscriber: async (params) => {
247
+ if (!hasMailchimp()) {
248
+ return { toolResult: { isError: true, content: [{ type: "text", text: "Mailchimp not configured. Add mailchimp_api_key to WP_SITES_CONFIG." }] } };
249
+ }
250
+ try {
251
+ const { list_id, email_address, status, merge_fields, tags } = params;
252
+ const body = { email_address, status };
253
+ if (merge_fields)
254
+ body.merge_fields = merge_fields;
255
+ if (tags)
256
+ body.tags = tags;
257
+ const response = await makeMailchimpRequest("POST", `/lists/${list_id}/members`, body);
258
+ return { toolResult: { content: [{ type: "text", text: JSON.stringify(response, null, 2) }] } };
259
+ }
260
+ catch (error) {
261
+ const errorMessage = error.response?.data?.detail || error.message;
262
+ return { toolResult: { isError: true, content: [{ type: "text", text: `Error adding subscriber: ${errorMessage}` }] } };
263
+ }
264
+ },
265
+ };
@@ -8,16 +8,16 @@ declare const listMediaSchema: z.ZodObject<{
8
8
  _fields: z.ZodOptional<z.ZodString>;
9
9
  include_pagination: z.ZodOptional<z.ZodBoolean>;
10
10
  }, "strict", z.ZodTypeAny, {
11
+ search?: string | undefined;
11
12
  page?: number | undefined;
12
13
  per_page?: number | undefined;
13
- search?: string | undefined;
14
14
  _embed?: boolean | undefined;
15
15
  _fields?: string | undefined;
16
16
  include_pagination?: boolean | undefined;
17
17
  }, {
18
+ search?: string | undefined;
18
19
  page?: number | undefined;
19
20
  per_page?: number | undefined;
20
- search?: string | undefined;
21
21
  _embed?: boolean | undefined;
22
22
  _fields?: string | undefined;
23
23
  include_pagination?: boolean | undefined;
@@ -23,14 +23,14 @@ declare const msCreateSiteSchema: z.ZodObject<{
23
23
  email: z.ZodString;
24
24
  site_id: z.ZodOptional<z.ZodString>;
25
25
  }, "strict", z.ZodTypeAny, {
26
+ email: string;
26
27
  slug: string;
27
28
  title: string;
28
- email: string;
29
29
  site_id?: string | undefined;
30
30
  }, {
31
+ email: string;
31
32
  slug: string;
32
33
  title: string;
33
- email: string;
34
34
  site_id?: string | undefined;
35
35
  }>;
36
36
  declare const msActivateSiteSchema: z.ZodObject<{
@@ -5,9 +5,9 @@ declare const searchPluginRepositorySchema: z.ZodObject<{
5
5
  page: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
6
6
  per_page: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
7
7
  }, "strict", z.ZodTypeAny, {
8
+ search: string;
8
9
  page: number;
9
10
  per_page: number;
10
- search: string;
11
11
  }, {
12
12
  search: string;
13
13
  page?: number | undefined;