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
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
+
import { api, jsonResult, errorResult } from "../client.js";
|
|
4
|
+
|
|
5
|
+
export function registerCampaignTools(server: McpServer): void {
|
|
6
|
+
server.registerTool(
|
|
7
|
+
"neuron_list_campaigns",
|
|
8
|
+
{
|
|
9
|
+
title: "List Campaigns",
|
|
10
|
+
description: "Retrieve all campaigns for the current organization with optional status filtering and pagination.",
|
|
11
|
+
inputSchema: z.object({
|
|
12
|
+
status: z.string().optional().describe("Filter by campaign status: 'draft', 'active', 'paused', 'completed', 'stopped', or 'rejected'"),
|
|
13
|
+
page: z.number().int().positive().optional().describe("Page number for pagination (default: 1)"),
|
|
14
|
+
limit: z.number().int().positive().optional().describe("Number of campaigns per page (default: 20)"),
|
|
15
|
+
}),
|
|
16
|
+
annotations: {
|
|
17
|
+
readOnlyHint: true,
|
|
18
|
+
destructiveHint: false,
|
|
19
|
+
idempotentHint: true,
|
|
20
|
+
openWorldHint: false,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
async (params) => {
|
|
24
|
+
try {
|
|
25
|
+
const result = await api("GET", "/campaigns", undefined, params);
|
|
26
|
+
return jsonResult(result);
|
|
27
|
+
} catch (error) {
|
|
28
|
+
return errorResult(error);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
server.registerTool(
|
|
34
|
+
"neuron_get_campaign",
|
|
35
|
+
{
|
|
36
|
+
title: "Get Campaign",
|
|
37
|
+
description: "Retrieve detailed information about a specific campaign including its status, budget, participants, and delivery metrics.",
|
|
38
|
+
inputSchema: z.object({
|
|
39
|
+
id: z.string().describe("Unique identifier (UUID) of the campaign"),
|
|
40
|
+
}),
|
|
41
|
+
annotations: {
|
|
42
|
+
readOnlyHint: true,
|
|
43
|
+
destructiveHint: false,
|
|
44
|
+
idempotentHint: true,
|
|
45
|
+
openWorldHint: false,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
async (params) => {
|
|
49
|
+
try {
|
|
50
|
+
const result = await api("GET", `/campaigns/${params.id}`);
|
|
51
|
+
return jsonResult(result);
|
|
52
|
+
} catch (error) {
|
|
53
|
+
return errorResult(error);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
|
|
58
|
+
server.registerTool(
|
|
59
|
+
"neuron_campaign_marketplace",
|
|
60
|
+
{
|
|
61
|
+
title: "Browse Campaign Marketplace",
|
|
62
|
+
description: "Browse available campaigns in the marketplace that your organization can join to earn rewards by sending messages.",
|
|
63
|
+
inputSchema: z.object({
|
|
64
|
+
page: z.number().int().positive().optional().describe("Page number for pagination (default: 1)"),
|
|
65
|
+
limit: z.number().int().positive().optional().describe("Number of campaigns per page (default: 20)"),
|
|
66
|
+
}),
|
|
67
|
+
annotations: {
|
|
68
|
+
readOnlyHint: true,
|
|
69
|
+
destructiveHint: false,
|
|
70
|
+
idempotentHint: true,
|
|
71
|
+
openWorldHint: false,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
async (params) => {
|
|
75
|
+
try {
|
|
76
|
+
const result = await api("GET", "/campaigns/marketplace", undefined, params);
|
|
77
|
+
return jsonResult(result);
|
|
78
|
+
} catch (error) {
|
|
79
|
+
return errorResult(error);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
|
|
84
|
+
server.registerTool(
|
|
85
|
+
"neuron_create_campaign",
|
|
86
|
+
{
|
|
87
|
+
title: "Create Campaign",
|
|
88
|
+
description: "Create a new outreach campaign with target audience, messaging template, and schedule configuration. Requires a Pro or Business plan.",
|
|
89
|
+
inputSchema: z.object({
|
|
90
|
+
title: z.string().describe("Campaign title displayed in marketplace and dashboard"),
|
|
91
|
+
message: z.string().describe("The WhatsApp message template to send to contacts"),
|
|
92
|
+
rewardPerDelivery: z.number().describe("Reward per successful delivery in kobo (e.g., 5000 = NGN 50)"),
|
|
93
|
+
totalBudget: z.number().describe("Total campaign budget in kobo (e.g., 500000 = NGN 5,000)"),
|
|
94
|
+
deadline: z.string().describe("Campaign deadline in ISO 8601 date format (e.g., '2025-12-31')"),
|
|
95
|
+
description: z.string().optional().describe("Campaign description shown in the marketplace listing"),
|
|
96
|
+
guidelines: z.string().optional().describe("Instructions and guidelines for campaign participants"),
|
|
97
|
+
requireMutualContact: z.boolean().optional().describe("Only allow sends to contacts who have previously responded (default: false)"),
|
|
98
|
+
}),
|
|
99
|
+
annotations: {
|
|
100
|
+
readOnlyHint: false,
|
|
101
|
+
destructiveHint: false,
|
|
102
|
+
idempotentHint: false,
|
|
103
|
+
openWorldHint: false,
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
async (params) => {
|
|
107
|
+
try {
|
|
108
|
+
const result = await api("POST", "/campaigns", params);
|
|
109
|
+
return jsonResult(result);
|
|
110
|
+
} catch (error) {
|
|
111
|
+
return errorResult(error);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
server.registerTool(
|
|
117
|
+
"neuron_update_campaign",
|
|
118
|
+
{
|
|
119
|
+
title: "Update Campaign",
|
|
120
|
+
description: "Update a campaign that is in 'draft' or 'rejected' status. Active or completed campaigns cannot be modified.",
|
|
121
|
+
inputSchema: z.object({
|
|
122
|
+
id: z.string().describe("Unique identifier (UUID) of the campaign to update"),
|
|
123
|
+
title: z.string().optional().describe("Updated campaign title"),
|
|
124
|
+
message: z.string().optional().describe("Updated WhatsApp message template"),
|
|
125
|
+
rewardPerDelivery: z.number().optional().describe("Updated reward per delivery in kobo (e.g., 5000 = NGN 50)"),
|
|
126
|
+
totalBudget: z.number().optional().describe("Updated total campaign budget in kobo"),
|
|
127
|
+
deadline: z.string().optional().describe("Updated campaign deadline in ISO 8601 date format"),
|
|
128
|
+
description: z.string().optional().describe("Updated marketplace description"),
|
|
129
|
+
guidelines: z.string().optional().describe("Updated participant guidelines"),
|
|
130
|
+
requireMutualContact: z.boolean().optional().describe("Updated mutual contact requirement setting"),
|
|
131
|
+
}),
|
|
132
|
+
annotations: {
|
|
133
|
+
readOnlyHint: false,
|
|
134
|
+
destructiveHint: false,
|
|
135
|
+
idempotentHint: true,
|
|
136
|
+
openWorldHint: false,
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
async (params) => {
|
|
140
|
+
try {
|
|
141
|
+
const { id, ...data } = params;
|
|
142
|
+
const result = await api("PUT", `/campaigns/${id}`, data);
|
|
143
|
+
return jsonResult(result);
|
|
144
|
+
} catch (error) {
|
|
145
|
+
return errorResult(error);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
server.registerTool(
|
|
151
|
+
"neuron_delete_campaign",
|
|
152
|
+
{
|
|
153
|
+
title: "Delete Campaign",
|
|
154
|
+
description: "Permanently delete a campaign that is in 'draft' status. Active or funded campaigns cannot be deleted.",
|
|
155
|
+
inputSchema: z.object({
|
|
156
|
+
id: z.string().describe("Unique identifier (UUID) of the draft campaign to delete"),
|
|
157
|
+
}),
|
|
158
|
+
annotations: {
|
|
159
|
+
readOnlyHint: false,
|
|
160
|
+
destructiveHint: true,
|
|
161
|
+
idempotentHint: true,
|
|
162
|
+
openWorldHint: false,
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
async (params) => {
|
|
166
|
+
try {
|
|
167
|
+
const result = await api("DELETE", `/campaigns/${params.id}`);
|
|
168
|
+
return jsonResult(result);
|
|
169
|
+
} catch (error) {
|
|
170
|
+
return errorResult(error);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
);
|
|
174
|
+
|
|
175
|
+
server.registerTool(
|
|
176
|
+
"neuron_submit_campaign",
|
|
177
|
+
{
|
|
178
|
+
title: "Submit Campaign for Review",
|
|
179
|
+
description: "Submit a draft campaign for admin review and approval. The campaign must be in 'draft' status.",
|
|
180
|
+
inputSchema: z.object({
|
|
181
|
+
id: z.string().describe("Unique identifier (UUID) of the draft campaign to submit for review"),
|
|
182
|
+
}),
|
|
183
|
+
annotations: {
|
|
184
|
+
readOnlyHint: false,
|
|
185
|
+
destructiveHint: false,
|
|
186
|
+
idempotentHint: false,
|
|
187
|
+
openWorldHint: false,
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
async (params) => {
|
|
191
|
+
try {
|
|
192
|
+
const result = await api("POST", `/campaigns/${params.id}/submit`);
|
|
193
|
+
return jsonResult(result);
|
|
194
|
+
} catch (error) {
|
|
195
|
+
return errorResult(error);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
);
|
|
199
|
+
|
|
200
|
+
server.registerTool(
|
|
201
|
+
"neuron_fund_campaign",
|
|
202
|
+
{
|
|
203
|
+
title: "Fund Campaign",
|
|
204
|
+
description: "Fund an approved campaign by deducting the total budget from the organization's wallet balance. Requires sufficient wallet funds.",
|
|
205
|
+
inputSchema: z.object({
|
|
206
|
+
id: z.string().describe("Unique identifier (UUID) of the approved campaign to fund"),
|
|
207
|
+
}),
|
|
208
|
+
annotations: {
|
|
209
|
+
readOnlyHint: false,
|
|
210
|
+
destructiveHint: false,
|
|
211
|
+
idempotentHint: false,
|
|
212
|
+
openWorldHint: false,
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
async (params) => {
|
|
216
|
+
try {
|
|
217
|
+
const result = await api("POST", `/campaigns/${params.id}/fund`);
|
|
218
|
+
return jsonResult(result);
|
|
219
|
+
} catch (error) {
|
|
220
|
+
return errorResult(error);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
);
|
|
224
|
+
|
|
225
|
+
server.registerTool(
|
|
226
|
+
"neuron_join_campaign",
|
|
227
|
+
{
|
|
228
|
+
title: "Join Campaign",
|
|
229
|
+
description: "Join a marketplace campaign as a participant to earn rewards by sending messages through your WhatsApp channel.",
|
|
230
|
+
inputSchema: z.object({
|
|
231
|
+
id: z.string().describe("Unique identifier (UUID) of the campaign to join"),
|
|
232
|
+
channelId: z.string().describe("Unique identifier (UUID) of your WhatsApp channel to send messages from"),
|
|
233
|
+
}),
|
|
234
|
+
annotations: {
|
|
235
|
+
readOnlyHint: false,
|
|
236
|
+
destructiveHint: false,
|
|
237
|
+
idempotentHint: false,
|
|
238
|
+
openWorldHint: false,
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
async (params) => {
|
|
242
|
+
try {
|
|
243
|
+
const { id, ...data } = params;
|
|
244
|
+
const result = await api("POST", `/campaigns/${id}/join`, data);
|
|
245
|
+
return jsonResult(result);
|
|
246
|
+
} catch (error) {
|
|
247
|
+
return errorResult(error);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
);
|
|
251
|
+
|
|
252
|
+
server.registerTool(
|
|
253
|
+
"neuron_get_eligible_contacts",
|
|
254
|
+
{
|
|
255
|
+
title: "Get Eligible Contacts",
|
|
256
|
+
description: "Retrieve contacts eligible to receive a campaign message. Respects deduplication rules and mutual contact requirements.",
|
|
257
|
+
inputSchema: z.object({
|
|
258
|
+
id: z.string().describe("Unique identifier (UUID) of the campaign to check eligibility for"),
|
|
259
|
+
}),
|
|
260
|
+
annotations: {
|
|
261
|
+
readOnlyHint: true,
|
|
262
|
+
destructiveHint: false,
|
|
263
|
+
idempotentHint: true,
|
|
264
|
+
openWorldHint: false,
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
async (params) => {
|
|
268
|
+
try {
|
|
269
|
+
const result = await api("GET", `/campaigns/${params.id}/eligible-contacts`);
|
|
270
|
+
return jsonResult(result);
|
|
271
|
+
} catch (error) {
|
|
272
|
+
return errorResult(error);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
);
|
|
276
|
+
|
|
277
|
+
server.registerTool(
|
|
278
|
+
"neuron_send_campaign_message",
|
|
279
|
+
{
|
|
280
|
+
title: "Send Campaign Messages",
|
|
281
|
+
description: "Send a campaign message to selected eligible contacts via WhatsApp. Requires the campaign to be in 'active' status and contacts to be eligible.",
|
|
282
|
+
inputSchema: z.object({
|
|
283
|
+
id: z.string().describe("Unique identifier (UUID) of the active campaign"),
|
|
284
|
+
contactIds: z.array(z.string()).describe("Array of contact UUIDs to send the campaign message to"),
|
|
285
|
+
}),
|
|
286
|
+
annotations: {
|
|
287
|
+
readOnlyHint: false,
|
|
288
|
+
destructiveHint: false,
|
|
289
|
+
idempotentHint: false,
|
|
290
|
+
openWorldHint: false,
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
async (params) => {
|
|
294
|
+
try {
|
|
295
|
+
const { id, contactIds } = params;
|
|
296
|
+
const result = await api("POST", `/campaigns/${id}/send`, { contactIds });
|
|
297
|
+
return jsonResult(result);
|
|
298
|
+
} catch (error) {
|
|
299
|
+
return errorResult(error);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
);
|
|
303
|
+
|
|
304
|
+
server.registerTool(
|
|
305
|
+
"neuron_my_participations",
|
|
306
|
+
{
|
|
307
|
+
title: "My Campaign Participations",
|
|
308
|
+
description: "Retrieve all campaigns the current organization has joined as a participant, including earnings and delivery stats.",
|
|
309
|
+
inputSchema: z.object({
|
|
310
|
+
page: z.number().int().positive().optional().describe("Page number for pagination (default: 1)"),
|
|
311
|
+
limit: z.number().int().positive().optional().describe("Number of participations per page (default: 20)"),
|
|
312
|
+
}),
|
|
313
|
+
annotations: {
|
|
314
|
+
readOnlyHint: true,
|
|
315
|
+
destructiveHint: false,
|
|
316
|
+
idempotentHint: true,
|
|
317
|
+
openWorldHint: false,
|
|
318
|
+
},
|
|
319
|
+
},
|
|
320
|
+
async (params) => {
|
|
321
|
+
try {
|
|
322
|
+
const result = await api("GET", "/campaigns/my-participations", undefined, params);
|
|
323
|
+
return jsonResult(result);
|
|
324
|
+
} catch (error) {
|
|
325
|
+
return errorResult(error);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
);
|
|
329
|
+
|
|
330
|
+
server.registerTool(
|
|
331
|
+
"neuron_campaign_participants",
|
|
332
|
+
{
|
|
333
|
+
title: "List Campaign Participants",
|
|
334
|
+
description: "Retrieve all participants who have joined a campaign you own, including their delivery counts and earned rewards.",
|
|
335
|
+
inputSchema: z.object({
|
|
336
|
+
id: z.string().describe("Unique identifier (UUID) of the campaign you own"),
|
|
337
|
+
}),
|
|
338
|
+
annotations: {
|
|
339
|
+
readOnlyHint: true,
|
|
340
|
+
destructiveHint: false,
|
|
341
|
+
idempotentHint: true,
|
|
342
|
+
openWorldHint: false,
|
|
343
|
+
},
|
|
344
|
+
},
|
|
345
|
+
async (params) => {
|
|
346
|
+
try {
|
|
347
|
+
const result = await api("GET", `/campaigns/${params.id}/participants`);
|
|
348
|
+
return jsonResult(result);
|
|
349
|
+
} catch (error) {
|
|
350
|
+
return errorResult(error);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
);
|
|
354
|
+
|
|
355
|
+
server.registerTool(
|
|
356
|
+
"neuron_pause_campaign",
|
|
357
|
+
{
|
|
358
|
+
title: "Pause Campaign",
|
|
359
|
+
description: "Pause an active campaign to temporarily stop message delivery. Can be resumed later with the resume action.",
|
|
360
|
+
inputSchema: z.object({
|
|
361
|
+
id: z.string().describe("Unique identifier (UUID) of the active campaign to pause"),
|
|
362
|
+
}),
|
|
363
|
+
annotations: {
|
|
364
|
+
readOnlyHint: false,
|
|
365
|
+
destructiveHint: false,
|
|
366
|
+
idempotentHint: true,
|
|
367
|
+
openWorldHint: false,
|
|
368
|
+
},
|
|
369
|
+
},
|
|
370
|
+
async (params) => {
|
|
371
|
+
try {
|
|
372
|
+
const result = await api("POST", `/campaigns/${params.id}/pause`);
|
|
373
|
+
return jsonResult(result);
|
|
374
|
+
} catch (error) {
|
|
375
|
+
return errorResult(error);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
);
|
|
379
|
+
|
|
380
|
+
server.registerTool(
|
|
381
|
+
"neuron_resume_campaign",
|
|
382
|
+
{
|
|
383
|
+
title: "Resume Campaign",
|
|
384
|
+
description: "Resume a previously paused campaign to restart message delivery.",
|
|
385
|
+
inputSchema: z.object({
|
|
386
|
+
id: z.string().describe("Unique identifier (UUID) of the paused campaign to resume"),
|
|
387
|
+
}),
|
|
388
|
+
annotations: {
|
|
389
|
+
readOnlyHint: false,
|
|
390
|
+
destructiveHint: false,
|
|
391
|
+
idempotentHint: true,
|
|
392
|
+
openWorldHint: false,
|
|
393
|
+
},
|
|
394
|
+
},
|
|
395
|
+
async (params) => {
|
|
396
|
+
try {
|
|
397
|
+
const result = await api("POST", `/campaigns/${params.id}/resume`);
|
|
398
|
+
return jsonResult(result);
|
|
399
|
+
} catch (error) {
|
|
400
|
+
return errorResult(error);
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
);
|
|
404
|
+
|
|
405
|
+
server.registerTool(
|
|
406
|
+
"neuron_stop_campaign",
|
|
407
|
+
{
|
|
408
|
+
title: "Stop Campaign",
|
|
409
|
+
description: "Permanently stop an active campaign and refund the remaining unspent budget to the organization's wallet. This action cannot be undone.",
|
|
410
|
+
inputSchema: z.object({
|
|
411
|
+
id: z.string().describe("Unique identifier (UUID) of the active campaign to stop"),
|
|
412
|
+
}),
|
|
413
|
+
annotations: {
|
|
414
|
+
readOnlyHint: false,
|
|
415
|
+
destructiveHint: true,
|
|
416
|
+
idempotentHint: true,
|
|
417
|
+
openWorldHint: false,
|
|
418
|
+
},
|
|
419
|
+
},
|
|
420
|
+
async (params) => {
|
|
421
|
+
try {
|
|
422
|
+
const result = await api("POST", `/campaigns/${params.id}/stop`);
|
|
423
|
+
return jsonResult(result);
|
|
424
|
+
} catch (error) {
|
|
425
|
+
return errorResult(error);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
);
|
|
429
|
+
}
|