neuron-mcp-server 1.0.0 → 1.1.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.
- package/.env +13 -0
- package/AI_PERSONALITY_DESIGN_RESEARCH.md +1020 -0
- package/Dockerfile +18 -0
- package/README.md +146 -131
- package/dist/client.d.ts +6 -0
- package/dist/client.js +50 -12
- package/dist/client.js.map +1 -1
- package/dist/index.js +51 -7
- package/dist/index.js.map +1 -1
- package/dist/tools/ai.js +9 -3
- package/dist/tools/ai.js.map +1 -1
- package/dist/tools/approvals.d.ts +2 -0
- package/dist/tools/approvals.js +181 -0
- package/dist/tools/approvals.js.map +1 -0
- package/dist/tools/audit.js +7 -4
- package/dist/tools/audit.js.map +1 -1
- package/dist/tools/auth.js +119 -19
- package/dist/tools/auth.js.map +1 -1
- package/dist/tools/billing.js +22 -6
- package/dist/tools/billing.js.map +1 -1
- package/dist/tools/blog.js +98 -34
- package/dist/tools/blog.js.map +1 -1
- package/dist/tools/bot-api-keys.js +27 -12
- package/dist/tools/bot-api-keys.js.map +1 -1
- package/dist/tools/bot-api.js +53 -27
- package/dist/tools/bot-api.js.map +1 -1
- package/dist/tools/bots.js +116 -68
- package/dist/tools/bots.js.map +1 -1
- package/dist/tools/broadcasts.js +78 -38
- package/dist/tools/broadcasts.js.map +1 -1
- package/dist/tools/builtin-tools.js +19 -12
- package/dist/tools/builtin-tools.js.map +1 -1
- package/dist/tools/campaigns.js +149 -61
- package/dist/tools/campaigns.js.map +1 -1
- package/dist/tools/channels.js +163 -53
- package/dist/tools/channels.js.map +1 -1
- package/dist/tools/contact-lists.js +111 -51
- package/dist/tools/contact-lists.js.map +1 -1
- package/dist/tools/contacts.js +117 -44
- package/dist/tools/contacts.js.map +1 -1
- package/dist/tools/conversations.js +95 -50
- package/dist/tools/conversations.js.map +1 -1
- package/dist/tools/flows.d.ts +2 -0
- package/dist/tools/flows.js +242 -0
- package/dist/tools/flows.js.map +1 -0
- package/dist/tools/group-management.d.ts +2 -0
- package/dist/tools/group-management.js +239 -0
- package/dist/tools/group-management.js.map +1 -0
- package/dist/tools/leads.d.ts +2 -0
- package/dist/tools/leads.js +100 -0
- package/dist/tools/leads.js.map +1 -0
- package/dist/tools/list-campaigns.d.ts +2 -0
- package/dist/tools/list-campaigns.js +152 -0
- package/dist/tools/list-campaigns.js.map +1 -0
- package/dist/tools/list-pool.js +250 -33
- package/dist/tools/list-pool.js.map +1 -1
- package/dist/tools/media.js +12 -7
- package/dist/tools/media.js.map +1 -1
- package/dist/tools/newsletters.js +106 -26
- package/dist/tools/newsletters.js.map +1 -1
- package/dist/tools/organizations.js +76 -35
- package/dist/tools/organizations.js.map +1 -1
- package/dist/tools/outbound-webhooks.js +32 -20
- package/dist/tools/outbound-webhooks.js.map +1 -1
- package/dist/tools/payouts.js +44 -17
- package/dist/tools/payouts.js.map +1 -1
- package/dist/tools/personas.d.ts +2 -0
- package/dist/tools/personas.js +141 -0
- package/dist/tools/personas.js.map +1 -0
- package/dist/tools/polls.d.ts +2 -0
- package/dist/tools/polls.js +30 -0
- package/dist/tools/polls.js.map +1 -0
- package/dist/tools/pool.js +101 -43
- package/dist/tools/pool.js.map +1 -1
- package/dist/tools/products.d.ts +2 -0
- package/dist/tools/products.js +277 -0
- package/dist/tools/products.js.map +1 -0
- package/dist/tools/profile-privacy.d.ts +2 -0
- package/dist/tools/profile-privacy.js +195 -0
- package/dist/tools/profile-privacy.js.map +1 -0
- package/dist/tools/reflections.js +25 -13
- package/dist/tools/reflections.js.map +1 -1
- package/dist/tools/scheduled-messages.d.ts +2 -0
- package/dist/tools/scheduled-messages.js +124 -0
- package/dist/tools/scheduled-messages.js.map +1 -0
- package/dist/tools/social-channels.d.ts +2 -0
- package/dist/tools/social-channels.js +318 -0
- package/dist/tools/social-channels.js.map +1 -0
- package/dist/tools/tasks.d.ts +2 -0
- package/dist/tools/tasks.js +155 -0
- package/dist/tools/tasks.js.map +1 -0
- package/dist/tools/tools.js +86 -40
- package/dist/tools/tools.js.map +1 -1
- package/dist/tools/wallets.js +34 -12
- package/dist/tools/wallets.js.map +1 -1
- package/dist/tools/webhooks.js +35 -20
- package/dist/tools/webhooks.js.map +1 -1
- package/dist/tools/whatsapp-actions.d.ts +2 -0
- package/dist/tools/whatsapp-actions.js +186 -0
- package/dist/tools/whatsapp-actions.js.map +1 -0
- package/package.json +4 -31
- package/scripts/setup-delivahere-bot.ts +804 -0
- package/scripts/test-delivahere-bot.ts +128 -0
- package/scripts/update-letschop-prompt.ts +194 -0
- package/server.json +26 -0
- package/smithery.yaml +19 -0
- package/src/client.ts +169 -0
- package/src/index.ts +256 -0
- package/src/tools/ai.ts +35 -0
- package/src/tools/approvals.ts +231 -0
- package/src/tools/audit.ts +49 -0
- package/src/tools/auth.ts +536 -0
- package/src/tools/billing.ts +79 -0
- package/src/tools/blog.ts +264 -0
- package/src/tools/bot-api-keys.ts +87 -0
- package/src/tools/bot-api.ts +193 -0
- package/src/tools/bots.ts +320 -0
- package/src/tools/broadcasts.ts +224 -0
- package/src/tools/builtin-tools.ts +108 -0
- package/src/tools/campaigns.ts +429 -0
- package/src/tools/channels.ts +520 -0
- package/src/tools/contact-lists.ts +320 -0
- package/src/tools/contacts.ts +395 -0
- package/src/tools/conversations.ts +349 -0
- package/src/tools/flows.ts +298 -0
- package/src/tools/group-management.ts +265 -0
- package/src/tools/knowledge-bases.ts +451 -0
- package/src/tools/leads.ts +104 -0
- package/src/tools/list-campaigns.ts +190 -0
- package/src/tools/list-pool.ts +389 -0
- package/src/tools/media.ts +50 -0
- package/src/tools/newsletters.ts +271 -0
- package/src/tools/organizations.ts +287 -0
- package/src/tools/outbound-webhooks.ts +181 -0
- package/src/tools/payouts.ts +133 -0
- package/src/tools/personas.ts +145 -0
- package/src/tools/polls.ts +32 -0
- package/src/tools/pool.ts +293 -0
- package/src/tools/products.ts +280 -0
- package/src/tools/profile-privacy.ts +215 -0
- package/src/tools/reflections.ts +124 -0
- package/src/tools/scheduled-messages.ts +144 -0
- package/src/tools/social-channels.ts +396 -0
- package/src/tools/tasks.ts +198 -0
- package/src/tools/tools.ts +255 -0
- package/src/tools/wallets.ts +107 -0
- package/src/tools/webhooks.ts +166 -0
- package/src/tools/whatsapp-actions.ts +203 -0
- package/tsconfig.json +20 -0
- package/LICENSE +0 -21
package/dist/tools/list-pool.js
CHANGED
|
@@ -4,15 +4,20 @@ export function registerListPoolTools(server) {
|
|
|
4
4
|
// Browse pool
|
|
5
5
|
server.registerTool("neuron_browse_list_pool", {
|
|
6
6
|
title: "Browse List Pool",
|
|
7
|
-
description: "Browse verified contact lists available in the marketplace pool. Filter by category or
|
|
7
|
+
description: "Browse verified contact lists available in the shared marketplace pool. Filter by category, region, or search term.",
|
|
8
8
|
inputSchema: z.object({
|
|
9
|
-
category: z.string().optional().describe("Filter by category (e.g., 'delivery', 'tech', 'consumers')"),
|
|
10
|
-
region: z.string().optional().describe("Filter by region"),
|
|
11
|
-
search: z.string().optional().describe("Search by description or category"),
|
|
12
|
-
page: z.number().optional().describe("Page number"),
|
|
13
|
-
limit: z.number().optional().describe("
|
|
9
|
+
category: z.string().optional().describe("Filter by audience category (e.g., 'delivery', 'tech', 'consumers')"),
|
|
10
|
+
region: z.string().optional().describe("Filter by geographic region (e.g., 'lagos', 'abuja')"),
|
|
11
|
+
search: z.string().optional().describe("Search term to filter by description or category"),
|
|
12
|
+
page: z.number().optional().describe("Page number for pagination (default: 1)"),
|
|
13
|
+
limit: z.number().optional().describe("Number of items per page (default: 20)"),
|
|
14
14
|
}),
|
|
15
|
-
annotations: {
|
|
15
|
+
annotations: {
|
|
16
|
+
readOnlyHint: true,
|
|
17
|
+
destructiveHint: false,
|
|
18
|
+
idempotentHint: true,
|
|
19
|
+
openWorldHint: false,
|
|
20
|
+
},
|
|
16
21
|
}, async (params) => {
|
|
17
22
|
try {
|
|
18
23
|
const result = await api("GET", "/list-pool", undefined, {
|
|
@@ -31,18 +36,24 @@ export function registerListPoolTools(server) {
|
|
|
31
36
|
// Submit to pool
|
|
32
37
|
server.registerTool("neuron_submit_to_list_pool", {
|
|
33
38
|
title: "Submit List to Pool",
|
|
34
|
-
description: "Submit a contact list to the
|
|
39
|
+
description: "Submit a contact list to the shared pool marketplace for other organizations to discover and use for ad distribution.",
|
|
35
40
|
inputSchema: z.object({
|
|
36
|
-
listId: z.string().describe("
|
|
37
|
-
channelId: z.string().describe("WhatsApp channel
|
|
38
|
-
category: z.string().describe("
|
|
39
|
-
description: z.string().optional().describe("
|
|
41
|
+
listId: z.string().describe("Unique identifier (UUID) of the contact list to submit"),
|
|
42
|
+
channelId: z.string().describe("Unique identifier (UUID) of the WhatsApp channel used for sending messages"),
|
|
43
|
+
category: z.string().describe("Audience category (e.g., 'delivery', 'tech', 'consumers', 'food')"),
|
|
44
|
+
description: z.string().optional().describe("Human-readable description of the audience and its characteristics"),
|
|
40
45
|
demographics: z.object({
|
|
41
|
-
regions: z.array(z.string()).optional(),
|
|
42
|
-
tags: z.array(z.string()).optional(),
|
|
43
|
-
}).optional().describe("Demographic information"),
|
|
44
|
-
pricePerDelivery: z.number().describe("Price per delivery in kobo"),
|
|
46
|
+
regions: z.array(z.string()).optional().describe("Geographic regions covered (e.g., ['lagos', 'abuja'])"),
|
|
47
|
+
tags: z.array(z.string()).optional().describe("Demographic tags describing the audience (e.g., ['young-adults', 'tech-savvy'])"),
|
|
48
|
+
}).optional().describe("Demographic information about the contact list audience"),
|
|
49
|
+
pricePerDelivery: z.number().describe("Price per successful message delivery in kobo (e.g., 5000 = NGN 50)"),
|
|
45
50
|
}),
|
|
51
|
+
annotations: {
|
|
52
|
+
readOnlyHint: false,
|
|
53
|
+
destructiveHint: false,
|
|
54
|
+
idempotentHint: false,
|
|
55
|
+
openWorldHint: false,
|
|
56
|
+
},
|
|
46
57
|
}, async (params) => {
|
|
47
58
|
try {
|
|
48
59
|
const result = await api("POST", "/list-pool", params);
|
|
@@ -55,18 +66,24 @@ export function registerListPoolTools(server) {
|
|
|
55
66
|
// Create ad request
|
|
56
67
|
server.registerTool("neuron_create_ad_request", {
|
|
57
68
|
title: "Create Ad Request",
|
|
58
|
-
description: "Create an ad request to
|
|
69
|
+
description: "Create an ad distribution request to send a message to contacts in pool lists matching target demographics. Deducts from wallet upon approval.",
|
|
59
70
|
inputSchema: z.object({
|
|
60
|
-
message: z.string().describe("The ad message content"),
|
|
61
|
-
messageType: z.string().optional().describe("Message type
|
|
62
|
-
mediaUrl: z.string().optional().describe("Media URL for non-text messages"),
|
|
71
|
+
message: z.string().describe("The ad message content to distribute to matched contacts"),
|
|
72
|
+
messageType: z.string().optional().describe("Message content type: 'text', 'image', 'video', or 'document' (default: 'text')"),
|
|
73
|
+
mediaUrl: z.string().optional().describe("Media URL for non-text messages (required when messageType is 'image', 'video', or 'document')"),
|
|
63
74
|
targetDemographics: z.object({
|
|
64
|
-
categories: z.array(z.string()).optional().describe("Target categories"),
|
|
65
|
-
regions: z.array(z.string()).optional().describe("Target regions"),
|
|
66
|
-
}).describe("
|
|
67
|
-
targetGoal: z.number().describe("Target number of deliveries"),
|
|
68
|
-
budget: z.number().describe("Total budget in kobo"),
|
|
75
|
+
categories: z.array(z.string()).optional().describe("Target audience categories to match (e.g., ['delivery', 'tech'])"),
|
|
76
|
+
regions: z.array(z.string()).optional().describe("Target geographic regions to match (e.g., ['lagos', 'abuja'])"),
|
|
77
|
+
}).describe("Demographic criteria to match against pool list entries"),
|
|
78
|
+
targetGoal: z.number().describe("Target number of successful message deliveries"),
|
|
79
|
+
budget: z.number().describe("Total ad budget in kobo (e.g., 500000 = NGN 5,000)"),
|
|
69
80
|
}),
|
|
81
|
+
annotations: {
|
|
82
|
+
readOnlyHint: false,
|
|
83
|
+
destructiveHint: false,
|
|
84
|
+
idempotentHint: false,
|
|
85
|
+
openWorldHint: false,
|
|
86
|
+
},
|
|
70
87
|
}, async (params) => {
|
|
71
88
|
try {
|
|
72
89
|
const result = await api("POST", "/ad-requests", params);
|
|
@@ -79,13 +96,18 @@ export function registerListPoolTools(server) {
|
|
|
79
96
|
// List ad requests
|
|
80
97
|
server.registerTool("neuron_list_ad_requests", {
|
|
81
98
|
title: "List Ad Requests",
|
|
82
|
-
description: "
|
|
99
|
+
description: "Retrieve all ad requests for the current organization with optional status filtering and pagination.",
|
|
83
100
|
inputSchema: z.object({
|
|
84
|
-
status: z.string().optional().describe("Filter by status
|
|
85
|
-
page: z.number().optional(),
|
|
86
|
-
limit: z.number().optional(),
|
|
101
|
+
status: z.string().optional().describe("Filter by request status: 'draft', 'pending_review', 'approved', 'active', 'paused', 'completed', or 'rejected'"),
|
|
102
|
+
page: z.number().optional().describe("Page number for pagination (default: 1)"),
|
|
103
|
+
limit: z.number().optional().describe("Number of items per page (default: 20)"),
|
|
87
104
|
}),
|
|
88
|
-
annotations: {
|
|
105
|
+
annotations: {
|
|
106
|
+
readOnlyHint: true,
|
|
107
|
+
destructiveHint: false,
|
|
108
|
+
idempotentHint: true,
|
|
109
|
+
openWorldHint: false,
|
|
110
|
+
},
|
|
89
111
|
}, async (params) => {
|
|
90
112
|
try {
|
|
91
113
|
const result = await api("GET", "/ad-requests", undefined, {
|
|
@@ -102,11 +124,16 @@ export function registerListPoolTools(server) {
|
|
|
102
124
|
// Get ad request analytics
|
|
103
125
|
server.registerTool("neuron_get_ad_request_analytics", {
|
|
104
126
|
title: "Get Ad Request Analytics",
|
|
105
|
-
description: "
|
|
127
|
+
description: "Retrieve delivery analytics and performance breakdown for a specific ad request, including delivery rates and cost metrics.",
|
|
106
128
|
inputSchema: z.object({
|
|
107
|
-
adRequestId: z.string().describe("
|
|
129
|
+
adRequestId: z.string().describe("Unique identifier (UUID) of the ad request to get analytics for"),
|
|
108
130
|
}),
|
|
109
|
-
annotations: {
|
|
131
|
+
annotations: {
|
|
132
|
+
readOnlyHint: true,
|
|
133
|
+
destructiveHint: false,
|
|
134
|
+
idempotentHint: true,
|
|
135
|
+
openWorldHint: false,
|
|
136
|
+
},
|
|
110
137
|
}, async (params) => {
|
|
111
138
|
try {
|
|
112
139
|
const result = await api("GET", `/ad-requests/${params.adRequestId}/analytics`);
|
|
@@ -116,5 +143,195 @@ export function registerListPoolTools(server) {
|
|
|
116
143
|
return errorResult(error);
|
|
117
144
|
}
|
|
118
145
|
});
|
|
146
|
+
// Get ad request by ID
|
|
147
|
+
server.registerTool("neuron_get_ad_request", {
|
|
148
|
+
title: "Get Ad Request",
|
|
149
|
+
description: "Get detailed information about a specific ad request, including pool selections if targeting mode is manual.",
|
|
150
|
+
inputSchema: z.object({
|
|
151
|
+
adRequestId: z.string().describe("Unique identifier (UUID) of the ad request"),
|
|
152
|
+
}),
|
|
153
|
+
annotations: {
|
|
154
|
+
readOnlyHint: true,
|
|
155
|
+
destructiveHint: false,
|
|
156
|
+
idempotentHint: true,
|
|
157
|
+
openWorldHint: false,
|
|
158
|
+
},
|
|
159
|
+
}, async (params) => {
|
|
160
|
+
try {
|
|
161
|
+
const result = await api("GET", `/ad-requests/${params.adRequestId}`);
|
|
162
|
+
return jsonResult(result);
|
|
163
|
+
}
|
|
164
|
+
catch (error) {
|
|
165
|
+
return errorResult(error);
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
// Update ad request
|
|
169
|
+
server.registerTool("neuron_update_ad_request", {
|
|
170
|
+
title: "Update Ad Request",
|
|
171
|
+
description: "Update a draft or rejected ad request. Only draft and rejected ad requests can be edited. Rejected requests revert to draft on update.",
|
|
172
|
+
inputSchema: z.object({
|
|
173
|
+
adRequestId: z.string().describe("Unique identifier (UUID) of the ad request to update"),
|
|
174
|
+
message: z.string().optional().describe("Updated ad message content"),
|
|
175
|
+
messageType: z.string().optional().describe("Updated message type: 'text', 'image', 'video', or 'document'"),
|
|
176
|
+
mediaUrl: z.string().optional().describe("Updated media URL (set to null to clear)"),
|
|
177
|
+
targetDemographics: z.object({
|
|
178
|
+
categories: z.array(z.string()).optional().describe("Updated target categories"),
|
|
179
|
+
regions: z.array(z.string()).optional().describe("Updated target regions"),
|
|
180
|
+
}).optional().describe("Updated demographic targeting criteria"),
|
|
181
|
+
targetingMode: z.enum(["auto", "manual"]).optional().describe("Targeting mode: 'auto' for system matching or 'manual' for hand-picked pool entries"),
|
|
182
|
+
targetType: z.enum(["contacts", "groups"]).optional().describe("Target type: 'contacts' or 'groups'"),
|
|
183
|
+
selectedPoolEntryIds: z.array(z.string()).optional().describe("Pool entry UUIDs for manual contact targeting"),
|
|
184
|
+
selectedGroupPoolEntryIds: z.array(z.string()).optional().describe("Group pool entry UUIDs for manual group targeting"),
|
|
185
|
+
targetGoal: z.number().optional().describe("Updated target number of deliveries"),
|
|
186
|
+
budget: z.number().optional().describe("Updated budget in kobo"),
|
|
187
|
+
}),
|
|
188
|
+
annotations: {
|
|
189
|
+
readOnlyHint: false,
|
|
190
|
+
destructiveHint: false,
|
|
191
|
+
idempotentHint: true,
|
|
192
|
+
openWorldHint: false,
|
|
193
|
+
},
|
|
194
|
+
}, async (params) => {
|
|
195
|
+
try {
|
|
196
|
+
const { adRequestId, ...body } = params;
|
|
197
|
+
const result = await api("PUT", `/ad-requests/${adRequestId}`, body);
|
|
198
|
+
return jsonResult(result);
|
|
199
|
+
}
|
|
200
|
+
catch (error) {
|
|
201
|
+
return errorResult(error);
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
// Delete ad request
|
|
205
|
+
server.registerTool("neuron_delete_ad_request", {
|
|
206
|
+
title: "Delete Ad Request",
|
|
207
|
+
description: "Permanently delete a draft ad request. Only ad requests in draft status can be deleted.",
|
|
208
|
+
inputSchema: z.object({
|
|
209
|
+
adRequestId: z.string().describe("Unique identifier (UUID) of the draft ad request to delete"),
|
|
210
|
+
}),
|
|
211
|
+
annotations: {
|
|
212
|
+
readOnlyHint: false,
|
|
213
|
+
destructiveHint: true,
|
|
214
|
+
idempotentHint: false,
|
|
215
|
+
openWorldHint: false,
|
|
216
|
+
},
|
|
217
|
+
}, async (params) => {
|
|
218
|
+
try {
|
|
219
|
+
const result = await api("DELETE", `/ad-requests/${params.adRequestId}`);
|
|
220
|
+
return jsonResult(result);
|
|
221
|
+
}
|
|
222
|
+
catch (error) {
|
|
223
|
+
return errorResult(error);
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
// Submit ad request for review
|
|
227
|
+
server.registerTool("neuron_submit_ad_request", {
|
|
228
|
+
title: "Submit Ad Request for Review",
|
|
229
|
+
description: "Submit a draft ad request for admin review. The request must be in draft status. After submission, an admin must approve it before it can be funded.",
|
|
230
|
+
inputSchema: z.object({
|
|
231
|
+
adRequestId: z.string().describe("Unique identifier (UUID) of the draft ad request to submit"),
|
|
232
|
+
}),
|
|
233
|
+
annotations: {
|
|
234
|
+
readOnlyHint: false,
|
|
235
|
+
destructiveHint: false,
|
|
236
|
+
idempotentHint: false,
|
|
237
|
+
openWorldHint: false,
|
|
238
|
+
},
|
|
239
|
+
}, async (params) => {
|
|
240
|
+
try {
|
|
241
|
+
const result = await api("POST", `/ad-requests/${params.adRequestId}/submit`);
|
|
242
|
+
return jsonResult(result);
|
|
243
|
+
}
|
|
244
|
+
catch (error) {
|
|
245
|
+
return errorResult(error);
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
// Fund ad request from wallet
|
|
249
|
+
server.registerTool("neuron_fund_ad_request", {
|
|
250
|
+
title: "Fund Ad Request",
|
|
251
|
+
description: "Fund an approved ad request from the organization wallet. This debits the budget amount and activates the campaign for distribution. If wallet balance is insufficient, returns shortfall information instead of an error.",
|
|
252
|
+
inputSchema: z.object({
|
|
253
|
+
adRequestId: z.string().describe("Unique identifier (UUID) of the approved ad request to fund"),
|
|
254
|
+
}),
|
|
255
|
+
annotations: {
|
|
256
|
+
readOnlyHint: false,
|
|
257
|
+
destructiveHint: false,
|
|
258
|
+
idempotentHint: false,
|
|
259
|
+
openWorldHint: false,
|
|
260
|
+
},
|
|
261
|
+
}, async (params) => {
|
|
262
|
+
try {
|
|
263
|
+
const result = await api("POST", `/ad-requests/${params.adRequestId}/fund`);
|
|
264
|
+
return jsonResult(result);
|
|
265
|
+
}
|
|
266
|
+
catch (error) {
|
|
267
|
+
return errorResult(error);
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
// Pause ad request
|
|
271
|
+
server.registerTool("neuron_pause_ad_request", {
|
|
272
|
+
title: "Pause Ad Request",
|
|
273
|
+
description: "Pause an active ad request campaign. Distribution stops until resumed. Only active ad requests can be paused.",
|
|
274
|
+
inputSchema: z.object({
|
|
275
|
+
adRequestId: z.string().describe("Unique identifier (UUID) of the active ad request to pause"),
|
|
276
|
+
}),
|
|
277
|
+
annotations: {
|
|
278
|
+
readOnlyHint: false,
|
|
279
|
+
destructiveHint: false,
|
|
280
|
+
idempotentHint: true,
|
|
281
|
+
openWorldHint: false,
|
|
282
|
+
},
|
|
283
|
+
}, async (params) => {
|
|
284
|
+
try {
|
|
285
|
+
const result = await api("POST", `/ad-requests/${params.adRequestId}/pause`);
|
|
286
|
+
return jsonResult(result);
|
|
287
|
+
}
|
|
288
|
+
catch (error) {
|
|
289
|
+
return errorResult(error);
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
// Resume ad request
|
|
293
|
+
server.registerTool("neuron_resume_ad_request", {
|
|
294
|
+
title: "Resume Ad Request",
|
|
295
|
+
description: "Resume a paused ad request campaign. Distribution resumes from where it left off. Only paused ad requests can be resumed.",
|
|
296
|
+
inputSchema: z.object({
|
|
297
|
+
adRequestId: z.string().describe("Unique identifier (UUID) of the paused ad request to resume"),
|
|
298
|
+
}),
|
|
299
|
+
annotations: {
|
|
300
|
+
readOnlyHint: false,
|
|
301
|
+
destructiveHint: false,
|
|
302
|
+
idempotentHint: true,
|
|
303
|
+
openWorldHint: false,
|
|
304
|
+
},
|
|
305
|
+
}, async (params) => {
|
|
306
|
+
try {
|
|
307
|
+
const result = await api("POST", `/ad-requests/${params.adRequestId}/resume`);
|
|
308
|
+
return jsonResult(result);
|
|
309
|
+
}
|
|
310
|
+
catch (error) {
|
|
311
|
+
return errorResult(error);
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
// Stop ad request
|
|
315
|
+
server.registerTool("neuron_stop_ad_request", {
|
|
316
|
+
title: "Stop Ad Request",
|
|
317
|
+
description: "Stop an active or paused ad request campaign permanently. Any remaining unspent budget is refunded to the organization wallet. This cannot be undone.",
|
|
318
|
+
inputSchema: z.object({
|
|
319
|
+
adRequestId: z.string().describe("Unique identifier (UUID) of the ad request to stop"),
|
|
320
|
+
}),
|
|
321
|
+
annotations: {
|
|
322
|
+
readOnlyHint: false,
|
|
323
|
+
destructiveHint: true,
|
|
324
|
+
idempotentHint: false,
|
|
325
|
+
openWorldHint: false,
|
|
326
|
+
},
|
|
327
|
+
}, async (params) => {
|
|
328
|
+
try {
|
|
329
|
+
const result = await api("POST", `/ad-requests/${params.adRequestId}/stop`);
|
|
330
|
+
return jsonResult(result);
|
|
331
|
+
}
|
|
332
|
+
catch (error) {
|
|
333
|
+
return errorResult(error);
|
|
334
|
+
}
|
|
335
|
+
});
|
|
119
336
|
}
|
|
120
337
|
//# sourceMappingURL=list-pool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-pool.js","sourceRoot":"","sources":["../../src/tools/list-pool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE5D,MAAM,UAAU,qBAAqB,CAAC,MAAiB;IACrD,cAAc;IACd,MAAM,CAAC,YAAY,CACjB,yBAAyB,EACzB;QACE,KAAK,EAAE,kBAAkB;QACzB,WAAW,EAAE,gGAAgG;QAC7G,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACpB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4DAA4D,CAAC;YACtG,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kBAAk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gBAAgB,MAAM,CAAC,WAAW,OAAO,CAAC,CAAC;YAC5E,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC;QAC5B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/tools/media.js
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { jsonResult, errorResult, getAuthToken } from "../client.js";
|
|
2
|
+
import { jsonResult, errorResult, getAuthToken, getBaseUrl } from "../client.js";
|
|
3
3
|
import axios from "axios";
|
|
4
4
|
import FormData from "form-data";
|
|
5
|
-
const BASE_URL = process.env.NEURON_API_URL || "https://api.neuron.ng/api/v1";
|
|
6
5
|
export function registerMediaTools(server) {
|
|
7
6
|
// Upload media
|
|
8
7
|
server.registerTool("neuron_upload_media", {
|
|
9
8
|
title: "Upload Media",
|
|
10
|
-
description: "Upload a media file (image,
|
|
9
|
+
description: "Upload a media file (image, video, audio, or document) by providing its base64-encoded content. Returns a URL for use in messages and broadcasts.",
|
|
11
10
|
inputSchema: z.object({
|
|
12
|
-
base64: z.string().describe("Base64-encoded file content"),
|
|
13
|
-
filename: z.string().describe("Original filename including extension (e.g., 'photo.jpg')"),
|
|
14
|
-
mimetype: z.string().describe("MIME type of the file (e.g., 'image/jpeg', 'application/pdf')"),
|
|
11
|
+
base64: z.string().describe("Base64-encoded file content (without data URI prefix)"),
|
|
12
|
+
filename: z.string().describe("Original filename including extension (e.g., 'photo.jpg', 'report.pdf')"),
|
|
13
|
+
mimetype: z.string().describe("MIME type of the file (e.g., 'image/jpeg', 'image/png', 'application/pdf', 'video/mp4')"),
|
|
15
14
|
}),
|
|
15
|
+
annotations: {
|
|
16
|
+
readOnlyHint: false,
|
|
17
|
+
destructiveHint: false,
|
|
18
|
+
idempotentHint: false,
|
|
19
|
+
openWorldHint: false,
|
|
20
|
+
},
|
|
16
21
|
}, async (params) => {
|
|
17
22
|
try {
|
|
18
23
|
const buffer = Buffer.from(params.base64, "base64");
|
|
@@ -22,7 +27,7 @@ export function registerMediaTools(server) {
|
|
|
22
27
|
contentType: params.mimetype,
|
|
23
28
|
});
|
|
24
29
|
const token = getAuthToken();
|
|
25
|
-
const response = await axios.post(`${
|
|
30
|
+
const response = await axios.post(`${getBaseUrl()}/media/upload`, form, {
|
|
26
31
|
headers: {
|
|
27
32
|
...form.getHeaders(),
|
|
28
33
|
...(token ? { Authorization: `Bearer ${token}` } : {}),
|
package/dist/tools/media.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.js","sourceRoot":"","sources":["../../src/tools/media.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"media.js","sourceRoot":"","sources":["../../src/tools/media.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACjF,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,WAAW,CAAC;AAEjC,MAAM,UAAU,kBAAkB,CAAC,MAAiB;IAClD,eAAe;IACf,MAAM,CAAC,YAAY,CACjB,qBAAqB,EACrB;QACE,KAAK,EAAE,cAAc;QACrB,WAAW,EAAE,mJAAmJ;QAChK,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;YACpB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uDAAuD,CAAC;YACpF,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yEAAyE,CAAC;YACxG,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yFAAyF,CAAC;SACzH,CAAC;QACF,WAAW,EAAE;YACX,YAAY,EAAE,KAAK;YACnB,eAAe,EAAE,KAAK;YACtB,cAAc,EAAE,KAAK;YACrB,aAAa,EAAE,KAAK;SACrB;KACF,EACD,KAAK,EAAE,MAAM,EAAE,EAAE;QACf,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;YACpD,MAAM,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;YAC5B,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE;gBAC1B,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,WAAW,EAAE,MAAM,CAAC,QAAQ;aAC7B,CAAC,CAAC;YAEH,MAAM,KAAK,GAAG,YAAY,EAAE,CAAC;YAC7B,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,GAAG,UAAU,EAAE,eAAe,EAAE,IAAI,EAAE;gBACtE,OAAO,EAAE;oBACP,GAAG,IAAI,CAAC,UAAU,EAAE;oBACpB,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,UAAU,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;iBACvD;gBACD,OAAO,EAAE,KAAK;aACf,CAAC,CAAC;YAEH,OAAO,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACnC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,WAAW,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -4,13 +4,18 @@ export function registerNewsletterTools(server) {
|
|
|
4
4
|
// 1. List newsletters
|
|
5
5
|
server.registerTool("neuron_list_newsletters", {
|
|
6
6
|
title: "List Newsletters",
|
|
7
|
-
description: "
|
|
7
|
+
description: "Retrieve a paginated list of all WhatsApp Channel newsletters for the organization, with optional filtering by WhatsApp session channel.",
|
|
8
8
|
inputSchema: z.object({
|
|
9
|
-
channelId: z.string().optional().describe("Filter newsletters by WhatsApp session channel
|
|
10
|
-
page: z.number().int().positive().optional().describe("Page number for pagination"),
|
|
11
|
-
limit: z.number().int().positive().optional().describe("Number of items per page"),
|
|
9
|
+
channelId: z.string().optional().describe("Filter newsletters by WhatsApp session channel identifier (UUID)"),
|
|
10
|
+
page: z.number().int().positive().optional().describe("Page number for pagination (default: 1)"),
|
|
11
|
+
limit: z.number().int().positive().optional().describe("Number of items per page (default: 20)"),
|
|
12
12
|
}),
|
|
13
|
-
annotations: {
|
|
13
|
+
annotations: {
|
|
14
|
+
readOnlyHint: true,
|
|
15
|
+
destructiveHint: false,
|
|
16
|
+
idempotentHint: true,
|
|
17
|
+
openWorldHint: false,
|
|
18
|
+
},
|
|
14
19
|
}, async (args) => {
|
|
15
20
|
try {
|
|
16
21
|
const response = await api("GET", "/newsletters", undefined, {
|
|
@@ -27,12 +32,18 @@ export function registerNewsletterTools(server) {
|
|
|
27
32
|
// 2. Create newsletter
|
|
28
33
|
server.registerTool("neuron_create_newsletter", {
|
|
29
34
|
title: "Create Newsletter",
|
|
30
|
-
description: "Create a new WhatsApp Channel
|
|
35
|
+
description: "Create a new WhatsApp Channel newsletter for one-way broadcast updates. Requires a connected Baileys session on the specified channel.",
|
|
31
36
|
inputSchema: z.object({
|
|
32
|
-
channelId: z.string().describe("
|
|
33
|
-
name: z.string().describe("
|
|
34
|
-
description: z.string().optional().describe("Description of the newsletter"),
|
|
37
|
+
channelId: z.string().describe("Identifier (UUID) of the WhatsApp session channel to create the newsletter on"),
|
|
38
|
+
name: z.string().describe("Display name of the newsletter visible to subscribers"),
|
|
39
|
+
description: z.string().optional().describe("Description of the newsletter's purpose and content"),
|
|
35
40
|
}),
|
|
41
|
+
annotations: {
|
|
42
|
+
readOnlyHint: false,
|
|
43
|
+
destructiveHint: false,
|
|
44
|
+
idempotentHint: false,
|
|
45
|
+
openWorldHint: false,
|
|
46
|
+
},
|
|
36
47
|
}, async (args) => {
|
|
37
48
|
try {
|
|
38
49
|
const response = await api("POST", "/newsletters", args);
|
|
@@ -45,11 +56,16 @@ export function registerNewsletterTools(server) {
|
|
|
45
56
|
// 3. Get newsletter
|
|
46
57
|
server.registerTool("neuron_get_newsletter", {
|
|
47
58
|
title: "Get Newsletter",
|
|
48
|
-
description: "
|
|
59
|
+
description: "Retrieve detailed information about a specific WhatsApp Channel newsletter, including subscriber count and metadata.",
|
|
49
60
|
inputSchema: z.object({
|
|
50
|
-
id: z.string().describe("
|
|
61
|
+
id: z.string().describe("Unique identifier (UUID) of the newsletter to retrieve"),
|
|
51
62
|
}),
|
|
52
|
-
annotations: {
|
|
63
|
+
annotations: {
|
|
64
|
+
readOnlyHint: true,
|
|
65
|
+
destructiveHint: false,
|
|
66
|
+
idempotentHint: true,
|
|
67
|
+
openWorldHint: false,
|
|
68
|
+
},
|
|
53
69
|
}, async (args) => {
|
|
54
70
|
try {
|
|
55
71
|
const response = await api("GET", `/newsletters/${args.id}`);
|
|
@@ -62,12 +78,18 @@ export function registerNewsletterTools(server) {
|
|
|
62
78
|
// 4. Update newsletter
|
|
63
79
|
server.registerTool("neuron_update_newsletter", {
|
|
64
80
|
title: "Update Newsletter",
|
|
65
|
-
description: "Update the name or description of
|
|
81
|
+
description: "Update the name or description of an existing WhatsApp Channel newsletter. Only provided fields are changed.",
|
|
66
82
|
inputSchema: z.object({
|
|
67
|
-
id: z.string().describe("
|
|
68
|
-
name: z.string().optional().describe("New name for the newsletter"),
|
|
83
|
+
id: z.string().describe("Unique identifier (UUID) of the newsletter to update"),
|
|
84
|
+
name: z.string().optional().describe("New display name for the newsletter"),
|
|
69
85
|
description: z.string().optional().describe("New description for the newsletter"),
|
|
70
86
|
}),
|
|
87
|
+
annotations: {
|
|
88
|
+
readOnlyHint: false,
|
|
89
|
+
destructiveHint: false,
|
|
90
|
+
idempotentHint: true,
|
|
91
|
+
openWorldHint: false,
|
|
92
|
+
},
|
|
71
93
|
}, async (args) => {
|
|
72
94
|
try {
|
|
73
95
|
const { id, ...updateData } = args;
|
|
@@ -81,10 +103,16 @@ export function registerNewsletterTools(server) {
|
|
|
81
103
|
// 5. Delete newsletter
|
|
82
104
|
server.registerTool("neuron_delete_newsletter", {
|
|
83
105
|
title: "Delete Newsletter",
|
|
84
|
-
description: "
|
|
106
|
+
description: "Permanently delete a WhatsApp Channel newsletter and remove it from WhatsApp. This action cannot be undone.",
|
|
85
107
|
inputSchema: z.object({
|
|
86
|
-
id: z.string().describe("
|
|
108
|
+
id: z.string().describe("Unique identifier (UUID) of the newsletter to delete"),
|
|
87
109
|
}),
|
|
110
|
+
annotations: {
|
|
111
|
+
readOnlyHint: false,
|
|
112
|
+
destructiveHint: true,
|
|
113
|
+
idempotentHint: true,
|
|
114
|
+
openWorldHint: false,
|
|
115
|
+
},
|
|
88
116
|
}, async (args) => {
|
|
89
117
|
try {
|
|
90
118
|
const response = await api("DELETE", `/newsletters/${args.id}`);
|
|
@@ -97,13 +125,19 @@ export function registerNewsletterTools(server) {
|
|
|
97
125
|
// 6. Post to newsletter
|
|
98
126
|
server.registerTool("neuron_post_to_newsletter", {
|
|
99
127
|
title: "Post to Newsletter",
|
|
100
|
-
description: "Post a message
|
|
128
|
+
description: "Post a message to a WhatsApp Channel newsletter. All subscribers receive the message. Provide at least one of text or mediaUrl. This triggers delivery and cannot be undone.",
|
|
101
129
|
inputSchema: z.object({
|
|
102
|
-
id: z.string().describe("
|
|
103
|
-
text: z.string().optional().describe("
|
|
104
|
-
messageType: z.enum(["text", "image", "video", "document"]).default("text").describe("
|
|
105
|
-
mediaUrl: z.string().optional().describe("URL of the media file to attach (image, video, or document)"),
|
|
130
|
+
id: z.string().describe("Unique identifier (UUID) of the newsletter to post to"),
|
|
131
|
+
text: z.string().optional().describe("Message text or caption to post to the newsletter"),
|
|
132
|
+
messageType: z.enum(["text", "image", "video", "document"]).default("text").describe("Type of message to send (default: 'text')"),
|
|
133
|
+
mediaUrl: z.string().optional().describe("URL of the media file to attach (required for image, video, or document types)"),
|
|
106
134
|
}),
|
|
135
|
+
annotations: {
|
|
136
|
+
readOnlyHint: false,
|
|
137
|
+
destructiveHint: false,
|
|
138
|
+
idempotentHint: false,
|
|
139
|
+
openWorldHint: false,
|
|
140
|
+
},
|
|
107
141
|
}, async (args) => {
|
|
108
142
|
try {
|
|
109
143
|
const body = {
|
|
@@ -118,13 +152,53 @@ export function registerNewsletterTools(server) {
|
|
|
118
152
|
return errorResult(error);
|
|
119
153
|
}
|
|
120
154
|
});
|
|
155
|
+
// 6b. Post to WhatsApp Status / Story
|
|
156
|
+
server.registerTool("neuron_post_to_status", {
|
|
157
|
+
title: "Post to WhatsApp Status",
|
|
158
|
+
description: "Post a WhatsApp Status / Story from a connected direct (Baileys) WhatsApp number. Visible to the account's synced contacts for 24 hours — you do NOT specify recipients (the contact list is built automatically; pass statusJidList only to target a subset). Provide at least one of text or mediaUrl. channelId is optional and auto-resolves to the default connected number. This triggers delivery and cannot be undone.",
|
|
159
|
+
inputSchema: z.object({
|
|
160
|
+
text: z.string().optional().describe("Status text (for a text story) or caption (for media)"),
|
|
161
|
+
messageType: z.enum(["text", "image", "video", "audio"]).default("text").describe("Type of status (default: 'text')"),
|
|
162
|
+
mediaUrl: z.string().optional().describe("URL of the image/video/audio to post (required for non-text statuses)"),
|
|
163
|
+
channelId: z.string().optional().describe("WhatsApp session channel UUID to post from. Omit to auto-resolve."),
|
|
164
|
+
backgroundColor: z.string().optional().describe("Text-status background colour as hex, e.g. '#315575'"),
|
|
165
|
+
font: z.number().int().min(0).max(9).optional().describe("Text-status font index (0–9)"),
|
|
166
|
+
}),
|
|
167
|
+
annotations: {
|
|
168
|
+
readOnlyHint: false,
|
|
169
|
+
destructiveHint: false,
|
|
170
|
+
idempotentHint: false,
|
|
171
|
+
openWorldHint: false,
|
|
172
|
+
},
|
|
173
|
+
}, async (args) => {
|
|
174
|
+
try {
|
|
175
|
+
const response = await api("POST", "/conversations/compose-story", {
|
|
176
|
+
text: args.text,
|
|
177
|
+
messageType: args.messageType,
|
|
178
|
+
mediaUrl: args.mediaUrl,
|
|
179
|
+
channelId: args.channelId,
|
|
180
|
+
backgroundColor: args.backgroundColor,
|
|
181
|
+
font: args.font,
|
|
182
|
+
});
|
|
183
|
+
return jsonResult(response);
|
|
184
|
+
}
|
|
185
|
+
catch (error) {
|
|
186
|
+
return errorResult(error);
|
|
187
|
+
}
|
|
188
|
+
});
|
|
121
189
|
// 7. Refresh newsletter metadata
|
|
122
190
|
server.registerTool("neuron_refresh_newsletter", {
|
|
123
191
|
title: "Refresh Newsletter",
|
|
124
|
-
description: "Re-fetch metadata (name, description, subscriber count) for a WhatsApp Channel newsletter from WhatsApp",
|
|
192
|
+
description: "Re-fetch metadata (name, description, subscriber count) for a WhatsApp Channel newsletter from WhatsApp to synchronize local data.",
|
|
125
193
|
inputSchema: z.object({
|
|
126
|
-
id: z.string().describe("
|
|
194
|
+
id: z.string().describe("Unique identifier (UUID) of the newsletter to refresh"),
|
|
127
195
|
}),
|
|
196
|
+
annotations: {
|
|
197
|
+
readOnlyHint: false,
|
|
198
|
+
destructiveHint: false,
|
|
199
|
+
idempotentHint: true,
|
|
200
|
+
openWorldHint: false,
|
|
201
|
+
},
|
|
128
202
|
}, async (args) => {
|
|
129
203
|
try {
|
|
130
204
|
const response = await api("POST", `/newsletters/${args.id}/refresh`);
|
|
@@ -137,10 +211,16 @@ export function registerNewsletterTools(server) {
|
|
|
137
211
|
// 8. Sync newsletters from WhatsApp
|
|
138
212
|
server.registerTool("neuron_sync_newsletters", {
|
|
139
213
|
title: "Sync Newsletters",
|
|
140
|
-
description: "
|
|
214
|
+
description: "Synchronize and import WhatsApp Channels from a connected WhatsApp session into Neuron. Discovers channels created outside Neuron.",
|
|
141
215
|
inputSchema: z.object({
|
|
142
|
-
channelId: z.string().describe("
|
|
216
|
+
channelId: z.string().describe("Identifier (UUID) of the WhatsApp session channel to sync newsletters from"),
|
|
143
217
|
}),
|
|
218
|
+
annotations: {
|
|
219
|
+
readOnlyHint: false,
|
|
220
|
+
destructiveHint: false,
|
|
221
|
+
idempotentHint: true,
|
|
222
|
+
openWorldHint: false,
|
|
223
|
+
},
|
|
144
224
|
}, async (args) => {
|
|
145
225
|
try {
|
|
146
226
|
const response = await api("POST", "/newsletters/sync", { channelId: args.channelId });
|