@modly_public/mcp-server 0.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/dist/tools.js ADDED
@@ -0,0 +1,2953 @@
1
+ import { EN_TEXT } from "./locales/en.js";
2
+ export function toolDescription(tool) {
3
+ return tool.descriptionKey ? (EN_TEXT[tool.descriptionKey] ?? tool.name) : (tool.description ?? tool.name);
4
+ }
5
+ function localizeSchemaNode(value) {
6
+ if (Array.isArray(value))
7
+ return value.map((v) => localizeSchemaNode(v));
8
+ if (!value || typeof value !== "object")
9
+ return value;
10
+ const input = value;
11
+ const out = {};
12
+ for (const [k, v] of Object.entries(input)) {
13
+ if (k === "descriptionKey" && typeof v === "string")
14
+ out["description"] = EN_TEXT[v] ?? v;
15
+ else
16
+ out[k] = localizeSchemaNode(v);
17
+ }
18
+ return out;
19
+ }
20
+ export function toolInputSchema(tool) {
21
+ return localizeSchemaNode(tool.inputSchema);
22
+ }
23
+ // ─── Arg helpers ────────────────────────────────────────────────────────
24
+ function getStr(args, key) {
25
+ const v = args[key];
26
+ if (typeof v !== "string" || v.length === 0)
27
+ throw new Error(`missing arg: ${key}`);
28
+ return v;
29
+ }
30
+ function getOptStr(args, key) {
31
+ const v = args[key];
32
+ return typeof v === "string" && v.length > 0 ? v : undefined;
33
+ }
34
+ function getStrArr(args, key) {
35
+ const v = args[key];
36
+ if (!Array.isArray(v) || !v.every((x) => typeof x === "string")) {
37
+ throw new Error(`missing or invalid arg: ${key}`);
38
+ }
39
+ return v;
40
+ }
41
+ function getOptStrArr(args, key) {
42
+ const v = args[key];
43
+ if (v === undefined)
44
+ return undefined;
45
+ if (!Array.isArray(v) || !v.every((x) => typeof x === "string")) {
46
+ throw new Error(`invalid arg: ${key}`);
47
+ }
48
+ return v;
49
+ }
50
+ function getOptNum(args, key) {
51
+ const v = args[key];
52
+ return typeof v === "number" ? v : undefined;
53
+ }
54
+ function getOptBool(args, key) {
55
+ const v = args[key];
56
+ return typeof v === "boolean" ? v : undefined;
57
+ }
58
+ function getOptObj(args, key) {
59
+ const v = args[key];
60
+ return v && typeof v === "object" && !Array.isArray(v) ? v : undefined;
61
+ }
62
+ function getObj(args, key) {
63
+ const v = getOptObj(args, key);
64
+ if (!v)
65
+ throw new Error(`missing arg: ${key}`);
66
+ return v;
67
+ }
68
+ // ─── Raw passthrough ────────────────────────────────────────────────────
69
+ async function raw(client, method, path, body) {
70
+ const apiKey = process.env["MODLY_API_KEY"];
71
+ if (!apiKey)
72
+ throw new Error("MODLY_API_KEY not set");
73
+ const url = `${client.baseUrl}/api/guilds/${client.guildId}${path}`;
74
+ const res = await fetch(url, {
75
+ method,
76
+ headers: {
77
+ "authorization": `Bearer ${apiKey}`,
78
+ ...(body !== undefined ? { "content-type": "application/json" } : {}),
79
+ },
80
+ ...(body !== undefined ? { body: JSON.stringify(body) } : {}),
81
+ });
82
+ if (!res.ok) {
83
+ let parsed = null;
84
+ try {
85
+ parsed = await res.json();
86
+ }
87
+ catch { /* ignore */ }
88
+ throw new Error(`http_${res.status}: ${JSON.stringify(parsed)}`);
89
+ }
90
+ if (res.status === 204)
91
+ return undefined;
92
+ return (await res.json());
93
+ }
94
+ // non-guild-scoped raw call (e.g. /api/me, /api/modules, /api/discovery)
95
+ async function rawAbs(client, method, path, body) {
96
+ const apiKey = process.env["MODLY_API_KEY"];
97
+ if (!apiKey)
98
+ throw new Error("MODLY_API_KEY not set");
99
+ const url = `${client.baseUrl}${path}`;
100
+ const res = await fetch(url, {
101
+ method,
102
+ headers: {
103
+ "authorization": `Bearer ${apiKey}`,
104
+ ...(body !== undefined ? { "content-type": "application/json" } : {}),
105
+ },
106
+ ...(body !== undefined ? { body: JSON.stringify(body) } : {}),
107
+ });
108
+ if (!res.ok) {
109
+ let parsed = null;
110
+ try {
111
+ parsed = await res.json();
112
+ }
113
+ catch { /* ignore */ }
114
+ throw new Error(`http_${res.status}: ${JSON.stringify(parsed)}`);
115
+ }
116
+ if (res.status === 204)
117
+ return undefined;
118
+ return (await res.json());
119
+ }
120
+ function qs(params) {
121
+ const u = new URLSearchParams();
122
+ for (const [k, v] of Object.entries(params))
123
+ if (v !== undefined && v !== "")
124
+ u.set(k, String(v));
125
+ return u.size ? `?${u.toString()}` : "";
126
+ }
127
+ // Schema sugar.
128
+ const Sn = { type: "string" };
129
+ const Nn = { type: "number" };
130
+ const Bn = { type: "boolean" };
131
+ const On = { type: "object" };
132
+ const Sa = { type: "array", items: { type: "string" } };
133
+ function k(key) { return { descriptionKey: key }; }
134
+ // ─── Tool list ──────────────────────────────────────────────────────────
135
+ export const TOOLS = [
136
+ // ═══════════════════════════════════════════════════════════════════════
137
+ // MODERATION CORE
138
+ // ═══════════════════════════════════════════════════════════════════════
139
+ {
140
+ name: "list_cases",
141
+ descriptionKey: "mcp.tools.list_cases.description",
142
+ inputSchema: { type: "object", properties: { userId: Sn, limit: Nn, type: Sn, cursor: Sn } },
143
+ handler: async (a, c) => raw(c, "GET", `/cases${qs({ userId: getOptStr(a, "userId"), limit: getOptNum(a, "limit"), type: getOptStr(a, "type"), cursor: getOptStr(a, "cursor") })}`),
144
+ },
145
+ {
146
+ name: "get_case",
147
+ descriptionKey: "mcp.tools.get_case.description",
148
+ inputSchema: { type: "object", properties: { caseNumber: Nn }, required: ["caseNumber"] },
149
+ handler: async (a, c) => raw(c, "GET", `/cases/${encodeURIComponent(String(a["caseNumber"]))}`),
150
+ },
151
+ {
152
+ name: "update_case_reason",
153
+ descriptionKey: "mcp.tools.update_case_reason.description",
154
+ inputSchema: { type: "object", properties: { caseNumber: Nn, reason: Sn, notes: Sn }, required: ["caseNumber"] },
155
+ handler: async (a, c) => raw(c, "PATCH", `/cases/${encodeURIComponent(String(a["caseNumber"]))}`, {
156
+ reason: getOptStr(a, "reason"),
157
+ notes: getOptStr(a, "notes"),
158
+ }),
159
+ },
160
+ {
161
+ name: "ban_user",
162
+ descriptionKey: "mcp.tools.ban_user.description",
163
+ inputSchema: { type: "object", properties: { userId: Sn, reason: Sn, deleteMessageDays: Nn, durationMs: Nn }, required: ["userId"] },
164
+ handler: async (a, c) => raw(c, "POST", `/cases/ban`, {
165
+ userId: getStr(a, "userId"),
166
+ reason: getOptStr(a, "reason"),
167
+ deleteMessageDays: getOptNum(a, "deleteMessageDays"),
168
+ durationMs: getOptNum(a, "durationMs"),
169
+ }),
170
+ },
171
+ {
172
+ name: "unban_user",
173
+ descriptionKey: "mcp.tools.unban_user.description",
174
+ inputSchema: { type: "object", properties: { userId: Sn, reason: Sn }, required: ["userId"] },
175
+ handler: async (a, c) => raw(c, "POST", `/cases/unban`, { userId: getStr(a, "userId"), reason: getOptStr(a, "reason") }),
176
+ },
177
+ {
178
+ name: "kick_user",
179
+ descriptionKey: "mcp.tools.kick_user.description",
180
+ inputSchema: { type: "object", properties: { userId: Sn, reason: Sn }, required: ["userId"] },
181
+ handler: async (a, c) => raw(c, "POST", `/cases/kick`, { userId: getStr(a, "userId"), reason: getOptStr(a, "reason") }),
182
+ },
183
+ {
184
+ name: "timeout_user",
185
+ descriptionKey: "mcp.tools.timeout_user.description",
186
+ inputSchema: { type: "object", properties: { userId: Sn, durationMs: Nn, reason: Sn }, required: ["userId", "durationMs"] },
187
+ handler: async (a, c) => raw(c, "POST", `/cases/timeout`, { userId: getStr(a, "userId"), durationMs: getOptNum(a, "durationMs"), reason: getOptStr(a, "reason") }),
188
+ },
189
+ {
190
+ name: "untimeout_user",
191
+ descriptionKey: "mcp.tools.untimeout_user.description",
192
+ inputSchema: { type: "object", properties: { userId: Sn, reason: Sn }, required: ["userId"] },
193
+ handler: async (a, c) => raw(c, "POST", `/cases/untimeout`, { userId: getStr(a, "userId"), reason: getOptStr(a, "reason") }),
194
+ },
195
+ {
196
+ name: "warn_user",
197
+ descriptionKey: "mcp.tools.warn_user.description",
198
+ inputSchema: { type: "object", properties: { userId: Sn, reason: Sn, severity: Sn }, required: ["userId", "reason"] },
199
+ handler: async (a, c) => raw(c, "POST", `/cases/warn`, { userId: getStr(a, "userId"), reason: getStr(a, "reason"), severity: getOptStr(a, "severity") }),
200
+ },
201
+ {
202
+ name: "softban_user",
203
+ descriptionKey: "mcp.tools.softban_user.description",
204
+ inputSchema: { type: "object", properties: { userId: Sn, reason: Sn }, required: ["userId"] },
205
+ handler: async (a, c) => raw(c, "POST", `/cases/softban`, { userId: getStr(a, "userId"), reason: getOptStr(a, "reason") }),
206
+ },
207
+ {
208
+ name: "mass_ban",
209
+ descriptionKey: "mcp.tools.mass_ban.description",
210
+ inputSchema: { type: "object", properties: { userIds: Sa, reason: Sn }, required: ["userIds"] },
211
+ handler: async (a, c) => raw(c, "POST", `/cases/mass-ban`, { userIds: getStrArr(a, "userIds"), reason: getOptStr(a, "reason") }),
212
+ },
213
+ {
214
+ name: "list_active_punishments",
215
+ descriptionKey: "mcp.tools.list_active_punishments.description",
216
+ inputSchema: { type: "object", properties: { userId: Sn, limit: Nn } },
217
+ handler: async (a, c) => raw(c, "GET", `/cases${qs({ userId: getOptStr(a, "userId"), limit: getOptNum(a, "limit"), active: true })}`),
218
+ },
219
+ {
220
+ name: "list_member_notes",
221
+ descriptionKey: "mcp.tools.list_member_notes.description",
222
+ inputSchema: { type: "object", properties: { userId: Sn, limit: Nn }, required: ["userId"] },
223
+ handler: async (a, c) => raw(c, "GET", `/member-notes${qs({ userId: getStr(a, "userId"), limit: getOptNum(a, "limit") })}`),
224
+ },
225
+ {
226
+ name: "search_member_notes",
227
+ descriptionKey: "mcp.tools.search_member_notes.description",
228
+ inputSchema: { type: "object", properties: { q: Sn, userId: Sn, limit: Nn } },
229
+ handler: async (a, c) => raw(c, "GET", `/member-notes${qs({ q: getOptStr(a, "q"), userId: getOptStr(a, "userId"), limit: getOptNum(a, "limit") })}`),
230
+ },
231
+ {
232
+ name: "add_member_note",
233
+ descriptionKey: "mcp.tools.add_member_note.description",
234
+ inputSchema: { type: "object", properties: { userId: Sn, body: Sn, pinned: Bn, tags: Sa }, required: ["userId", "body"] },
235
+ handler: async (a, c) => raw(c, "POST", `/member-notes`, {
236
+ userId: getStr(a, "userId"),
237
+ body: getStr(a, "body"),
238
+ pinned: getOptBool(a, "pinned"),
239
+ tags: getOptStrArr(a, "tags"),
240
+ }),
241
+ },
242
+ {
243
+ name: "update_member_note",
244
+ descriptionKey: "mcp.tools.update_member_note.description",
245
+ inputSchema: { type: "object", properties: { noteId: Sn, body: Sn, pinned: Bn, tags: Sa }, required: ["noteId"] },
246
+ handler: async (a, c) => raw(c, "PATCH", `/member-notes/${encodeURIComponent(getStr(a, "noteId"))}`, {
247
+ body: getOptStr(a, "body"),
248
+ pinned: getOptBool(a, "pinned"),
249
+ tags: getOptStrArr(a, "tags"),
250
+ }),
251
+ },
252
+ {
253
+ name: "pin_member_note",
254
+ descriptionKey: "mcp.tools.pin_member_note.description",
255
+ inputSchema: { type: "object", properties: { noteId: Sn }, required: ["noteId"] },
256
+ handler: async (a, c) => raw(c, "POST", `/member-notes/${encodeURIComponent(getStr(a, "noteId"))}/pin`),
257
+ },
258
+ {
259
+ name: "delete_member_note",
260
+ descriptionKey: "mcp.tools.delete_member_note.description",
261
+ inputSchema: { type: "object", properties: { noteId: Sn }, required: ["noteId"] },
262
+ handler: async (a, c) => raw(c, "DELETE", `/member-notes/${encodeURIComponent(getStr(a, "noteId"))}`),
263
+ },
264
+ {
265
+ name: "get_member_note_revisions",
266
+ descriptionKey: "mcp.tools.get_member_note_revisions.description",
267
+ inputSchema: { type: "object", properties: { noteId: Sn }, required: ["noteId"] },
268
+ handler: async (a, c) => raw(c, "GET", `/member-notes/${encodeURIComponent(getStr(a, "noteId"))}/revisions`),
269
+ },
270
+ {
271
+ name: "get_member_notes_stats",
272
+ descriptionKey: "mcp.tools.get_member_notes_stats.description",
273
+ inputSchema: { type: "object", properties: {} },
274
+ handler: async (_a, c) => raw(c, "GET", `/member-notes/stats`),
275
+ },
276
+ {
277
+ name: "member_lookup",
278
+ descriptionKey: "mcp.tools.member_lookup.description",
279
+ inputSchema: { type: "object", properties: { userId: Sn, limit: Nn }, required: ["userId"] },
280
+ handler: async (a, c) => {
281
+ const userId = getStr(a, "userId");
282
+ const limit = getOptNum(a, "limit");
283
+ const [cases, notes] = await Promise.all([
284
+ raw(c, "GET", `/cases${qs({ userId, limit })}`).catch((e) => ({ error: String(e) })),
285
+ raw(c, "GET", `/member-notes${qs({ userId, limit })}`).catch((e) => ({ error: String(e) })),
286
+ ]);
287
+ return { userId, cases, notes };
288
+ },
289
+ },
290
+ // ═══════════════════════════════════════════════════════════════════════
291
+ // AUTOMOD
292
+ // ═══════════════════════════════════════════════════════════════════════
293
+ {
294
+ name: "list_automod_rules",
295
+ descriptionKey: "mcp.tools.list_automod_rules.description",
296
+ inputSchema: { type: "object", properties: {} },
297
+ handler: async (_a, c) => raw(c, "GET", `/automod/rules`),
298
+ },
299
+ {
300
+ name: "get_automod_rule",
301
+ descriptionKey: "mcp.tools.get_automod_rule.description",
302
+ inputSchema: { type: "object", properties: { ruleId: Sn }, required: ["ruleId"] },
303
+ handler: async (a, c) => raw(c, "GET", `/automod/rules/${encodeURIComponent(getStr(a, "ruleId"))}`),
304
+ },
305
+ {
306
+ name: "create_automod_rule",
307
+ descriptionKey: "mcp.tools.create_automod_rule.description",
308
+ inputSchema: {
309
+ type: "object",
310
+ properties: { name: Sn, kind: Sn, enabled: Bn, config: On, scope: On, action: On, priority: Nn },
311
+ required: ["kind", "config", "scope", "action"],
312
+ },
313
+ handler: async (a, c) => raw(c, "POST", `/automod/rules`, {
314
+ name: getOptStr(a, "name"),
315
+ kind: getStr(a, "kind"),
316
+ enabled: getOptBool(a, "enabled"),
317
+ config: getOptObj(a, "config") ?? {},
318
+ scope: getOptObj(a, "scope") ?? {},
319
+ action: getOptObj(a, "action") ?? {},
320
+ priority: getOptNum(a, "priority"),
321
+ }),
322
+ },
323
+ {
324
+ name: "update_automod_rule",
325
+ descriptionKey: "mcp.tools.update_automod_rule.description",
326
+ inputSchema: { type: "object", properties: { ruleId: Sn, patch: On }, required: ["ruleId", "patch"] },
327
+ handler: async (a, c) => raw(c, "PATCH", `/automod/rules/${encodeURIComponent(getStr(a, "ruleId"))}`, getObj(a, "patch")),
328
+ },
329
+ {
330
+ name: "delete_automod_rule",
331
+ descriptionKey: "mcp.tools.delete_automod_rule.description",
332
+ inputSchema: { type: "object", properties: { ruleId: Sn }, required: ["ruleId"] },
333
+ handler: async (a, c) => raw(c, "DELETE", `/automod/rules/${encodeURIComponent(getStr(a, "ruleId"))}`),
334
+ },
335
+ {
336
+ name: "test_automod_message",
337
+ descriptionKey: "mcp.tools.test_automod_message.description",
338
+ inputSchema: { type: "object", properties: { content: Sn, ruleId: Sn, channelId: Sn, userId: Sn }, required: ["content"] },
339
+ handler: async (a, c) => {
340
+ const ruleId = getOptStr(a, "ruleId");
341
+ const path = ruleId ? `/automod/rules/${encodeURIComponent(ruleId)}/test` : `/automod/test`;
342
+ return raw(c, "POST", path, {
343
+ content: getStr(a, "content"),
344
+ channelId: getOptStr(a, "channelId"),
345
+ userId: getOptStr(a, "userId"),
346
+ });
347
+ },
348
+ },
349
+ {
350
+ name: "list_automod_telemetry",
351
+ descriptionKey: "mcp.tools.list_automod_telemetry.description",
352
+ inputSchema: { type: "object", properties: { limit: Nn, ruleId: Sn } },
353
+ handler: async (a, c) => raw(c, "GET", `/automod/telemetry${qs({ limit: getOptNum(a, "limit"), ruleId: getOptStr(a, "ruleId") })}`),
354
+ },
355
+ {
356
+ name: "list_word_blacklist",
357
+ descriptionKey: "mcp.tools.list_word_blacklist.description",
358
+ inputSchema: { type: "object", properties: {} },
359
+ handler: async (_a, c) => raw(c, "GET", `/automod/word-blacklist`),
360
+ },
361
+ {
362
+ name: "update_word_blacklist",
363
+ descriptionKey: "mcp.tools.update_word_blacklist.description",
364
+ inputSchema: { type: "object", properties: { add: Sa, remove: Sa, replace: Sa } },
365
+ handler: async (a, c) => raw(c, "PUT", `/automod/word-blacklist`, {
366
+ add: getOptStrArr(a, "add"),
367
+ remove: getOptStrArr(a, "remove"),
368
+ replace: getOptStrArr(a, "replace"),
369
+ }),
370
+ },
371
+ // ═══════════════════════════════════════════════════════════════════════
372
+ // ANTINUKE / RAID / INCIDENTS
373
+ // ═══════════════════════════════════════════════════════════════════════
374
+ {
375
+ name: "get_antinuke_settings",
376
+ descriptionKey: "mcp.tools.get_antinuke_settings.description",
377
+ inputSchema: { type: "object", properties: {} },
378
+ handler: async (_a, c) => raw(c, "GET", `/settings${qs({ module: "antinuke" })}`),
379
+ },
380
+ {
381
+ name: "update_antinuke_settings",
382
+ descriptionKey: "mcp.tools.update_antinuke_settings.description",
383
+ inputSchema: { type: "object", properties: { patch: On }, required: ["patch"] },
384
+ handler: async (a, c) => raw(c, "PATCH", `/settings`, { module: "antinuke", patch: getObj(a, "patch") }),
385
+ },
386
+ {
387
+ name: "list_antinuke_incidents",
388
+ descriptionKey: "mcp.tools.list_antinuke_incidents.description",
389
+ inputSchema: { type: "object", properties: { limit: Nn, status: Sn } },
390
+ handler: async (a, c) => raw(c, "GET", `/antinuke/incidents${qs({ limit: getOptNum(a, "limit"), status: getOptStr(a, "status") })}`),
391
+ },
392
+ {
393
+ name: "resolve_antinuke_incident",
394
+ descriptionKey: "mcp.tools.resolve_antinuke_incident.description",
395
+ inputSchema: { type: "object", properties: { incidentId: Sn, resolution: Sn, notes: Sn }, required: ["incidentId", "resolution"] },
396
+ handler: async (a, c) => raw(c, "POST", `/antinuke/incidents/${encodeURIComponent(getStr(a, "incidentId"))}/resolve`, {
397
+ resolution: getStr(a, "resolution"),
398
+ notes: getOptStr(a, "notes"),
399
+ }),
400
+ },
401
+ {
402
+ name: "list_trust_users",
403
+ descriptionKey: "mcp.tools.list_trust_users.description",
404
+ inputSchema: { type: "object", properties: {} },
405
+ handler: async (_a, c) => raw(c, "GET", `/antinuke/trust`),
406
+ },
407
+ {
408
+ name: "add_trust_user",
409
+ descriptionKey: "mcp.tools.add_trust_user.description",
410
+ inputSchema: { type: "object", properties: { userId: Sn, level: Sn, reason: Sn }, required: ["userId"] },
411
+ handler: async (a, c) => raw(c, "POST", `/antinuke/trust`, { userId: getStr(a, "userId"), level: getOptStr(a, "level"), reason: getOptStr(a, "reason") }),
412
+ },
413
+ {
414
+ name: "remove_trust_user",
415
+ descriptionKey: "mcp.tools.remove_trust_user.description",
416
+ inputSchema: { type: "object", properties: { userId: Sn }, required: ["userId"] },
417
+ handler: async (a, c) => raw(c, "DELETE", `/antinuke/trust/${encodeURIComponent(getStr(a, "userId"))}`),
418
+ },
419
+ {
420
+ name: "federation_block",
421
+ descriptionKey: "mcp.tools.federation_block.description",
422
+ inputSchema: { type: "object", properties: { userId: Sn, reason: Sn }, required: ["userId"] },
423
+ handler: async (a, c) => raw(c, "POST", `/antinuke/federation/block`, { userId: getStr(a, "userId"), reason: getOptStr(a, "reason") }),
424
+ },
425
+ {
426
+ name: "federation_unblock",
427
+ descriptionKey: "mcp.tools.federation_unblock.description",
428
+ inputSchema: { type: "object", properties: { userId: Sn }, required: ["userId"] },
429
+ handler: async (a, c) => raw(c, "DELETE", `/antinuke/federation/block/${encodeURIComponent(getStr(a, "userId"))}`),
430
+ },
431
+ {
432
+ name: "get_raid_state",
433
+ descriptionKey: "mcp.tools.get_raid_state.description",
434
+ inputSchema: { type: "object", properties: {} },
435
+ handler: async (_a, c) => raw(c, "GET", `/safety/state`),
436
+ },
437
+ {
438
+ name: "set_raid_mode",
439
+ descriptionKey: "mcp.tools.set_raid_mode.description",
440
+ inputSchema: { type: "object", properties: { mode: Sn, durationMs: Nn, reason: Sn }, required: ["mode"] },
441
+ handler: async (a, c) => raw(c, "POST", `/raid/mode`, { mode: getStr(a, "mode"), durationMs: getOptNum(a, "durationMs"), reason: getOptStr(a, "reason") }),
442
+ },
443
+ {
444
+ name: "list_raid_incidents",
445
+ descriptionKey: "mcp.tools.list_raid_incidents.description",
446
+ inputSchema: { type: "object", properties: { limit: Nn } },
447
+ handler: async (a, c) => raw(c, "GET", `/raid/incidents${qs({ limit: getOptNum(a, "limit") })}`),
448
+ },
449
+ {
450
+ name: "rollback_raid_incident",
451
+ descriptionKey: "mcp.tools.rollback_raid_incident.description",
452
+ inputSchema: { type: "object", properties: { incidentId: Sn }, required: ["incidentId"] },
453
+ handler: async (a, c) => raw(c, "POST", `/raid/incidents/${encodeURIComponent(getStr(a, "incidentId"))}/rollback`),
454
+ },
455
+ {
456
+ name: "get_raid_settings",
457
+ descriptionKey: "mcp.tools.get_raid_settings.description",
458
+ inputSchema: { type: "object", properties: {} },
459
+ handler: async (_a, c) => raw(c, "GET", `/settings${qs({ module: "raid" })}`),
460
+ },
461
+ {
462
+ name: "update_raid_settings",
463
+ descriptionKey: "mcp.tools.update_raid_settings.description",
464
+ inputSchema: { type: "object", properties: { patch: On }, required: ["patch"] },
465
+ handler: async (a, c) => raw(c, "PATCH", `/settings`, { module: "raid", patch: getObj(a, "patch") }),
466
+ },
467
+ // ═══════════════════════════════════════════════════════════════════════
468
+ // CAPTCHA / HONEYPOT / SAFETY
469
+ // ═══════════════════════════════════════════════════════════════════════
470
+ {
471
+ name: "get_captcha_analytics",
472
+ descriptionKey: "mcp.tools.get_captcha_analytics.description",
473
+ inputSchema: { type: "object", properties: {} },
474
+ handler: async (_a, c) => raw(c, "GET", `/captcha`),
475
+ },
476
+ {
477
+ name: "send_captcha",
478
+ descriptionKey: "mcp.tools.send_captcha.description",
479
+ inputSchema: { type: "object", properties: { userId: Sn, channelId: Sn }, required: ["userId"] },
480
+ handler: async (a, c) => raw(c, "POST", `/captcha/send`, { userId: getStr(a, "userId"), channelId: getOptStr(a, "channelId") }),
481
+ },
482
+ {
483
+ name: "get_captcha_status",
484
+ descriptionKey: "mcp.tools.get_captcha_status.description",
485
+ inputSchema: { type: "object", properties: { userId: Sn }, required: ["userId"] },
486
+ handler: async (a, c) => raw(c, "GET", `/captcha/status/${encodeURIComponent(getStr(a, "userId"))}`),
487
+ },
488
+ {
489
+ name: "clear_captcha_for_user",
490
+ descriptionKey: "mcp.tools.clear_captcha_for_user.description",
491
+ inputSchema: { type: "object", properties: { userId: Sn }, required: ["userId"] },
492
+ handler: async (a, c) => raw(c, "POST", `/captcha/users/${encodeURIComponent(getStr(a, "userId"))}/clear`),
493
+ },
494
+ {
495
+ name: "cancel_captcha_challenge",
496
+ descriptionKey: "mcp.tools.cancel_captcha_challenge.description",
497
+ inputSchema: { type: "object", properties: { challengeId: Sn }, required: ["challengeId"] },
498
+ handler: async (a, c) => raw(c, "POST", `/captcha/${encodeURIComponent(getStr(a, "challengeId"))}/cancel`),
499
+ },
500
+ {
501
+ name: "list_captcha_records",
502
+ descriptionKey: "mcp.tools.list_captcha_records.description",
503
+ inputSchema: { type: "object", properties: { limit: Nn, status: Sn } },
504
+ handler: async (a, c) => raw(c, "GET", `/captcha/records${qs({ limit: getOptNum(a, "limit"), status: getOptStr(a, "status") })}`),
505
+ },
506
+ {
507
+ name: "update_captcha_settings",
508
+ descriptionKey: "mcp.tools.update_captcha_settings.description",
509
+ inputSchema: { type: "object", properties: { patch: On }, required: ["patch"] },
510
+ handler: async (a, c) => raw(c, "PATCH", `/settings`, { module: "captcha", patch: getObj(a, "patch") }),
511
+ },
512
+ {
513
+ name: "list_honeypots",
514
+ descriptionKey: "mcp.tools.list_honeypots.description",
515
+ inputSchema: { type: "object", properties: {} },
516
+ handler: async (_a, c) => raw(c, "GET", `/honeypot`),
517
+ },
518
+ {
519
+ name: "resend_honeypot_traps",
520
+ descriptionKey: "mcp.tools.resend_honeypot_traps.description",
521
+ inputSchema: { type: "object", properties: { channelIds: Sa } },
522
+ handler: async (a, c) => raw(c, "POST", `/honeypot/traps/resend`, { channelIds: getOptStrArr(a, "channelIds") }),
523
+ },
524
+ {
525
+ name: "add_honeypot",
526
+ descriptionKey: "mcp.tools.add_honeypot.description",
527
+ inputSchema: { type: "object", properties: { channelId: Sn, action: Sn, durationMs: Nn }, required: ["channelId"] },
528
+ handler: async (a, c) => raw(c, "POST", `/honeypot/channels`, {
529
+ channelId: getStr(a, "channelId"),
530
+ action: getOptStr(a, "action"),
531
+ durationMs: getOptNum(a, "durationMs"),
532
+ }),
533
+ },
534
+ {
535
+ name: "remove_honeypot",
536
+ descriptionKey: "mcp.tools.remove_honeypot.description",
537
+ inputSchema: { type: "object", properties: { channelId: Sn }, required: ["channelId"] },
538
+ handler: async (a, c) => raw(c, "DELETE", `/honeypot/channels/${encodeURIComponent(getStr(a, "channelId"))}`),
539
+ },
540
+ {
541
+ name: "get_honeypot_stats",
542
+ descriptionKey: "mcp.tools.get_honeypot_stats.description",
543
+ inputSchema: { type: "object", properties: {} },
544
+ handler: async (_a, c) => raw(c, "GET", `/honeypot/stats`),
545
+ },
546
+ {
547
+ name: "update_honeypot_action",
548
+ descriptionKey: "mcp.tools.update_honeypot_action.description",
549
+ inputSchema: { type: "object", properties: { action: Sn, durationMs: Nn }, required: ["action"] },
550
+ handler: async (a, c) => raw(c, "PATCH", `/settings`, { module: "honeypot", patch: { action: getStr(a, "action"), durationMs: getOptNum(a, "durationMs") } }),
551
+ },
552
+ {
553
+ name: "list_safety_flags",
554
+ descriptionKey: "mcp.tools.list_safety_flags.description",
555
+ inputSchema: { type: "object", properties: { unresolved: Bn, limit: Nn } },
556
+ handler: async (a, c) => raw(c, "GET", `/safety/flags${qs({ unresolved: getOptBool(a, "unresolved"), limit: getOptNum(a, "limit") })}`),
557
+ },
558
+ {
559
+ name: "resolve_safety_flag",
560
+ descriptionKey: "mcp.tools.resolve_safety_flag.description",
561
+ inputSchema: { type: "object", properties: { flagId: Sn, resolution: Sn, notes: Sn }, required: ["flagId", "resolution"] },
562
+ handler: async (a, c) => raw(c, "POST", `/safety/flags/${encodeURIComponent(getStr(a, "flagId"))}/resolve`, {
563
+ resolution: getStr(a, "resolution"),
564
+ notes: getOptStr(a, "notes"),
565
+ }),
566
+ },
567
+ {
568
+ name: "list_evader_detections",
569
+ descriptionKey: "mcp.tools.list_evader_detections.description",
570
+ inputSchema: { type: "object", properties: { userId: Sn, riskBand: Sn, unresolved: Bn, limit: Nn } },
571
+ handler: async (a, c) => raw(c, "GET", `/safety/evader-detections${qs({
572
+ userId: getOptStr(a, "userId"), riskBand: getOptStr(a, "riskBand"),
573
+ unresolved: getOptBool(a, "unresolved"), limit: getOptNum(a, "limit"),
574
+ })}`),
575
+ },
576
+ {
577
+ name: "resolve_evader_detection",
578
+ descriptionKey: "mcp.tools.resolve_evader_detection.description",
579
+ inputSchema: { type: "object", properties: { detectionId: Sn, resolution: Sn, notes: Sn }, required: ["detectionId", "resolution"] },
580
+ handler: async (a, c) => raw(c, "POST", `/safety/evader-detections/${encodeURIComponent(getStr(a, "detectionId"))}/resolve`, {
581
+ resolution: getStr(a, "resolution"),
582
+ notes: getOptStr(a, "notes"),
583
+ }),
584
+ },
585
+ {
586
+ name: "list_phash_blocklist",
587
+ descriptionKey: "mcp.tools.list_phash_blocklist.description",
588
+ inputSchema: { type: "object", properties: {} },
589
+ handler: async (_a, c) => raw(c, "GET", `/safety/pfp-hashes`),
590
+ },
591
+ {
592
+ name: "add_phash_blocklist",
593
+ descriptionKey: "mcp.tools.add_phash_blocklist.description",
594
+ inputSchema: { type: "object", properties: { hash: Sn, label: Sn }, required: ["hash"] },
595
+ handler: async (a, c) => raw(c, "POST", `/safety/pfp-hashes`, { hash: getStr(a, "hash"), label: getOptStr(a, "label") }),
596
+ },
597
+ {
598
+ name: "list_safety_name_rules",
599
+ descriptionKey: "mcp.tools.list_safety_name_rules.description",
600
+ inputSchema: { type: "object", properties: {} },
601
+ handler: async (_a, c) => raw(c, "GET", `/safety/name-rules`),
602
+ },
603
+ {
604
+ name: "add_safety_name_rule",
605
+ descriptionKey: "mcp.tools.add_safety_name_rule.description",
606
+ inputSchema: { type: "object", properties: { pattern: Sn, action: Sn, severity: Sn }, required: ["pattern", "action"] },
607
+ handler: async (a, c) => raw(c, "POST", `/safety/name-rules`, {
608
+ pattern: getStr(a, "pattern"),
609
+ action: getStr(a, "action"),
610
+ severity: getOptStr(a, "severity"),
611
+ }),
612
+ },
613
+ {
614
+ name: "delete_safety_name_rule",
615
+ descriptionKey: "mcp.tools.delete_safety_name_rule.description",
616
+ inputSchema: { type: "object", properties: { ruleId: Sn }, required: ["ruleId"] },
617
+ handler: async (a, c) => raw(c, "DELETE", `/safety/name-rules/${encodeURIComponent(getStr(a, "ruleId"))}`),
618
+ },
619
+ {
620
+ name: "list_scam_phrases",
621
+ descriptionKey: "mcp.tools.list_scam_phrases.description",
622
+ inputSchema: { type: "object", properties: {} },
623
+ handler: async (_a, c) => raw(c, "GET", `/safety/scam-phrases`),
624
+ },
625
+ {
626
+ name: "update_scam_phrases",
627
+ descriptionKey: "mcp.tools.update_scam_phrases.description",
628
+ inputSchema: { type: "object", properties: { add: Sa, remove: Sa, replace: Sa } },
629
+ handler: async (a, c) => raw(c, "PUT", `/safety/scam-phrases`, {
630
+ add: getOptStrArr(a, "add"), remove: getOptStrArr(a, "remove"), replace: getOptStrArr(a, "replace"),
631
+ }),
632
+ },
633
+ {
634
+ name: "get_safety_trends",
635
+ descriptionKey: "mcp.tools.get_safety_trends.description",
636
+ inputSchema: { type: "object", properties: { window: Sn } },
637
+ handler: async (a, c) => raw(c, "GET", `/safety/trends${qs({ window: getOptStr(a, "window") })}`),
638
+ },
639
+ // ═══════════════════════════════════════════════════════════════════════
640
+ // FORMS / APPLICATIONS / APPEALS / USER-INPUT
641
+ // ═══════════════════════════════════════════════════════════════════════
642
+ {
643
+ name: "list_forms",
644
+ descriptionKey: "mcp.tools.list_forms.description",
645
+ inputSchema: { type: "object", properties: {} },
646
+ handler: async (_a, c) => raw(c, "GET", `/forms`),
647
+ },
648
+ {
649
+ name: "get_form",
650
+ descriptionKey: "mcp.tools.get_form.description",
651
+ inputSchema: { type: "object", properties: { formId: Sn }, required: ["formId"] },
652
+ handler: async (a, c) => raw(c, "GET", `/forms/${encodeURIComponent(getStr(a, "formId"))}`),
653
+ },
654
+ {
655
+ name: "create_form",
656
+ descriptionKey: "mcp.tools.create_form.description",
657
+ inputSchema: { type: "object", properties: { definition: On }, required: ["definition"] },
658
+ handler: async (a, c) => raw(c, "POST", `/forms`, getObj(a, "definition")),
659
+ },
660
+ {
661
+ name: "update_form",
662
+ descriptionKey: "mcp.tools.update_form.description",
663
+ inputSchema: { type: "object", properties: { formId: Sn, patch: On }, required: ["formId", "patch"] },
664
+ handler: async (a, c) => raw(c, "PATCH", `/forms/${encodeURIComponent(getStr(a, "formId"))}`, getObj(a, "patch")),
665
+ },
666
+ {
667
+ name: "delete_form",
668
+ descriptionKey: "mcp.tools.delete_form.description",
669
+ inputSchema: { type: "object", properties: { formId: Sn }, required: ["formId"] },
670
+ handler: async (a, c) => raw(c, "DELETE", `/forms/${encodeURIComponent(getStr(a, "formId"))}`),
671
+ },
672
+ {
673
+ name: "publish_form",
674
+ descriptionKey: "mcp.tools.publish_form.description",
675
+ inputSchema: { type: "object", properties: { formId: Sn, channelId: Sn }, required: ["formId"] },
676
+ handler: async (a, c) => raw(c, "POST", `/forms/${encodeURIComponent(getStr(a, "formId"))}/publish`, { channelId: getOptStr(a, "channelId") }),
677
+ },
678
+ {
679
+ name: "list_form_submissions",
680
+ descriptionKey: "mcp.tools.list_form_submissions.description",
681
+ inputSchema: { type: "object", properties: { formId: Sn, status: Sn, limit: Nn } },
682
+ handler: async (a, c) => raw(c, "GET", `/forms/submissions${qs({
683
+ formId: getOptStr(a, "formId"), status: getOptStr(a, "status"), limit: getOptNum(a, "limit"),
684
+ })}`),
685
+ },
686
+ {
687
+ name: "get_form_submission",
688
+ descriptionKey: "mcp.tools.get_form_submission.description",
689
+ inputSchema: { type: "object", properties: { submissionId: Sn }, required: ["submissionId"] },
690
+ handler: async (a, c) => raw(c, "GET", `/forms/submissions/${encodeURIComponent(getStr(a, "submissionId"))}`),
691
+ },
692
+ {
693
+ name: "decide_form_submission",
694
+ descriptionKey: "mcp.tools.decide_form_submission.description",
695
+ inputSchema: { type: "object", properties: { submissionId: Sn, decision: { type: "string", enum: ["approve", "reject"] }, reason: Sn }, required: ["submissionId", "decision"] },
696
+ handler: async (a, c) => raw(c, "POST", `/forms/submissions/${encodeURIComponent(getStr(a, "submissionId"))}/decide`, {
697
+ decision: getStr(a, "decision"), reason: getOptStr(a, "reason"),
698
+ }),
699
+ },
700
+ {
701
+ name: "assign_form_submission",
702
+ descriptionKey: "mcp.tools.assign_form_submission.description",
703
+ inputSchema: { type: "object", properties: { submissionId: Sn, assigneeId: Sn }, required: ["submissionId"] },
704
+ handler: async (a, c) => raw(c, "POST", `/forms/submissions/${encodeURIComponent(getStr(a, "submissionId"))}/assign`, {
705
+ assigneeId: getOptStr(a, "assigneeId"),
706
+ }),
707
+ },
708
+ {
709
+ name: "comment_on_form_submission",
710
+ descriptionKey: "mcp.tools.comment_on_form_submission.description",
711
+ inputSchema: { type: "object", properties: { submissionId: Sn, body: Sn }, required: ["submissionId", "body"] },
712
+ handler: async (a, c) => raw(c, "POST", `/forms/submissions/${encodeURIComponent(getStr(a, "submissionId"))}/notes`, {
713
+ body: getStr(a, "body"),
714
+ }),
715
+ },
716
+ {
717
+ name: "export_forms",
718
+ descriptionKey: "mcp.tools.export_forms.description",
719
+ inputSchema: { type: "object", properties: {} },
720
+ handler: async (_a, c) => raw(c, "GET", `/forms/export`),
721
+ },
722
+ {
723
+ name: "import_forms",
724
+ descriptionKey: "mcp.tools.import_forms.description",
725
+ inputSchema: { type: "object", properties: { data: On }, required: ["data"] },
726
+ handler: async (a, c) => raw(c, "POST", `/forms/import`, getObj(a, "data")),
727
+ },
728
+ {
729
+ name: "list_application_alerts",
730
+ descriptionKey: "mcp.tools.list_application_alerts.description",
731
+ inputSchema: { type: "object", properties: { limit: Nn } },
732
+ handler: async (a, c) => raw(c, "GET", `/applications${qs({ limit: getOptNum(a, "limit") })}`),
733
+ },
734
+ {
735
+ name: "resolve_application_alert",
736
+ descriptionKey: "mcp.tools.resolve_application_alert.description",
737
+ inputSchema: { type: "object", properties: { alertId: Sn, action: { type: "string", enum: ["resolve", "dismiss", "snooze"] }, until: Sn }, required: ["alertId", "action"] },
738
+ handler: async (a, c) => {
739
+ const action = getStr(a, "action");
740
+ const alertId = getStr(a, "alertId");
741
+ const body = action === "snooze" ? { until: getOptStr(a, "until") } : undefined;
742
+ return raw(c, "POST", `/applications/${encodeURIComponent(alertId)}/${encodeURIComponent(action)}`, body);
743
+ },
744
+ },
745
+ {
746
+ name: "assign_application_alert",
747
+ descriptionKey: "mcp.tools.assign_application_alert.description",
748
+ inputSchema: { type: "object", properties: { alertId: Sn, assigneeId: Sn }, required: ["alertId"] },
749
+ handler: async (a, c) => raw(c, "POST", `/applications/${encodeURIComponent(getStr(a, "alertId"))}/assign`, {
750
+ assigneeId: getOptStr(a, "assigneeId"),
751
+ }),
752
+ },
753
+ {
754
+ name: "list_appeals",
755
+ descriptionKey: "mcp.tools.list_appeals.description",
756
+ inputSchema: { type: "object", properties: { status: Sn, limit: Nn } },
757
+ handler: async (a, c) => raw(c, "GET", `/appeals${qs({ status: getOptStr(a, "status"), limit: getOptNum(a, "limit") })}`),
758
+ },
759
+ {
760
+ name: "decide_appeal",
761
+ descriptionKey: "mcp.tools.decide_appeal.description",
762
+ inputSchema: { type: "object", properties: { appealId: Sn, decision: Sn, reason: Sn }, required: ["appealId", "decision"] },
763
+ handler: async (a, c) => raw(c, "POST", `/appeals/${encodeURIComponent(getStr(a, "appealId"))}/decide`, {
764
+ decision: getStr(a, "decision"), reason: getOptStr(a, "reason"),
765
+ }),
766
+ },
767
+ {
768
+ name: "list_user_input_types",
769
+ descriptionKey: "mcp.tools.list_user_input_types.description",
770
+ inputSchema: { type: "object", properties: {} },
771
+ handler: async (_a, c) => raw(c, "GET", `/user-input`),
772
+ },
773
+ {
774
+ name: "create_user_input_type",
775
+ descriptionKey: "mcp.tools.create_user_input_type.description",
776
+ inputSchema: { type: "object", properties: { definition: On }, required: ["definition"] },
777
+ handler: async (a, c) => raw(c, "POST", `/user-input/types`, getObj(a, "definition")),
778
+ },
779
+ {
780
+ name: "delete_user_input_type",
781
+ descriptionKey: "mcp.tools.delete_user_input_type.description",
782
+ inputSchema: { type: "object", properties: { typeId: Sn }, required: ["typeId"] },
783
+ handler: async (a, c) => raw(c, "DELETE", `/user-input/types/${encodeURIComponent(getStr(a, "typeId"))}`),
784
+ },
785
+ {
786
+ name: "list_user_input_submissions",
787
+ descriptionKey: "mcp.tools.list_user_input_submissions.description",
788
+ inputSchema: { type: "object", properties: { typeId: Sn, status: Sn, limit: Nn } },
789
+ handler: async (a, c) => raw(c, "GET", `/user-input/submissions${qs({
790
+ typeId: getOptStr(a, "typeId"), status: getOptStr(a, "status"), limit: getOptNum(a, "limit"),
791
+ })}`),
792
+ },
793
+ {
794
+ name: "set_user_input_status",
795
+ descriptionKey: "mcp.tools.set_user_input_status.description",
796
+ inputSchema: { type: "object", properties: { submissionId: Sn, status: Sn, reason: Sn }, required: ["submissionId", "status"] },
797
+ handler: async (a, c) => raw(c, "POST", `/user-input/submissions/${encodeURIComponent(getStr(a, "submissionId"))}/status`, {
798
+ status: getStr(a, "status"), reason: getOptStr(a, "reason"),
799
+ }),
800
+ },
801
+ {
802
+ name: "comment_on_user_input",
803
+ descriptionKey: "mcp.tools.comment_on_user_input.description",
804
+ inputSchema: { type: "object", properties: { submissionId: Sn, body: Sn }, required: ["submissionId", "body"] },
805
+ handler: async (a, c) => raw(c, "POST", `/user-input/submissions/${encodeURIComponent(getStr(a, "submissionId"))}/comments`, {
806
+ body: getStr(a, "body"),
807
+ }),
808
+ },
809
+ // ═══════════════════════════════════════════════════════════════════════
810
+ // CUSTOM COMMANDS / SAVED RESPONSES (TAGS) / AUTORESPONDERS
811
+ // ═══════════════════════════════════════════════════════════════════════
812
+ {
813
+ name: "list_custom_commands",
814
+ descriptionKey: "mcp.tools.list_custom_commands.description",
815
+ inputSchema: { type: "object", properties: {} },
816
+ handler: async (_a, c) => raw(c, "GET", `/custom-commands`),
817
+ },
818
+ {
819
+ name: "get_custom_command",
820
+ descriptionKey: "mcp.tools.get_custom_command.description",
821
+ inputSchema: { type: "object", properties: { commandId: Sn }, required: ["commandId"] },
822
+ handler: async (a, c) => raw(c, "GET", `/custom-commands/commands/${encodeURIComponent(getStr(a, "commandId"))}`),
823
+ },
824
+ {
825
+ name: "save_custom_command",
826
+ descriptionKey: "mcp.tools.save_custom_command.description",
827
+ inputSchema: {
828
+ type: "object",
829
+ properties: { id: Sn, name: Sn, triggerMode: Sn, responseMode: Sn, body: On },
830
+ required: ["name", "triggerMode", "responseMode", "body"],
831
+ },
832
+ handler: async (a, c) => raw(c, "POST", `/custom-commands/commands`, {
833
+ id: getOptStr(a, "id"),
834
+ name: getStr(a, "name"),
835
+ triggerMode: getStr(a, "triggerMode"),
836
+ responseMode: getStr(a, "responseMode"),
837
+ body: getObj(a, "body"),
838
+ }),
839
+ },
840
+ {
841
+ name: "delete_custom_command",
842
+ descriptionKey: "mcp.tools.delete_custom_command.description",
843
+ inputSchema: { type: "object", properties: { commandId: Sn }, required: ["commandId"] },
844
+ handler: async (a, c) => raw(c, "DELETE", `/custom-commands/commands/${encodeURIComponent(getStr(a, "commandId"))}`),
845
+ },
846
+ {
847
+ name: "preview_custom_command",
848
+ descriptionKey: "mcp.tools.preview_custom_command.description",
849
+ inputSchema: { type: "object", properties: { body: On, sample: On }, required: ["body"] },
850
+ handler: async (a, c) => raw(c, "POST", `/custom-commands/preview`, { body: getObj(a, "body"), sample: getOptObj(a, "sample") }),
851
+ },
852
+ {
853
+ name: "export_custom_commands",
854
+ descriptionKey: "mcp.tools.export_custom_commands.description",
855
+ inputSchema: { type: "object", properties: {} },
856
+ handler: async (_a, c) => raw(c, "GET", `/custom-commands/export`),
857
+ },
858
+ {
859
+ name: "import_custom_commands",
860
+ descriptionKey: "mcp.tools.import_custom_commands.description",
861
+ inputSchema: { type: "object", properties: { data: On }, required: ["data"] },
862
+ handler: async (a, c) => raw(c, "POST", `/custom-commands/import`, getObj(a, "data")),
863
+ },
864
+ {
865
+ name: "list_tags",
866
+ descriptionKey: "mcp.tools.list_tags.description",
867
+ inputSchema: { type: "object", properties: {} },
868
+ handler: async (_a, c) => raw(c, "GET", `/saved-responses`),
869
+ },
870
+ {
871
+ name: "get_tag",
872
+ descriptionKey: "mcp.tools.get_tag.description",
873
+ inputSchema: { type: "object", properties: { tagId: Sn }, required: ["tagId"] },
874
+ handler: async (a, c) => raw(c, "GET", `/saved-responses/responses/${encodeURIComponent(getStr(a, "tagId"))}`),
875
+ },
876
+ {
877
+ name: "save_tag",
878
+ descriptionKey: "mcp.tools.save_tag.description",
879
+ inputSchema: { type: "object", properties: { id: Sn, name: Sn, body: On }, required: ["name", "body"] },
880
+ handler: async (a, c) => raw(c, "POST", `/saved-responses/responses`, {
881
+ id: getOptStr(a, "id"), name: getStr(a, "name"), body: getObj(a, "body"),
882
+ }),
883
+ },
884
+ {
885
+ name: "delete_tag",
886
+ descriptionKey: "mcp.tools.delete_tag.description",
887
+ inputSchema: { type: "object", properties: { tagId: Sn }, required: ["tagId"] },
888
+ handler: async (a, c) => raw(c, "DELETE", `/saved-responses/responses/${encodeURIComponent(getStr(a, "tagId"))}`),
889
+ },
890
+ {
891
+ name: "list_autoresponders",
892
+ descriptionKey: "mcp.tools.list_autoresponders.description",
893
+ inputSchema: { type: "object", properties: {} },
894
+ handler: async (_a, c) => raw(c, "GET", `/autoresponders`),
895
+ },
896
+ {
897
+ name: "save_autoresponder",
898
+ descriptionKey: "mcp.tools.save_autoresponder.description",
899
+ inputSchema: { type: "object", properties: { ruleId: Sn, definition: On }, required: ["definition"] },
900
+ handler: async (a, c) => {
901
+ const ruleId = getOptStr(a, "ruleId");
902
+ const def = getObj(a, "definition");
903
+ return ruleId
904
+ ? raw(c, "PATCH", `/autoresponders/${encodeURIComponent(ruleId)}`, def)
905
+ : raw(c, "POST", `/autoresponders`, def);
906
+ },
907
+ },
908
+ {
909
+ name: "delete_autoresponder",
910
+ descriptionKey: "mcp.tools.delete_autoresponder.description",
911
+ inputSchema: { type: "object", properties: { ruleId: Sn }, required: ["ruleId"] },
912
+ handler: async (a, c) => raw(c, "DELETE", `/autoresponders/${encodeURIComponent(getStr(a, "ruleId"))}`),
913
+ },
914
+ {
915
+ name: "duplicate_autoresponder",
916
+ descriptionKey: "mcp.tools.duplicate_autoresponder.description",
917
+ inputSchema: { type: "object", properties: { ruleId: Sn }, required: ["ruleId"] },
918
+ handler: async (a, c) => raw(c, "POST", `/autoresponders/${encodeURIComponent(getStr(a, "ruleId"))}/duplicate`),
919
+ },
920
+ {
921
+ name: "test_autoresponder",
922
+ descriptionKey: "mcp.tools.test_autoresponder.description",
923
+ inputSchema: { type: "object", properties: { content: Sn, channelId: Sn, ruleId: Sn }, required: ["content"] },
924
+ handler: async (a, c) => raw(c, "POST", `/autoresponders/test`, {
925
+ content: getStr(a, "content"), channelId: getOptStr(a, "channelId"), ruleId: getOptStr(a, "ruleId"),
926
+ }),
927
+ },
928
+ {
929
+ name: "list_autoresponder_telemetry",
930
+ descriptionKey: "mcp.tools.list_autoresponder_telemetry.description",
931
+ inputSchema: { type: "object", properties: { limit: Nn } },
932
+ handler: async (a, c) => raw(c, "GET", `/autoresponders/telemetry${qs({ limit: getOptNum(a, "limit") })}`),
933
+ },
934
+ // ═══════════════════════════════════════════════════════════════════════
935
+ // AUTOMATIONS / SCHEDULED ACTIONS / ROLE EVENTS / AUTOPING
936
+ // ═══════════════════════════════════════════════════════════════════════
937
+ {
938
+ name: "list_automation_rules",
939
+ descriptionKey: "mcp.tools.list_automation_rules.description",
940
+ inputSchema: { type: "object", properties: {} },
941
+ handler: async (_a, c) => raw(c, "GET", `/automations`),
942
+ },
943
+ {
944
+ name: "get_automation_rule",
945
+ descriptionKey: "mcp.tools.get_automation_rule.description",
946
+ inputSchema: { type: "object", properties: { ruleId: Sn }, required: ["ruleId"] },
947
+ handler: async (a, c) => raw(c, "GET", `/automations/rules/${encodeURIComponent(getStr(a, "ruleId"))}`),
948
+ },
949
+ {
950
+ name: "create_automation_rule",
951
+ descriptionKey: "mcp.tools.create_automation_rule.description",
952
+ inputSchema: { type: "object", properties: { definition: On }, required: ["definition"] },
953
+ handler: async (a, c) => raw(c, "POST", `/automations/rules`, getObj(a, "definition")),
954
+ },
955
+ {
956
+ name: "update_automation_rule",
957
+ descriptionKey: "mcp.tools.update_automation_rule.description",
958
+ inputSchema: { type: "object", properties: { ruleId: Sn, patch: On }, required: ["ruleId", "patch"] },
959
+ handler: async (a, c) => raw(c, "PATCH", `/automations/rules/${encodeURIComponent(getStr(a, "ruleId"))}`, getObj(a, "patch")),
960
+ },
961
+ {
962
+ name: "delete_automation_rule",
963
+ descriptionKey: "mcp.tools.delete_automation_rule.description",
964
+ inputSchema: { type: "object", properties: { ruleId: Sn }, required: ["ruleId"] },
965
+ handler: async (a, c) => raw(c, "DELETE", `/automations/rules/${encodeURIComponent(getStr(a, "ruleId"))}`),
966
+ },
967
+ {
968
+ name: "test_automation_rule",
969
+ descriptionKey: "mcp.tools.test_automation_rule.description",
970
+ inputSchema: { type: "object", properties: { definition: On, sample: On }, required: ["definition"] },
971
+ handler: async (a, c) => raw(c, "POST", `/automations/test`, { definition: getObj(a, "definition"), sample: getOptObj(a, "sample") }),
972
+ },
973
+ {
974
+ name: "run_automation_rule_now",
975
+ descriptionKey: "mcp.tools.run_automation_rule_now.description",
976
+ inputSchema: { type: "object", properties: { ruleId: Sn, payload: On }, required: ["ruleId"] },
977
+ handler: async (a, c) => raw(c, "POST", `/automations/rules/${encodeURIComponent(getStr(a, "ruleId"))}/run`, {
978
+ payload: getOptObj(a, "payload"),
979
+ }),
980
+ },
981
+ {
982
+ name: "list_scheduled_actions",
983
+ descriptionKey: "mcp.tools.list_scheduled_actions.description",
984
+ inputSchema: { type: "object", properties: { kind: Sn, limit: Nn } },
985
+ handler: async (a, c) => raw(c, "GET", `/scheduled-actions${qs({ kind: getOptStr(a, "kind"), limit: getOptNum(a, "limit") })}`),
986
+ },
987
+ {
988
+ name: "get_scheduled_action",
989
+ descriptionKey: "mcp.tools.get_scheduled_action.description",
990
+ inputSchema: { type: "object", properties: { actionId: Sn }, required: ["actionId"] },
991
+ handler: async (a, c) => raw(c, "GET", `/scheduled-actions/${encodeURIComponent(getStr(a, "actionId"))}`),
992
+ },
993
+ {
994
+ name: "create_scheduled_action",
995
+ descriptionKey: "mcp.tools.create_scheduled_action.description",
996
+ inputSchema: { type: "object", properties: { kind: Sn, runAt: Sn, payload: On, cron: Sn }, required: ["kind"] },
997
+ handler: async (a, c) => raw(c, "POST", `/scheduled-actions`, {
998
+ kind: getStr(a, "kind"),
999
+ runAt: getOptStr(a, "runAt"),
1000
+ cron: getOptStr(a, "cron"),
1001
+ payload: getOptObj(a, "payload") ?? {},
1002
+ }),
1003
+ },
1004
+ {
1005
+ name: "update_scheduled_action",
1006
+ descriptionKey: "mcp.tools.update_scheduled_action.description",
1007
+ inputSchema: { type: "object", properties: { actionId: Sn, patch: On }, required: ["actionId", "patch"] },
1008
+ handler: async (a, c) => raw(c, "PATCH", `/scheduled-actions/${encodeURIComponent(getStr(a, "actionId"))}`, getObj(a, "patch")),
1009
+ },
1010
+ {
1011
+ name: "delete_scheduled_action",
1012
+ descriptionKey: "mcp.tools.delete_scheduled_action.description",
1013
+ inputSchema: { type: "object", properties: { actionId: Sn }, required: ["actionId"] },
1014
+ handler: async (a, c) => raw(c, "DELETE", `/scheduled-actions/${encodeURIComponent(getStr(a, "actionId"))}`),
1015
+ },
1016
+ {
1017
+ name: "run_scheduled_action_now",
1018
+ descriptionKey: "mcp.tools.run_scheduled_action_now.description",
1019
+ inputSchema: { type: "object", properties: { actionId: Sn }, required: ["actionId"] },
1020
+ handler: async (a, c) => raw(c, "POST", `/scheduled-actions/${encodeURIComponent(getStr(a, "actionId"))}/run`),
1021
+ },
1022
+ {
1023
+ name: "list_role_event_rules",
1024
+ descriptionKey: "mcp.tools.list_role_event_rules.description",
1025
+ inputSchema: { type: "object", properties: {} },
1026
+ handler: async (_a, c) => raw(c, "GET", `/role-events`),
1027
+ },
1028
+ {
1029
+ name: "save_role_event_rule",
1030
+ descriptionKey: "mcp.tools.save_role_event_rule.description",
1031
+ inputSchema: { type: "object", properties: { definition: On }, required: ["definition"] },
1032
+ handler: async (a, c) => raw(c, "POST", `/role-events/rules`, getObj(a, "definition")),
1033
+ },
1034
+ {
1035
+ name: "delete_role_event_rule",
1036
+ descriptionKey: "mcp.tools.delete_role_event_rule.description",
1037
+ inputSchema: { type: "object", properties: { ruleId: Sn }, required: ["ruleId"] },
1038
+ handler: async (a, c) => raw(c, "DELETE", `/role-events/rules/${encodeURIComponent(getStr(a, "ruleId"))}`),
1039
+ },
1040
+ {
1041
+ name: "test_role_event_rule",
1042
+ descriptionKey: "mcp.tools.test_role_event_rule.description",
1043
+ inputSchema: { type: "object", properties: { sample: On }, required: ["sample"] },
1044
+ handler: async (a, c) => raw(c, "POST", `/role-events/test`, getObj(a, "sample")),
1045
+ },
1046
+ {
1047
+ name: "list_role_event_log",
1048
+ descriptionKey: "mcp.tools.list_role_event_log.description",
1049
+ inputSchema: { type: "object", properties: { limit: Nn } },
1050
+ handler: async (a, c) => raw(c, "GET", `/role-events/log${qs({ limit: getOptNum(a, "limit") })}`),
1051
+ },
1052
+ {
1053
+ name: "list_autoping_rules",
1054
+ descriptionKey: "mcp.tools.list_autoping_rules.description",
1055
+ inputSchema: { type: "object", properties: {} },
1056
+ handler: async (_a, c) => raw(c, "GET", `/autoping`),
1057
+ },
1058
+ {
1059
+ name: "create_autoping_rule",
1060
+ descriptionKey: "mcp.tools.create_autoping_rule.description",
1061
+ inputSchema: { type: "object", properties: { definition: On }, required: ["definition"] },
1062
+ handler: async (a, c) => raw(c, "POST", `/autoping/rules`, getObj(a, "definition")),
1063
+ },
1064
+ {
1065
+ name: "update_autoping_rule",
1066
+ descriptionKey: "mcp.tools.update_autoping_rule.description",
1067
+ inputSchema: { type: "object", properties: { ruleId: Sn, patch: On }, required: ["ruleId", "patch"] },
1068
+ handler: async (a, c) => raw(c, "PATCH", `/autoping/rules/${encodeURIComponent(getStr(a, "ruleId"))}`, getObj(a, "patch")),
1069
+ },
1070
+ {
1071
+ name: "delete_autoping_rule",
1072
+ descriptionKey: "mcp.tools.delete_autoping_rule.description",
1073
+ inputSchema: { type: "object", properties: { ruleId: Sn }, required: ["ruleId"] },
1074
+ handler: async (a, c) => raw(c, "DELETE", `/autoping/rules/${encodeURIComponent(getStr(a, "ruleId"))}`),
1075
+ },
1076
+ {
1077
+ name: "update_autoping_settings",
1078
+ descriptionKey: "mcp.tools.update_autoping_settings.description",
1079
+ inputSchema: { type: "object", properties: { patch: On }, required: ["patch"] },
1080
+ handler: async (a, c) => raw(c, "PATCH", `/autoping/settings`, getObj(a, "patch")),
1081
+ },
1082
+ // ═══════════════════════════════════════════════════════════════════════
1083
+ // ENGAGEMENT — LEVELING / ECONOMY / REPUTATION
1084
+ // ═══════════════════════════════════════════════════════════════════════
1085
+ {
1086
+ name: "get_leveling_overview",
1087
+ descriptionKey: "mcp.tools.get_leveling_overview.description",
1088
+ inputSchema: { type: "object", properties: {} },
1089
+ handler: async (_a, c) => raw(c, "GET", `/leveling`),
1090
+ },
1091
+ {
1092
+ name: "get_leveling_top",
1093
+ descriptionKey: "mcp.tools.get_leveling_top.description",
1094
+ inputSchema: { type: "object", properties: { limit: Nn, scope: Sn } },
1095
+ handler: async (a, c) => raw(c, "GET", `/leveling/top${qs({ limit: getOptNum(a, "limit"), scope: getOptStr(a, "scope") })}`),
1096
+ },
1097
+ {
1098
+ name: "get_member_xp",
1099
+ descriptionKey: "mcp.tools.get_member_xp.description",
1100
+ inputSchema: { type: "object", properties: { userId: Sn }, required: ["userId"] },
1101
+ handler: async (a, c) => raw(c, "GET", `/leveling/users/${encodeURIComponent(getStr(a, "userId"))}`),
1102
+ },
1103
+ {
1104
+ name: "set_member_xp",
1105
+ descriptionKey: "mcp.tools.set_member_xp.description",
1106
+ inputSchema: { type: "object", properties: { userId: Sn, xp: Nn }, required: ["userId", "xp"] },
1107
+ handler: async (a, c) => raw(c, "POST", `/leveling/users/xp`, { userId: getStr(a, "userId"), xp: getOptNum(a, "xp"), op: "set" }),
1108
+ },
1109
+ {
1110
+ name: "give_xp",
1111
+ descriptionKey: "mcp.tools.give_xp.description",
1112
+ inputSchema: { type: "object", properties: { userId: Sn, amount: Nn, reason: Sn }, required: ["userId", "amount"] },
1113
+ handler: async (a, c) => raw(c, "POST", `/leveling/xp/give`, { userId: getStr(a, "userId"), amount: getOptNum(a, "amount"), reason: getOptStr(a, "reason") }),
1114
+ },
1115
+ {
1116
+ name: "take_xp",
1117
+ descriptionKey: "mcp.tools.take_xp.description",
1118
+ inputSchema: { type: "object", properties: { userId: Sn, amount: Nn, reason: Sn }, required: ["userId", "amount"] },
1119
+ handler: async (a, c) => raw(c, "POST", `/leveling/xp/take`, { userId: getStr(a, "userId"), amount: getOptNum(a, "amount"), reason: getOptStr(a, "reason") }),
1120
+ },
1121
+ {
1122
+ name: "reset_member_xp",
1123
+ descriptionKey: "mcp.tools.reset_member_xp.description",
1124
+ inputSchema: { type: "object", properties: { userId: Sn }, required: ["userId"] },
1125
+ handler: async (a, c) => raw(c, "DELETE", `/leveling/users/${encodeURIComponent(getStr(a, "userId"))}`),
1126
+ },
1127
+ {
1128
+ name: "list_xp_rewards",
1129
+ descriptionKey: "mcp.tools.list_xp_rewards.description",
1130
+ inputSchema: { type: "object", properties: {} },
1131
+ handler: async (_a, c) => raw(c, "GET", `/leveling/rewards`),
1132
+ },
1133
+ {
1134
+ name: "save_xp_reward",
1135
+ descriptionKey: "mcp.tools.save_xp_reward.description",
1136
+ inputSchema: { type: "object", properties: { definition: On }, required: ["definition"] },
1137
+ handler: async (a, c) => raw(c, "POST", `/leveling/rewards`, getObj(a, "definition")),
1138
+ },
1139
+ {
1140
+ name: "delete_xp_reward",
1141
+ descriptionKey: "mcp.tools.delete_xp_reward.description",
1142
+ inputSchema: { type: "object", properties: { rewardId: Sn }, required: ["rewardId"] },
1143
+ handler: async (a, c) => raw(c, "DELETE", `/leveling/rewards/${encodeURIComponent(getStr(a, "rewardId"))}`),
1144
+ },
1145
+ {
1146
+ name: "sync_xp_rewards",
1147
+ descriptionKey: "mcp.tools.sync_xp_rewards.description",
1148
+ inputSchema: { type: "object", properties: {} },
1149
+ handler: async (_a, c) => raw(c, "POST", `/leveling/rewards/sync`),
1150
+ },
1151
+ {
1152
+ name: "save_xp_reward_action",
1153
+ descriptionKey: "mcp.tools.save_xp_reward_action.description",
1154
+ inputSchema: { type: "object", properties: { definition: On }, required: ["definition"] },
1155
+ handler: async (a, c) => raw(c, "POST", `/leveling/reward-actions`, getObj(a, "definition")),
1156
+ },
1157
+ {
1158
+ name: "export_leveling",
1159
+ descriptionKey: "mcp.tools.export_leveling.description",
1160
+ inputSchema: { type: "object", properties: {} },
1161
+ handler: async (_a, c) => raw(c, "GET", `/leveling/export`),
1162
+ },
1163
+ {
1164
+ name: "import_leveling",
1165
+ descriptionKey: "mcp.tools.import_leveling.description",
1166
+ inputSchema: { type: "object", properties: { data: On }, required: ["data"] },
1167
+ handler: async (a, c) => raw(c, "POST", `/leveling/import`, getObj(a, "data")),
1168
+ },
1169
+ {
1170
+ name: "get_economy_settings",
1171
+ descriptionKey: "mcp.tools.get_economy_settings.description",
1172
+ inputSchema: { type: "object", properties: {} },
1173
+ handler: async (_a, c) => raw(c, "GET", `/economy`),
1174
+ },
1175
+ {
1176
+ name: "update_economy_settings",
1177
+ descriptionKey: "mcp.tools.update_economy_settings.description",
1178
+ inputSchema: { type: "object", properties: { patch: On }, required: ["patch"] },
1179
+ handler: async (a, c) => raw(c, "PATCH", `/settings`, { module: "economy", patch: getObj(a, "patch") }),
1180
+ },
1181
+ {
1182
+ name: "get_member_balance",
1183
+ descriptionKey: "mcp.tools.get_member_balance.description",
1184
+ inputSchema: { type: "object", properties: { userId: Sn }, required: ["userId"] },
1185
+ handler: async (a, c) => raw(c, "GET", `/economy/users/${encodeURIComponent(getStr(a, "userId"))}/balance`),
1186
+ },
1187
+ {
1188
+ name: "set_member_balance",
1189
+ descriptionKey: "mcp.tools.set_member_balance.description",
1190
+ inputSchema: { type: "object", properties: { userId: Sn, balance: Nn }, required: ["userId", "balance"] },
1191
+ handler: async (a, c) => raw(c, "POST", `/economy/users/balance`, { userId: getStr(a, "userId"), balance: getOptNum(a, "balance"), op: "set" }),
1192
+ },
1193
+ {
1194
+ name: "give_currency",
1195
+ descriptionKey: "mcp.tools.give_currency.description",
1196
+ inputSchema: { type: "object", properties: { userId: Sn, amount: Nn, reason: Sn }, required: ["userId", "amount"] },
1197
+ handler: async (a, c) => raw(c, "POST", `/economy/give`, { userId: getStr(a, "userId"), amount: getOptNum(a, "amount"), reason: getOptStr(a, "reason") }),
1198
+ },
1199
+ {
1200
+ name: "take_currency",
1201
+ descriptionKey: "mcp.tools.take_currency.description",
1202
+ inputSchema: { type: "object", properties: { userId: Sn, amount: Nn, reason: Sn }, required: ["userId", "amount"] },
1203
+ handler: async (a, c) => raw(c, "POST", `/economy/take`, { userId: getStr(a, "userId"), amount: getOptNum(a, "amount"), reason: getOptStr(a, "reason") }),
1204
+ },
1205
+ {
1206
+ name: "list_economy_top",
1207
+ descriptionKey: "mcp.tools.list_economy_top.description",
1208
+ inputSchema: { type: "object", properties: { limit: Nn } },
1209
+ handler: async (a, c) => raw(c, "GET", `/economy/top${qs({ limit: getOptNum(a, "limit") })}`),
1210
+ },
1211
+ {
1212
+ name: "list_economy_transactions",
1213
+ descriptionKey: "mcp.tools.list_economy_transactions.description",
1214
+ inputSchema: { type: "object", properties: { userId: Sn, limit: Nn } },
1215
+ handler: async (a, c) => raw(c, "GET", `/economy/transactions${qs({ userId: getOptStr(a, "userId"), limit: getOptNum(a, "limit") })}`),
1216
+ },
1217
+ {
1218
+ name: "list_shop_items",
1219
+ descriptionKey: "mcp.tools.list_shop_items.description",
1220
+ inputSchema: { type: "object", properties: {} },
1221
+ handler: async (_a, c) => raw(c, "GET", `/economy/shop`),
1222
+ },
1223
+ {
1224
+ name: "save_shop_item",
1225
+ descriptionKey: "mcp.tools.save_shop_item.description",
1226
+ inputSchema: { type: "object", properties: { itemId: Sn, definition: On }, required: ["definition"] },
1227
+ handler: async (a, c) => {
1228
+ const itemId = getOptStr(a, "itemId");
1229
+ const def = getObj(a, "definition");
1230
+ return itemId
1231
+ ? raw(c, "PATCH", `/economy/shop/${encodeURIComponent(itemId)}`, def)
1232
+ : raw(c, "POST", `/economy/shop`, def);
1233
+ },
1234
+ },
1235
+ {
1236
+ name: "delete_shop_item",
1237
+ descriptionKey: "mcp.tools.delete_shop_item.description",
1238
+ inputSchema: { type: "object", properties: { itemId: Sn }, required: ["itemId"] },
1239
+ handler: async (a, c) => raw(c, "DELETE", `/economy/shop/${encodeURIComponent(getStr(a, "itemId"))}`),
1240
+ },
1241
+ {
1242
+ name: "prune_inactive_economy",
1243
+ descriptionKey: "mcp.tools.prune_inactive_economy.description",
1244
+ inputSchema: { type: "object", properties: { thresholdDays: Nn } },
1245
+ handler: async (a, c) => raw(c, "POST", `/economy/prune`, { thresholdDays: getOptNum(a, "thresholdDays") }),
1246
+ },
1247
+ {
1248
+ name: "get_economy_stats",
1249
+ descriptionKey: "mcp.tools.get_economy_stats.description",
1250
+ inputSchema: { type: "object", properties: {} },
1251
+ handler: async (_a, c) => raw(c, "GET", `/economy/stats`),
1252
+ },
1253
+ {
1254
+ name: "get_rep_settings",
1255
+ descriptionKey: "mcp.tools.get_rep_settings.description",
1256
+ inputSchema: { type: "object", properties: {} },
1257
+ handler: async (_a, c) => raw(c, "GET", `/reputation`),
1258
+ },
1259
+ {
1260
+ name: "get_member_rep",
1261
+ descriptionKey: "mcp.tools.get_member_rep.description",
1262
+ inputSchema: { type: "object", properties: { userId: Sn }, required: ["userId"] },
1263
+ handler: async (a, c) => raw(c, "GET", `/reputation/users/${encodeURIComponent(getStr(a, "userId"))}`),
1264
+ },
1265
+ {
1266
+ name: "give_rep",
1267
+ descriptionKey: "mcp.tools.give_rep.description",
1268
+ inputSchema: { type: "object", properties: { userId: Sn, amount: Nn, reason: Sn }, required: ["userId"] },
1269
+ handler: async (a, c) => raw(c, "POST", `/reputation/adjust`, {
1270
+ userId: getStr(a, "userId"), amount: getOptNum(a, "amount") ?? 1, reason: getOptStr(a, "reason"),
1271
+ }),
1272
+ },
1273
+ {
1274
+ name: "list_rep_top",
1275
+ descriptionKey: "mcp.tools.list_rep_top.description",
1276
+ inputSchema: { type: "object", properties: { limit: Nn } },
1277
+ handler: async (a, c) => raw(c, "GET", `/reputation/top${qs({ limit: getOptNum(a, "limit") })}`),
1278
+ },
1279
+ {
1280
+ name: "decide_rep_review",
1281
+ descriptionKey: "mcp.tools.decide_rep_review.description",
1282
+ inputSchema: { type: "object", properties: { reviewId: Sn, action: Sn }, required: ["reviewId", "action"] },
1283
+ handler: async (a, c) => raw(c, "POST", `/reputation/reviews/${encodeURIComponent(getStr(a, "reviewId"))}/${encodeURIComponent(getStr(a, "action"))}`),
1284
+ },
1285
+ {
1286
+ name: "run_rep_decay",
1287
+ descriptionKey: "mcp.tools.run_rep_decay.description",
1288
+ inputSchema: { type: "object", properties: {} },
1289
+ handler: async (_a, c) => raw(c, "POST", `/reputation/decay/run`),
1290
+ },
1291
+ // ═══════════════════════════════════════════════════════════════════════
1292
+ // ENGAGEMENT — GIVEAWAYS / STARBOARD / POLLS / AMA / TIME-CAPSULE
1293
+ // ═══════════════════════════════════════════════════════════════════════
1294
+ {
1295
+ name: "list_giveaways",
1296
+ descriptionKey: "mcp.tools.list_giveaways.description",
1297
+ inputSchema: { type: "object", properties: { status: Sn, limit: Nn } },
1298
+ handler: async (a, c) => raw(c, "GET", `/giveaways${qs({ status: getOptStr(a, "status"), limit: getOptNum(a, "limit") })}`),
1299
+ },
1300
+ {
1301
+ name: "get_giveaway",
1302
+ descriptionKey: "mcp.tools.get_giveaway.description",
1303
+ inputSchema: { type: "object", properties: { giveawayId: Sn }, required: ["giveawayId"] },
1304
+ handler: async (a, c) => raw(c, "GET", `/giveaways/${encodeURIComponent(getStr(a, "giveawayId"))}/health`),
1305
+ },
1306
+ {
1307
+ name: "create_giveaway",
1308
+ descriptionKey: "mcp.tools.create_giveaway.description",
1309
+ inputSchema: { type: "object", properties: { definition: On }, required: ["definition"] },
1310
+ handler: async (a, c) => raw(c, "POST", `/giveaways`, getObj(a, "definition")),
1311
+ },
1312
+ {
1313
+ name: "update_giveaway",
1314
+ descriptionKey: "mcp.tools.update_giveaway.description",
1315
+ inputSchema: { type: "object", properties: { giveawayId: Sn, patch: On }, required: ["giveawayId", "patch"] },
1316
+ handler: async (a, c) => raw(c, "PATCH", `/giveaways/${encodeURIComponent(getStr(a, "giveawayId"))}`, getObj(a, "patch")),
1317
+ },
1318
+ {
1319
+ name: "end_giveaway",
1320
+ descriptionKey: "mcp.tools.end_giveaway.description",
1321
+ inputSchema: { type: "object", properties: { giveawayId: Sn }, required: ["giveawayId"] },
1322
+ handler: async (a, c) => raw(c, "POST", `/giveaways/${encodeURIComponent(getStr(a, "giveawayId"))}/end`),
1323
+ },
1324
+ {
1325
+ name: "reroll_giveaway",
1326
+ descriptionKey: "mcp.tools.reroll_giveaway.description",
1327
+ inputSchema: { type: "object", properties: { giveawayId: Sn, count: Nn }, required: ["giveawayId"] },
1328
+ handler: async (a, c) => raw(c, "POST", `/giveaways/${encodeURIComponent(getStr(a, "giveawayId"))}/reroll`, { count: getOptNum(a, "count") }),
1329
+ },
1330
+ {
1331
+ name: "cancel_giveaway",
1332
+ descriptionKey: "mcp.tools.cancel_giveaway.description",
1333
+ inputSchema: { type: "object", properties: { giveawayId: Sn }, required: ["giveawayId"] },
1334
+ handler: async (a, c) => raw(c, "POST", `/giveaways/${encodeURIComponent(getStr(a, "giveawayId"))}/cancel`),
1335
+ },
1336
+ {
1337
+ name: "publish_giveaway",
1338
+ descriptionKey: "mcp.tools.publish_giveaway.description",
1339
+ inputSchema: { type: "object", properties: { giveawayId: Sn }, required: ["giveawayId"] },
1340
+ handler: async (a, c) => raw(c, "POST", `/giveaways/${encodeURIComponent(getStr(a, "giveawayId"))}/publish`),
1341
+ },
1342
+ {
1343
+ name: "clone_giveaway",
1344
+ descriptionKey: "mcp.tools.clone_giveaway.description",
1345
+ inputSchema: { type: "object", properties: { giveawayId: Sn }, required: ["giveawayId"] },
1346
+ handler: async (a, c) => raw(c, "POST", `/giveaways/${encodeURIComponent(getStr(a, "giveawayId"))}/clone`),
1347
+ },
1348
+ {
1349
+ name: "delete_giveaway",
1350
+ descriptionKey: "mcp.tools.delete_giveaway.description",
1351
+ inputSchema: { type: "object", properties: { giveawayId: Sn }, required: ["giveawayId"] },
1352
+ handler: async (a, c) => raw(c, "DELETE", `/giveaways/${encodeURIComponent(getStr(a, "giveawayId"))}`),
1353
+ },
1354
+ {
1355
+ name: "list_giveaway_winners",
1356
+ descriptionKey: "mcp.tools.list_giveaway_winners.description",
1357
+ inputSchema: { type: "object", properties: { giveawayId: Sn }, required: ["giveawayId"] },
1358
+ handler: async (a, c) => raw(c, "GET", `/giveaways/${encodeURIComponent(getStr(a, "giveawayId"))}/analysis`),
1359
+ },
1360
+ {
1361
+ name: "list_giveaway_entries",
1362
+ descriptionKey: "mcp.tools.list_giveaway_entries.description",
1363
+ inputSchema: { type: "object", properties: { giveawayId: Sn }, required: ["giveawayId"] },
1364
+ handler: async (a, c) => raw(c, "GET", `/giveaways/${encodeURIComponent(getStr(a, "giveawayId"))}/export`),
1365
+ },
1366
+ {
1367
+ name: "check_giveaway_eligibility",
1368
+ descriptionKey: "mcp.tools.check_giveaway_eligibility.description",
1369
+ inputSchema: { type: "object", properties: { giveawayId: Sn, userId: Sn }, required: ["giveawayId", "userId"] },
1370
+ handler: async (a, c) => raw(c, "GET", `/giveaways/${encodeURIComponent(getStr(a, "giveawayId"))}/eligibility/${encodeURIComponent(getStr(a, "userId"))}`),
1371
+ },
1372
+ {
1373
+ name: "list_starboards",
1374
+ descriptionKey: "mcp.tools.list_starboards.description",
1375
+ inputSchema: { type: "object", properties: {} },
1376
+ handler: async (_a, c) => raw(c, "GET", `/starboard`),
1377
+ },
1378
+ {
1379
+ name: "save_starboard",
1380
+ descriptionKey: "mcp.tools.save_starboard.description",
1381
+ inputSchema: { type: "object", properties: { definition: On }, required: ["definition"] },
1382
+ handler: async (a, c) => raw(c, "POST", `/starboard/boards`, getObj(a, "definition")),
1383
+ },
1384
+ {
1385
+ name: "delete_starboard",
1386
+ descriptionKey: "mcp.tools.delete_starboard.description",
1387
+ inputSchema: { type: "object", properties: { boardId: Sn }, required: ["boardId"] },
1388
+ handler: async (a, c) => raw(c, "DELETE", `/starboard/boards/${encodeURIComponent(getStr(a, "boardId"))}`),
1389
+ },
1390
+ {
1391
+ name: "list_starboard_top",
1392
+ descriptionKey: "mcp.tools.list_starboard_top.description",
1393
+ inputSchema: { type: "object", properties: { boardId: Sn, limit: Nn } },
1394
+ handler: async (a, c) => raw(c, "GET", `/starboard/top${qs({ boardId: getOptStr(a, "boardId"), limit: getOptNum(a, "limit") })}`),
1395
+ },
1396
+ {
1397
+ name: "starboard_post_action",
1398
+ descriptionKey: "mcp.tools.starboard_post_action.description",
1399
+ inputSchema: { type: "object", properties: { postId: Sn, action: Sn }, required: ["postId", "action"] },
1400
+ handler: async (a, c) => raw(c, "POST", `/starboard/posts/${encodeURIComponent(getStr(a, "postId"))}/actions`, { action: getStr(a, "action") }),
1401
+ },
1402
+ {
1403
+ name: "save_starboard_reward",
1404
+ descriptionKey: "mcp.tools.save_starboard_reward.description",
1405
+ inputSchema: { type: "object", properties: { boardId: Sn, definition: On }, required: ["boardId", "definition"] },
1406
+ handler: async (a, c) => raw(c, "POST", `/starboard/boards/${encodeURIComponent(getStr(a, "boardId"))}/rewards`, getObj(a, "definition")),
1407
+ },
1408
+ {
1409
+ name: "starboard_diagnostics",
1410
+ descriptionKey: "mcp.tools.starboard_diagnostics.description",
1411
+ inputSchema: { type: "object", properties: {} },
1412
+ handler: async (_a, c) => raw(c, "GET", `/starboard/diagnostics`),
1413
+ },
1414
+ {
1415
+ name: "list_polls",
1416
+ descriptionKey: "mcp.tools.list_polls.description",
1417
+ inputSchema: { type: "object", properties: { status: Sn, limit: Nn } },
1418
+ handler: async (a, c) => raw(c, "GET", `/polls${qs({ status: getOptStr(a, "status"), limit: getOptNum(a, "limit") })}`),
1419
+ },
1420
+ {
1421
+ name: "create_poll",
1422
+ descriptionKey: "mcp.tools.create_poll.description",
1423
+ inputSchema: { type: "object", properties: { definition: On }, required: ["definition"] },
1424
+ handler: async (a, c) => raw(c, "POST", `/polls`, getObj(a, "definition")),
1425
+ },
1426
+ {
1427
+ name: "close_poll",
1428
+ descriptionKey: "mcp.tools.close_poll.description",
1429
+ inputSchema: { type: "object", properties: { pollId: Sn }, required: ["pollId"] },
1430
+ handler: async (a, c) => raw(c, "POST", `/polls/${encodeURIComponent(getStr(a, "pollId"))}/close`),
1431
+ },
1432
+ {
1433
+ name: "reopen_poll",
1434
+ descriptionKey: "mcp.tools.reopen_poll.description",
1435
+ inputSchema: { type: "object", properties: { pollId: Sn }, required: ["pollId"] },
1436
+ handler: async (a, c) => raw(c, "POST", `/polls/${encodeURIComponent(getStr(a, "pollId"))}/reopen`),
1437
+ },
1438
+ {
1439
+ name: "get_poll_results",
1440
+ descriptionKey: "mcp.tools.get_poll_results.description",
1441
+ inputSchema: { type: "object", properties: { pollId: Sn }, required: ["pollId"] },
1442
+ handler: async (a, c) => raw(c, "GET", `/polls/${encodeURIComponent(getStr(a, "pollId"))}/export.csv`),
1443
+ },
1444
+ {
1445
+ name: "delete_poll",
1446
+ descriptionKey: "mcp.tools.delete_poll.description",
1447
+ inputSchema: { type: "object", properties: { pollId: Sn }, required: ["pollId"] },
1448
+ handler: async (a, c) => raw(c, "DELETE", `/polls/${encodeURIComponent(getStr(a, "pollId"))}`),
1449
+ },
1450
+ {
1451
+ name: "list_amas",
1452
+ descriptionKey: "mcp.tools.list_amas.description",
1453
+ inputSchema: { type: "object", properties: {} },
1454
+ handler: async (_a, c) => raw(c, "GET", `/ama`),
1455
+ },
1456
+ {
1457
+ name: "create_ama_session",
1458
+ descriptionKey: "mcp.tools.create_ama_session.description",
1459
+ inputSchema: { type: "object", properties: { definition: On }, required: ["definition"] },
1460
+ handler: async (a, c) => raw(c, "POST", `/ama/session`, getObj(a, "definition")),
1461
+ },
1462
+ {
1463
+ name: "close_ama_session",
1464
+ descriptionKey: "mcp.tools.close_ama_session.description",
1465
+ inputSchema: { type: "object", properties: { sessionId: Sn }, required: ["sessionId"] },
1466
+ handler: async (a, c) => raw(c, "POST", `/ama/session/${encodeURIComponent(getStr(a, "sessionId"))}/close`),
1467
+ },
1468
+ {
1469
+ name: "decide_ama_question",
1470
+ descriptionKey: "mcp.tools.decide_ama_question.description",
1471
+ inputSchema: { type: "object", properties: { sessionId: Sn, questionId: Sn, decision: { type: "string", enum: ["approve", "reject"] }, reason: Sn }, required: ["sessionId", "questionId", "decision"] },
1472
+ handler: async (a, c) => raw(c, "POST", `/ama/session/${encodeURIComponent(getStr(a, "sessionId"))}/questions/${encodeURIComponent(getStr(a, "questionId"))}/${getStr(a, "decision")}`, {
1473
+ reason: getOptStr(a, "reason"),
1474
+ }),
1475
+ },
1476
+ {
1477
+ name: "answer_ama_question",
1478
+ descriptionKey: "mcp.tools.answer_ama_question.description",
1479
+ inputSchema: { type: "object", properties: { sessionId: Sn, questionId: Sn, answer: Sn }, required: ["sessionId", "questionId", "answer"] },
1480
+ handler: async (a, c) => raw(c, "POST", `/ama/session/${encodeURIComponent(getStr(a, "sessionId"))}/questions/${encodeURIComponent(getStr(a, "questionId"))}/answer`, {
1481
+ answer: getStr(a, "answer"),
1482
+ }),
1483
+ },
1484
+ {
1485
+ name: "list_time_capsules",
1486
+ descriptionKey: "mcp.tools.list_time_capsules.description",
1487
+ inputSchema: { type: "object", properties: {} },
1488
+ handler: async (_a, c) => raw(c, "GET", `/time-capsules`),
1489
+ },
1490
+ {
1491
+ name: "get_time_capsule",
1492
+ descriptionKey: "mcp.tools.get_time_capsule.description",
1493
+ inputSchema: { type: "object", properties: { capsuleId: Sn }, required: ["capsuleId"] },
1494
+ handler: async (a, c) => raw(c, "GET", `/time-capsules/${encodeURIComponent(getStr(a, "capsuleId"))}`),
1495
+ },
1496
+ {
1497
+ name: "create_time_capsule",
1498
+ descriptionKey: "mcp.tools.create_time_capsule.description",
1499
+ inputSchema: { type: "object", properties: { definition: On }, required: ["definition"] },
1500
+ handler: async (a, c) => raw(c, "POST", `/time-capsules`, getObj(a, "definition")),
1501
+ },
1502
+ {
1503
+ name: "cancel_time_capsule",
1504
+ descriptionKey: "mcp.tools.cancel_time_capsule.description",
1505
+ inputSchema: { type: "object", properties: { capsuleId: Sn }, required: ["capsuleId"] },
1506
+ handler: async (a, c) => raw(c, "POST", `/time-capsules/${encodeURIComponent(getStr(a, "capsuleId"))}/cancel`),
1507
+ },
1508
+ {
1509
+ name: "force_unlock_time_capsule",
1510
+ descriptionKey: "mcp.tools.force_unlock_time_capsule.description",
1511
+ inputSchema: { type: "object", properties: { capsuleId: Sn }, required: ["capsuleId"] },
1512
+ handler: async (a, c) => raw(c, "POST", `/time-capsules/${encodeURIComponent(getStr(a, "capsuleId"))}/deliver-now`),
1513
+ },
1514
+ {
1515
+ name: "reschedule_time_capsule",
1516
+ descriptionKey: "mcp.tools.reschedule_time_capsule.description",
1517
+ inputSchema: { type: "object", properties: { capsuleId: Sn, runAt: Sn }, required: ["capsuleId", "runAt"] },
1518
+ handler: async (a, c) => raw(c, "POST", `/time-capsules/${encodeURIComponent(getStr(a, "capsuleId"))}/reschedule`, { runAt: getStr(a, "runAt") }),
1519
+ },
1520
+ // ═══════════════════════════════════════════════════════════════════════
1521
+ // ENGAGEMENT — SUGGESTIONS / CONFESSIONS / BIRTHDAYS / HIGHLIGHTS / AFK
1522
+ // ═══════════════════════════════════════════════════════════════════════
1523
+ {
1524
+ name: "list_suggestions",
1525
+ descriptionKey: "mcp.tools.list_suggestions.description",
1526
+ inputSchema: { type: "object", properties: { status: Sn, limit: Nn } },
1527
+ handler: async (a, c) => raw(c, "GET", `/suggestions${qs({ status: getOptStr(a, "status"), limit: getOptNum(a, "limit") })}`),
1528
+ },
1529
+ {
1530
+ name: "get_suggestion",
1531
+ descriptionKey: "mcp.tools.get_suggestion.description",
1532
+ inputSchema: { type: "object", properties: { suggestionId: Sn }, required: ["suggestionId"] },
1533
+ handler: async (a, c) => raw(c, "GET", `/suggestions/${encodeURIComponent(getStr(a, "suggestionId"))}`),
1534
+ },
1535
+ {
1536
+ name: "decide_suggestion",
1537
+ descriptionKey: "mcp.tools.decide_suggestion.description",
1538
+ inputSchema: { type: "object", properties: { suggestionId: Sn, decision: Sn, reason: Sn }, required: ["suggestionId", "decision"] },
1539
+ handler: async (a, c) => raw(c, "POST", `/suggestions/${encodeURIComponent(getStr(a, "suggestionId"))}/decide`, {
1540
+ decision: getStr(a, "decision"), reason: getOptStr(a, "reason"),
1541
+ }),
1542
+ },
1543
+ {
1544
+ name: "comment_on_suggestion",
1545
+ descriptionKey: "mcp.tools.comment_on_suggestion.description",
1546
+ inputSchema: { type: "object", properties: { suggestionId: Sn, body: Sn }, required: ["suggestionId", "body"] },
1547
+ handler: async (a, c) => raw(c, "POST", `/suggestions/${encodeURIComponent(getStr(a, "suggestionId"))}/comments`, { body: getStr(a, "body") }),
1548
+ },
1549
+ {
1550
+ name: "list_suggestion_top",
1551
+ descriptionKey: "mcp.tools.list_suggestion_top.description",
1552
+ inputSchema: { type: "object", properties: { limit: Nn } },
1553
+ handler: async (a, c) => raw(c, "GET", `/suggestions/top${qs({ limit: getOptNum(a, "limit") })}`),
1554
+ },
1555
+ {
1556
+ name: "get_suggestion_settings",
1557
+ descriptionKey: "mcp.tools.get_suggestion_settings.description",
1558
+ inputSchema: { type: "object", properties: {} },
1559
+ handler: async (_a, c) => raw(c, "GET", `/settings${qs({ module: "suggestions" })}`),
1560
+ },
1561
+ {
1562
+ name: "list_confessions",
1563
+ descriptionKey: "mcp.tools.list_confessions.description",
1564
+ inputSchema: { type: "object", properties: { status: Sn, limit: Nn } },
1565
+ handler: async (a, c) => raw(c, "GET", `/confessions${qs({ status: getOptStr(a, "status"), limit: getOptNum(a, "limit") })}`),
1566
+ },
1567
+ {
1568
+ name: "decide_confession",
1569
+ descriptionKey: "mcp.tools.decide_confession.description",
1570
+ inputSchema: { type: "object", properties: { confessionId: Sn, decision: Sn, reason: Sn }, required: ["confessionId", "decision"] },
1571
+ handler: async (a, c) => raw(c, "POST", `/confessions/${encodeURIComponent(getStr(a, "confessionId"))}/decide`, {
1572
+ decision: getStr(a, "decision"), reason: getOptStr(a, "reason"),
1573
+ }),
1574
+ },
1575
+ {
1576
+ name: "get_confession_settings",
1577
+ descriptionKey: "mcp.tools.get_confession_settings.description",
1578
+ inputSchema: { type: "object", properties: {} },
1579
+ handler: async (_a, c) => raw(c, "GET", `/settings${qs({ module: "confessions" })}`),
1580
+ },
1581
+ {
1582
+ name: "get_confession_audit",
1583
+ descriptionKey: "mcp.tools.get_confession_audit.description",
1584
+ inputSchema: { type: "object", properties: { limit: Nn } },
1585
+ handler: async (a, c) => raw(c, "GET", `/confessions/audit${qs({ limit: getOptNum(a, "limit") })}`),
1586
+ },
1587
+ {
1588
+ name: "list_birthdays",
1589
+ descriptionKey: "mcp.tools.list_birthdays.description",
1590
+ inputSchema: { type: "object", properties: { limit: Nn } },
1591
+ handler: async (a, c) => raw(c, "GET", `/birthdays${qs({ limit: getOptNum(a, "limit") })}`),
1592
+ },
1593
+ {
1594
+ name: "get_birthday",
1595
+ descriptionKey: "mcp.tools.get_birthday.description",
1596
+ inputSchema: { type: "object", properties: { userId: Sn }, required: ["userId"] },
1597
+ handler: async (a, c) => raw(c, "GET", `/birthdays/${encodeURIComponent(getStr(a, "userId"))}`),
1598
+ },
1599
+ {
1600
+ name: "set_birthday",
1601
+ descriptionKey: "mcp.tools.set_birthday.description",
1602
+ inputSchema: { type: "object", properties: { userId: Sn, date: Sn, year: Nn }, required: ["userId", "date"] },
1603
+ handler: async (a, c) => raw(c, "POST", `/birthdays`, { userId: getStr(a, "userId"), date: getStr(a, "date"), year: getOptNum(a, "year") }),
1604
+ },
1605
+ {
1606
+ name: "delete_birthday",
1607
+ descriptionKey: "mcp.tools.delete_birthday.description",
1608
+ inputSchema: { type: "object", properties: { userId: Sn }, required: ["userId"] },
1609
+ handler: async (a, c) => raw(c, "DELETE", `/birthdays/${encodeURIComponent(getStr(a, "userId"))}`),
1610
+ },
1611
+ {
1612
+ name: "list_birthdays_this_month",
1613
+ descriptionKey: "mcp.tools.list_birthdays_this_month.description",
1614
+ inputSchema: { type: "object", properties: { month: Nn } },
1615
+ handler: async (a, c) => raw(c, "GET", `/birthdays/upcoming${qs({ month: getOptNum(a, "month") })}`),
1616
+ },
1617
+ {
1618
+ name: "force_birthday_announce",
1619
+ descriptionKey: "mcp.tools.force_birthday_announce.description",
1620
+ inputSchema: { type: "object", properties: { userId: Sn }, required: ["userId"] },
1621
+ handler: async (a, c) => raw(c, "POST", `/birthdays/${encodeURIComponent(getStr(a, "userId"))}/announce`),
1622
+ },
1623
+ {
1624
+ name: "list_user_highlights",
1625
+ descriptionKey: "mcp.tools.list_user_highlights.description",
1626
+ inputSchema: { type: "object", properties: { userId: Sn }, required: ["userId"] },
1627
+ handler: async (a, c) => raw(c, "GET", `/highlights/${encodeURIComponent(getStr(a, "userId"))}`),
1628
+ },
1629
+ {
1630
+ name: "add_user_highlight",
1631
+ descriptionKey: "mcp.tools.add_user_highlight.description",
1632
+ inputSchema: { type: "object", properties: { userId: Sn, term: Sn }, required: ["userId", "term"] },
1633
+ handler: async (a, c) => raw(c, "POST", `/highlights/${encodeURIComponent(getStr(a, "userId"))}`, { term: getStr(a, "term") }),
1634
+ },
1635
+ {
1636
+ name: "remove_user_highlight",
1637
+ descriptionKey: "mcp.tools.remove_user_highlight.description",
1638
+ inputSchema: { type: "object", properties: { userId: Sn, term: Sn }, required: ["userId", "term"] },
1639
+ handler: async (a, c) => raw(c, "DELETE", `/highlights/${encodeURIComponent(getStr(a, "userId"))}${qs({ term: getStr(a, "term") })}`),
1640
+ },
1641
+ {
1642
+ name: "get_highlights_settings",
1643
+ descriptionKey: "mcp.tools.get_highlights_settings.description",
1644
+ inputSchema: { type: "object", properties: {} },
1645
+ handler: async (_a, c) => raw(c, "GET", `/settings${qs({ module: "highlights" })}`),
1646
+ },
1647
+ {
1648
+ name: "update_highlights_settings",
1649
+ descriptionKey: "mcp.tools.update_highlights_settings.description",
1650
+ inputSchema: { type: "object", properties: { patch: On }, required: ["patch"] },
1651
+ handler: async (a, c) => raw(c, "PATCH", `/settings`, { module: "highlights", patch: getObj(a, "patch") }),
1652
+ },
1653
+ {
1654
+ name: "list_afks",
1655
+ descriptionKey: "mcp.tools.list_afks.description",
1656
+ inputSchema: { type: "object", properties: { limit: Nn } },
1657
+ handler: async (a, c) => raw(c, "GET", `/afk${qs({ limit: getOptNum(a, "limit") })}`),
1658
+ },
1659
+ {
1660
+ name: "get_afk",
1661
+ descriptionKey: "mcp.tools.get_afk.description",
1662
+ inputSchema: { type: "object", properties: { userId: Sn }, required: ["userId"] },
1663
+ handler: async (a, c) => raw(c, "GET", `/afk/${encodeURIComponent(getStr(a, "userId"))}`),
1664
+ },
1665
+ {
1666
+ name: "set_afk",
1667
+ descriptionKey: "mcp.tools.set_afk.description",
1668
+ inputSchema: { type: "object", properties: { userId: Sn, message: Sn, until: Sn }, required: ["userId"] },
1669
+ handler: async (a, c) => raw(c, "PUT", `/afk/${encodeURIComponent(getStr(a, "userId"))}`, { message: getOptStr(a, "message"), until: getOptStr(a, "until") }),
1670
+ },
1671
+ {
1672
+ name: "clear_afk",
1673
+ descriptionKey: "mcp.tools.clear_afk.description",
1674
+ inputSchema: { type: "object", properties: { userId: Sn }, required: ["userId"] },
1675
+ handler: async (a, c) => raw(c, "DELETE", `/afk/${encodeURIComponent(getStr(a, "userId"))}`),
1676
+ },
1677
+ // ═══════════════════════════════════════════════════════════════════════
1678
+ // WELCOME / ONBOARDING / MESSAGES / EMBEDS
1679
+ // ═══════════════════════════════════════════════════════════════════════
1680
+ {
1681
+ name: "get_welcome_settings",
1682
+ descriptionKey: "mcp.tools.get_welcome_settings.description",
1683
+ inputSchema: { type: "object", properties: {} },
1684
+ handler: async (_a, c) => raw(c, "GET", `/settings${qs({ module: "welcome" })}`),
1685
+ },
1686
+ {
1687
+ name: "update_welcome_settings",
1688
+ descriptionKey: "mcp.tools.update_welcome_settings.description",
1689
+ inputSchema: { type: "object", properties: { patch: On }, required: ["patch"] },
1690
+ handler: async (a, c) => raw(c, "PATCH", `/settings`, { module: "welcome", patch: getObj(a, "patch") }),
1691
+ },
1692
+ {
1693
+ name: "preview_welcome_card",
1694
+ descriptionKey: "mcp.tools.preview_welcome_card.description",
1695
+ inputSchema: { type: "object", properties: { kind: Sn } },
1696
+ handler: async (a, c) => {
1697
+ const kind = getOptStr(a, "kind");
1698
+ return raw(c, "GET", kind ? `/welcome-card/${encodeURIComponent(kind)}/preview` : `/welcome-card/preview`);
1699
+ },
1700
+ },
1701
+ {
1702
+ name: "test_welcome_message",
1703
+ descriptionKey: "mcp.tools.test_welcome_message.description",
1704
+ inputSchema: { type: "object", properties: { kind: Sn, userId: Sn } },
1705
+ handler: async (a, c) => raw(c, "POST", `/welcome/test`, { kind: getOptStr(a, "kind"), userId: getOptStr(a, "userId") }),
1706
+ },
1707
+ {
1708
+ name: "preview_rank_card",
1709
+ descriptionKey: "mcp.tools.preview_rank_card.description",
1710
+ inputSchema: { type: "object", properties: { userId: Sn } },
1711
+ handler: async (a, c) => raw(c, "GET", `/rank-card/preview${qs({ userId: getOptStr(a, "userId") })}`),
1712
+ },
1713
+ {
1714
+ name: "delete_welcome_background",
1715
+ descriptionKey: "mcp.tools.delete_welcome_background.description",
1716
+ inputSchema: { type: "object", properties: { kind: Sn } },
1717
+ handler: async (a, c) => {
1718
+ const kind = getOptStr(a, "kind");
1719
+ return raw(c, "DELETE", kind ? `/welcome-card/${encodeURIComponent(kind)}/background` : `/welcome-card/background`);
1720
+ },
1721
+ },
1722
+ {
1723
+ name: "get_onboarding_flow",
1724
+ descriptionKey: "mcp.tools.get_onboarding_flow.description",
1725
+ inputSchema: { type: "object", properties: {} },
1726
+ handler: async (_a, c) => raw(c, "GET", `/onboarding`),
1727
+ },
1728
+ {
1729
+ name: "set_onboarding_flow",
1730
+ descriptionKey: "mcp.tools.set_onboarding_flow.description",
1731
+ inputSchema: { type: "object", properties: { definition: On }, required: ["definition"] },
1732
+ handler: async (a, c) => raw(c, "PUT", `/onboarding`, getObj(a, "definition")),
1733
+ },
1734
+ {
1735
+ name: "delete_onboarding_flow",
1736
+ descriptionKey: "mcp.tools.delete_onboarding_flow.description",
1737
+ inputSchema: { type: "object", properties: {} },
1738
+ handler: async (_a, c) => raw(c, "DELETE", `/onboarding`),
1739
+ },
1740
+ {
1741
+ name: "get_onboarding_ab_report",
1742
+ descriptionKey: "mcp.tools.get_onboarding_ab_report.description",
1743
+ inputSchema: { type: "object", properties: {} },
1744
+ handler: async (_a, c) => raw(c, "GET", `/onboarding/ab-report`),
1745
+ },
1746
+ {
1747
+ name: "list_onboarding_completions",
1748
+ descriptionKey: "mcp.tools.list_onboarding_completions.description",
1749
+ inputSchema: { type: "object", properties: { limit: Nn } },
1750
+ handler: async (a, c) => raw(c, "GET", `/onboarding/completions${qs({ limit: getOptNum(a, "limit") })}`),
1751
+ },
1752
+ {
1753
+ name: "list_messages",
1754
+ descriptionKey: "mcp.tools.list_messages.description",
1755
+ inputSchema: { type: "object", properties: {} },
1756
+ handler: async (_a, c) => raw(c, "GET", `/messages`),
1757
+ },
1758
+ {
1759
+ name: "get_message",
1760
+ descriptionKey: "mcp.tools.get_message.description",
1761
+ inputSchema: { type: "object", properties: { key: Sn }, required: ["key"] },
1762
+ handler: async (a, c) => raw(c, "GET", `/messages/${encodeURIComponent(getStr(a, "key"))}`),
1763
+ },
1764
+ {
1765
+ name: "save_message",
1766
+ descriptionKey: "mcp.tools.save_message.description",
1767
+ inputSchema: { type: "object", properties: { key: Sn, body: On }, required: ["key", "body"] },
1768
+ handler: async (a, c) => raw(c, "PUT", `/messages/${encodeURIComponent(getStr(a, "key"))}`, getObj(a, "body")),
1769
+ },
1770
+ {
1771
+ name: "delete_message",
1772
+ descriptionKey: "mcp.tools.delete_message.description",
1773
+ inputSchema: { type: "object", properties: { key: Sn }, required: ["key"] },
1774
+ handler: async (a, c) => raw(c, "DELETE", `/messages/${encodeURIComponent(getStr(a, "key"))}`),
1775
+ },
1776
+ {
1777
+ name: "list_message_instances",
1778
+ descriptionKey: "mcp.tools.list_message_instances.description",
1779
+ inputSchema: { type: "object", properties: { key: Sn }, required: ["key"] },
1780
+ handler: async (a, c) => raw(c, "GET", `/messages/${encodeURIComponent(getStr(a, "key"))}/instances`),
1781
+ },
1782
+ {
1783
+ name: "update_message_instance",
1784
+ descriptionKey: "mcp.tools.update_message_instance.description",
1785
+ inputSchema: { type: "object", properties: { key: Sn, instanceId: Sn, patch: On }, required: ["key", "instanceId", "patch"] },
1786
+ handler: async (a, c) => raw(c, "PATCH", `/messages/${encodeURIComponent(getStr(a, "key"))}/instances/${encodeURIComponent(getStr(a, "instanceId"))}`, getObj(a, "patch")),
1787
+ },
1788
+ {
1789
+ name: "seed_default_embeds",
1790
+ descriptionKey: "mcp.tools.seed_default_embeds.description",
1791
+ inputSchema: { type: "object", properties: {} },
1792
+ handler: async (_a, c) => raw(c, "POST", `/messages/default-embeds/seed`),
1793
+ },
1794
+ {
1795
+ name: "list_embed_templates",
1796
+ descriptionKey: "mcp.tools.list_embed_templates.description",
1797
+ inputSchema: { type: "object", properties: {} },
1798
+ handler: async (_a, c) => c.embeds.list(),
1799
+ },
1800
+ {
1801
+ name: "save_embed_template",
1802
+ descriptionKey: "mcp.tools.save_embed_template.description",
1803
+ inputSchema: { type: "object", properties: { name: Sn, json: On }, required: ["name", "json"] },
1804
+ handler: async (a, c) => c.embeds.save(getStr(a, "name"), getObj(a, "json")),
1805
+ },
1806
+ // ═══════════════════════════════════════════════════════════════════════
1807
+ // CHANNELS / ROLES / SERVER
1808
+ // ═══════════════════════════════════════════════════════════════════════
1809
+ {
1810
+ name: "list_channels",
1811
+ descriptionKey: "mcp.tools.list_channels.description",
1812
+ inputSchema: { type: "object", properties: {} },
1813
+ handler: async (_a, c) => raw(c, "GET", `/channel-utils/channels`),
1814
+ },
1815
+ {
1816
+ name: "create_channel",
1817
+ descriptionKey: "mcp.tools.create_channel.description",
1818
+ inputSchema: { type: "object", properties: { definition: On }, required: ["definition"] },
1819
+ handler: async (a, c) => raw(c, "POST", `/channel-utils/channels`, getObj(a, "definition")),
1820
+ },
1821
+ {
1822
+ name: "update_channel",
1823
+ descriptionKey: "mcp.tools.update_channel.description",
1824
+ inputSchema: { type: "object", properties: { channelId: Sn, patch: On }, required: ["channelId", "patch"] },
1825
+ handler: async (a, c) => raw(c, "PATCH", `/channel-utils/channels/${encodeURIComponent(getStr(a, "channelId"))}`, getObj(a, "patch")),
1826
+ },
1827
+ {
1828
+ name: "delete_channel",
1829
+ descriptionKey: "mcp.tools.delete_channel.description",
1830
+ inputSchema: { type: "object", properties: { channelId: Sn }, required: ["channelId"] },
1831
+ handler: async (a, c) => raw(c, "DELETE", `/channel-utils/channels/${encodeURIComponent(getStr(a, "channelId"))}`),
1832
+ },
1833
+ {
1834
+ name: "get_channel_permissions",
1835
+ descriptionKey: "mcp.tools.get_channel_permissions.description",
1836
+ inputSchema: { type: "object", properties: { channelId: Sn }, required: ["channelId"] },
1837
+ handler: async (a, c) => raw(c, "GET", `/channel-utils/channels/${encodeURIComponent(getStr(a, "channelId"))}/permissions`),
1838
+ },
1839
+ {
1840
+ name: "set_channel_permissions",
1841
+ descriptionKey: "mcp.tools.set_channel_permissions.description",
1842
+ inputSchema: { type: "object", properties: { channelId: Sn, overwrites: On }, required: ["channelId", "overwrites"] },
1843
+ handler: async (a, c) => raw(c, "PUT", `/channel-utils/channels/${encodeURIComponent(getStr(a, "channelId"))}/permissions`, getObj(a, "overwrites")),
1844
+ },
1845
+ {
1846
+ name: "list_discord_channels",
1847
+ descriptionKey: "mcp.tools.list_discord_channels.description",
1848
+ inputSchema: { type: "object", properties: {} },
1849
+ handler: async (_a, c) => raw(c, "GET", `/discord/channels`),
1850
+ },
1851
+ {
1852
+ name: "list_roles",
1853
+ descriptionKey: "mcp.tools.list_roles.description",
1854
+ inputSchema: { type: "object", properties: {} },
1855
+ handler: async (_a, c) => raw(c, "GET", `/roles`),
1856
+ },
1857
+ {
1858
+ name: "list_discord_roles",
1859
+ descriptionKey: "mcp.tools.list_discord_roles.description",
1860
+ inputSchema: { type: "object", properties: {} },
1861
+ handler: async (_a, c) => raw(c, "GET", `/discord/roles`),
1862
+ },
1863
+ {
1864
+ name: "list_discord_members",
1865
+ descriptionKey: "mcp.tools.list_discord_members.description",
1866
+ inputSchema: { type: "object", properties: { limit: Nn, after: Sn } },
1867
+ handler: async (a, c) => raw(c, "GET", `/discord/members${qs({ limit: getOptNum(a, "limit"), after: getOptStr(a, "after") })}`),
1868
+ },
1869
+ {
1870
+ name: "create_role",
1871
+ descriptionKey: "mcp.tools.create_role.description",
1872
+ inputSchema: { type: "object", properties: { definition: On }, required: ["definition"] },
1873
+ handler: async (a, c) => raw(c, "POST", `/roles`, getObj(a, "definition")),
1874
+ },
1875
+ {
1876
+ name: "update_role",
1877
+ descriptionKey: "mcp.tools.update_role.description",
1878
+ inputSchema: { type: "object", properties: { roleId: Sn, patch: On }, required: ["roleId", "patch"] },
1879
+ handler: async (a, c) => raw(c, "PATCH", `/roles/${encodeURIComponent(getStr(a, "roleId"))}`, getObj(a, "patch")),
1880
+ },
1881
+ {
1882
+ name: "delete_role",
1883
+ descriptionKey: "mcp.tools.delete_role.description",
1884
+ inputSchema: { type: "object", properties: { roleId: Sn }, required: ["roleId"] },
1885
+ handler: async (a, c) => raw(c, "DELETE", `/roles/${encodeURIComponent(getStr(a, "roleId"))}`),
1886
+ },
1887
+ {
1888
+ name: "add_member_role",
1889
+ descriptionKey: "mcp.tools.add_member_role.description",
1890
+ inputSchema: { type: "object", properties: { userId: Sn, roleId: Sn, reason: Sn }, required: ["userId", "roleId"] },
1891
+ handler: async (a, c) => raw(c, "PUT", `/roles/assignments`, {
1892
+ userId: getStr(a, "userId"), roleId: getStr(a, "roleId"), reason: getOptStr(a, "reason"),
1893
+ }),
1894
+ },
1895
+ {
1896
+ name: "remove_member_role",
1897
+ descriptionKey: "mcp.tools.remove_member_role.description",
1898
+ inputSchema: { type: "object", properties: { userId: Sn, roleId: Sn, reason: Sn }, required: ["userId", "roleId"] },
1899
+ handler: async (a, c) => raw(c, "DELETE", `/roles/assignments${qs({ userId: getStr(a, "userId"), roleId: getStr(a, "roleId"), reason: getOptStr(a, "reason") })}`),
1900
+ },
1901
+ {
1902
+ name: "list_reaction_roles",
1903
+ descriptionKey: "mcp.tools.list_reaction_roles.description",
1904
+ inputSchema: { type: "object", properties: {} },
1905
+ handler: async (_a, c) => raw(c, "GET", `/roles/reaction-roles`),
1906
+ },
1907
+ {
1908
+ name: "save_reaction_role",
1909
+ descriptionKey: "mcp.tools.save_reaction_role.description",
1910
+ inputSchema: { type: "object", properties: { definition: On }, required: ["definition"] },
1911
+ handler: async (a, c) => raw(c, "POST", `/roles/reaction-roles`, getObj(a, "definition")),
1912
+ },
1913
+ {
1914
+ name: "list_activity_roles",
1915
+ descriptionKey: "mcp.tools.list_activity_roles.description",
1916
+ inputSchema: { type: "object", properties: {} },
1917
+ handler: async (_a, c) => raw(c, "GET", `/roles/activity-roles`),
1918
+ },
1919
+ {
1920
+ name: "save_activity_role",
1921
+ descriptionKey: "mcp.tools.save_activity_role.description",
1922
+ inputSchema: { type: "object", properties: { definition: On }, required: ["definition"] },
1923
+ handler: async (a, c) => raw(c, "POST", `/roles/activity-roles`, getObj(a, "definition")),
1924
+ },
1925
+ {
1926
+ name: "list_color_roles",
1927
+ descriptionKey: "mcp.tools.list_color_roles.description",
1928
+ inputSchema: { type: "object", properties: {} },
1929
+ handler: async (_a, c) => raw(c, "GET", `/roles/color-roles`),
1930
+ },
1931
+ {
1932
+ name: "list_temp_roles",
1933
+ descriptionKey: "mcp.tools.list_temp_roles.description",
1934
+ inputSchema: { type: "object", properties: {} },
1935
+ handler: async (_a, c) => raw(c, "GET", `/roles/temp-roles`),
1936
+ },
1937
+ {
1938
+ name: "set_role_panel",
1939
+ descriptionKey: "mcp.tools.set_role_panel.description",
1940
+ inputSchema: { type: "object", properties: { panelId: Sn, definition: On }, required: ["definition"] },
1941
+ handler: async (a, c) => {
1942
+ const panelId = getOptStr(a, "panelId");
1943
+ const def = getObj(a, "definition");
1944
+ return panelId
1945
+ ? raw(c, "PATCH", `/roles/panels/${encodeURIComponent(panelId)}`, def)
1946
+ : raw(c, "POST", `/roles/panels`, def);
1947
+ },
1948
+ },
1949
+ {
1950
+ name: "list_role_backups",
1951
+ descriptionKey: "mcp.tools.list_role_backups.description",
1952
+ inputSchema: { type: "object", properties: {} },
1953
+ handler: async (_a, c) => raw(c, "GET", `/roles/backups`),
1954
+ },
1955
+ {
1956
+ name: "create_role_backup",
1957
+ descriptionKey: "mcp.tools.create_role_backup.description",
1958
+ inputSchema: { type: "object", properties: { label: Sn } },
1959
+ handler: async (a, c) => raw(c, "POST", `/roles/backups`, { label: getOptStr(a, "label") }),
1960
+ },
1961
+ {
1962
+ name: "get_guild",
1963
+ descriptionKey: "mcp.tools.get_guild.description",
1964
+ inputSchema: { type: "object", properties: {} },
1965
+ handler: async (_a, c) => rawAbs(c, "GET", `/api/guilds/${c.guildId}`),
1966
+ },
1967
+ {
1968
+ name: "update_guild",
1969
+ descriptionKey: "mcp.tools.update_guild.description",
1970
+ inputSchema: { type: "object", properties: { patch: On }, required: ["patch"] },
1971
+ handler: async (a, c) => rawAbs(c, "PATCH", `/api/guilds/${c.guildId}`, getObj(a, "patch")),
1972
+ },
1973
+ // ═══════════════════════════════════════════════════════════════════════
1974
+ // COUNTERS / SERVER STATS / SERVER GOALS
1975
+ // ═══════════════════════════════════════════════════════════════════════
1976
+ {
1977
+ name: "list_counters",
1978
+ descriptionKey: "mcp.tools.list_counters.description",
1979
+ inputSchema: { type: "object", properties: {} },
1980
+ handler: async (_a, c) => raw(c, "GET", `/counters`),
1981
+ },
1982
+ {
1983
+ name: "save_counter",
1984
+ descriptionKey: "mcp.tools.save_counter.description",
1985
+ inputSchema: { type: "object", properties: { counterId: Sn, definition: On }, required: ["definition"] },
1986
+ handler: async (a, c) => {
1987
+ const id = getOptStr(a, "counterId");
1988
+ const def = getObj(a, "definition");
1989
+ return id
1990
+ ? raw(c, "PATCH", `/counters/${encodeURIComponent(id)}`, def)
1991
+ : raw(c, "POST", `/counters`, def);
1992
+ },
1993
+ },
1994
+ {
1995
+ name: "delete_counter",
1996
+ descriptionKey: "mcp.tools.delete_counter.description",
1997
+ inputSchema: { type: "object", properties: { counterId: Sn }, required: ["counterId"] },
1998
+ handler: async (a, c) => raw(c, "DELETE", `/counters/${encodeURIComponent(getStr(a, "counterId"))}`),
1999
+ },
2000
+ {
2001
+ name: "publish_counter",
2002
+ descriptionKey: "mcp.tools.publish_counter.description",
2003
+ inputSchema: { type: "object", properties: { counterId: Sn }, required: ["counterId"] },
2004
+ handler: async (a, c) => raw(c, "POST", `/counters/${encodeURIComponent(getStr(a, "counterId"))}/publish`),
2005
+ },
2006
+ {
2007
+ name: "import_counters",
2008
+ descriptionKey: "mcp.tools.import_counters.description",
2009
+ inputSchema: { type: "object", properties: { data: On }, required: ["data"] },
2010
+ handler: async (a, c) => raw(c, "POST", `/counters/import`, getObj(a, "data")),
2011
+ },
2012
+ {
2013
+ name: "list_server_stats",
2014
+ descriptionKey: "mcp.tools.list_server_stats.description",
2015
+ inputSchema: { type: "object", properties: {} },
2016
+ handler: async (_a, c) => raw(c, "GET", `/server-stats`),
2017
+ },
2018
+ {
2019
+ name: "save_server_stat_channel",
2020
+ descriptionKey: "mcp.tools.save_server_stat_channel.description",
2021
+ inputSchema: { type: "object", properties: { definition: On }, required: ["definition"] },
2022
+ handler: async (a, c) => raw(c, "POST", `/server-stats/channels`, getObj(a, "definition")),
2023
+ },
2024
+ {
2025
+ name: "delete_server_stat_channel",
2026
+ descriptionKey: "mcp.tools.delete_server_stat_channel.description",
2027
+ inputSchema: { type: "object", properties: { channelId: Sn }, required: ["channelId"] },
2028
+ handler: async (a, c) => raw(c, "DELETE", `/server-stats/channels/${encodeURIComponent(getStr(a, "channelId"))}`),
2029
+ },
2030
+ {
2031
+ name: "save_server_stat",
2032
+ descriptionKey: "mcp.tools.save_server_stat.description",
2033
+ inputSchema: { type: "object", properties: { definition: On }, required: ["definition"] },
2034
+ handler: async (a, c) => raw(c, "POST", `/server-stats/custom`, getObj(a, "definition")),
2035
+ },
2036
+ {
2037
+ name: "preview_server_stat",
2038
+ descriptionKey: "mcp.tools.preview_server_stat.description",
2039
+ inputSchema: { type: "object", properties: { definition: On }, required: ["definition"] },
2040
+ handler: async (a, c) => raw(c, "POST", `/server-stats/preview`, getObj(a, "definition")),
2041
+ },
2042
+ {
2043
+ name: "refresh_server_stats",
2044
+ descriptionKey: "mcp.tools.refresh_server_stats.description",
2045
+ inputSchema: { type: "object", properties: {} },
2046
+ handler: async (_a, c) => raw(c, "POST", `/server-stats/refresh`),
2047
+ },
2048
+ {
2049
+ name: "server_stats_diagnostics",
2050
+ descriptionKey: "mcp.tools.server_stats_diagnostics.description",
2051
+ inputSchema: { type: "object", properties: {} },
2052
+ handler: async (_a, c) => raw(c, "GET", `/server-stats/diagnostics`),
2053
+ },
2054
+ {
2055
+ name: "list_server_goals",
2056
+ descriptionKey: "mcp.tools.list_server_goals.description",
2057
+ inputSchema: { type: "object", properties: {} },
2058
+ handler: async (_a, c) => raw(c, "GET", `/server-goals`),
2059
+ },
2060
+ {
2061
+ name: "create_server_goal",
2062
+ descriptionKey: "mcp.tools.create_server_goal.description",
2063
+ inputSchema: { type: "object", properties: { definition: On }, required: ["definition"] },
2064
+ handler: async (a, c) => raw(c, "POST", `/server-goals/goals`, getObj(a, "definition")),
2065
+ },
2066
+ {
2067
+ name: "delete_server_goal",
2068
+ descriptionKey: "mcp.tools.delete_server_goal.description",
2069
+ inputSchema: { type: "object", properties: { goalId: Sn }, required: ["goalId"] },
2070
+ handler: async (a, c) => raw(c, "DELETE", `/server-goals/goals/${encodeURIComponent(getStr(a, "goalId"))}`),
2071
+ },
2072
+ // ═══════════════════════════════════════════════════════════════════════
2073
+ // VOICE / AI / TRANSLATION / TTS / PERSONAS
2074
+ // ═══════════════════════════════════════════════════════════════════════
2075
+ {
2076
+ name: "list_voice_clips",
2077
+ descriptionKey: "mcp.tools.list_voice_clips.description",
2078
+ inputSchema: { type: "object", properties: {} },
2079
+ handler: async (_a, c) => raw(c, "GET", `/voice-clipper`),
2080
+ },
2081
+ {
2082
+ name: "get_voice_clip",
2083
+ descriptionKey: "mcp.tools.get_voice_clip.description",
2084
+ inputSchema: { type: "object", properties: { clipId: Sn }, required: ["clipId"] },
2085
+ handler: async (a, c) => raw(c, "GET", `/voice-clipper/clips/${encodeURIComponent(getStr(a, "clipId"))}/export`),
2086
+ },
2087
+ {
2088
+ name: "update_voice_clip",
2089
+ descriptionKey: "mcp.tools.update_voice_clip.description",
2090
+ inputSchema: { type: "object", properties: { clipId: Sn, patch: On }, required: ["clipId", "patch"] },
2091
+ handler: async (a, c) => raw(c, "PATCH", `/voice-clipper/clips/${encodeURIComponent(getStr(a, "clipId"))}`, getObj(a, "patch")),
2092
+ },
2093
+ {
2094
+ name: "delete_voice_clip",
2095
+ descriptionKey: "mcp.tools.delete_voice_clip.description",
2096
+ inputSchema: { type: "object", properties: { clipId: Sn }, required: ["clipId"] },
2097
+ handler: async (a, c) => raw(c, "DELETE", `/voice-clipper/clips/${encodeURIComponent(getStr(a, "clipId"))}`),
2098
+ },
2099
+ {
2100
+ name: "list_voice_recordings",
2101
+ descriptionKey: "mcp.tools.list_voice_recordings.description",
2102
+ inputSchema: { type: "object", properties: {} },
2103
+ handler: async (_a, c) => raw(c, "GET", `/voice-recording`),
2104
+ },
2105
+ {
2106
+ name: "get_voice_recording",
2107
+ descriptionKey: "mcp.tools.get_voice_recording.description",
2108
+ inputSchema: { type: "object", properties: { sessionId: Sn }, required: ["sessionId"] },
2109
+ handler: async (a, c) => raw(c, "GET", `/voice-recording/sessions/${encodeURIComponent(getStr(a, "sessionId"))}/export`),
2110
+ },
2111
+ {
2112
+ name: "delete_voice_recording",
2113
+ descriptionKey: "mcp.tools.delete_voice_recording.description",
2114
+ inputSchema: { type: "object", properties: { sessionId: Sn }, required: ["sessionId"] },
2115
+ handler: async (a, c) => raw(c, "DELETE", `/voice-recording/sessions/${encodeURIComponent(getStr(a, "sessionId"))}`),
2116
+ },
2117
+ {
2118
+ name: "update_voice_recording",
2119
+ descriptionKey: "mcp.tools.update_voice_recording.description",
2120
+ inputSchema: { type: "object", properties: { sessionId: Sn, patch: On }, required: ["sessionId", "patch"] },
2121
+ handler: async (a, c) => raw(c, "PATCH", `/voice-recording/sessions/${encodeURIComponent(getStr(a, "sessionId"))}`, getObj(a, "patch")),
2122
+ },
2123
+ {
2124
+ name: "get_voice_recording_transcript",
2125
+ descriptionKey: "mcp.tools.get_voice_recording_transcript.description",
2126
+ inputSchema: { type: "object", properties: { sessionId: Sn }, required: ["sessionId"] },
2127
+ handler: async (a, c) => raw(c, "GET", `/voice-recording/sessions/${encodeURIComponent(getStr(a, "sessionId"))}/transcript`),
2128
+ },
2129
+ {
2130
+ name: "start_voice_recording",
2131
+ descriptionKey: "mcp.tools.start_voice_recording.description",
2132
+ inputSchema: { type: "object", properties: { channelId: Sn }, required: ["channelId"] },
2133
+ handler: async (a, c) => raw(c, "POST", `/voice-recording/start`, { channelId: getStr(a, "channelId") }),
2134
+ },
2135
+ {
2136
+ name: "stop_voice_recording",
2137
+ descriptionKey: "mcp.tools.stop_voice_recording.description",
2138
+ inputSchema: { type: "object", properties: { sessionId: Sn }, required: ["sessionId"] },
2139
+ handler: async (a, c) => raw(c, "POST", `/voice-recording/sessions/${encodeURIComponent(getStr(a, "sessionId"))}/stop`),
2140
+ },
2141
+ {
2142
+ name: "list_voice_bots",
2143
+ descriptionKey: "mcp.tools.list_voice_bots.description",
2144
+ inputSchema: { type: "object", properties: {} },
2145
+ handler: async (_a, c) => raw(c, "GET", `/voice-bots`),
2146
+ },
2147
+ {
2148
+ name: "create_voice_bot",
2149
+ descriptionKey: "mcp.tools.create_voice_bot.description",
2150
+ inputSchema: { type: "object", properties: { definition: On }, required: ["definition"] },
2151
+ handler: async (a, c) => raw(c, "POST", `/voice-bots`, getObj(a, "definition")),
2152
+ },
2153
+ {
2154
+ name: "reconnect_voice_bot",
2155
+ descriptionKey: "mcp.tools.reconnect_voice_bot.description",
2156
+ inputSchema: { type: "object", properties: { instanceId: Sn }, required: ["instanceId"] },
2157
+ handler: async (a, c) => raw(c, "POST", `/voice-bots/${encodeURIComponent(getStr(a, "instanceId"))}/reconnect`),
2158
+ },
2159
+ {
2160
+ name: "delete_voice_bot",
2161
+ descriptionKey: "mcp.tools.delete_voice_bot.description",
2162
+ inputSchema: { type: "object", properties: { instanceId: Sn }, required: ["instanceId"] },
2163
+ handler: async (a, c) => raw(c, "DELETE", `/voice-bots/${encodeURIComponent(getStr(a, "instanceId"))}`),
2164
+ },
2165
+ {
2166
+ name: "list_ai_usage",
2167
+ descriptionKey: "mcp.tools.list_ai_usage.description",
2168
+ inputSchema: { type: "object", properties: {} },
2169
+ handler: async (_a, c) => raw(c, "GET", `/ai/usage`),
2170
+ },
2171
+ {
2172
+ name: "list_ai_flags",
2173
+ descriptionKey: "mcp.tools.list_ai_flags.description",
2174
+ inputSchema: { type: "object", properties: { limit: Nn } },
2175
+ handler: async (a, c) => raw(c, "GET", `/ai/flags${qs({ limit: getOptNum(a, "limit") })}`),
2176
+ },
2177
+ {
2178
+ name: "resolve_ai_flag",
2179
+ descriptionKey: "mcp.tools.resolve_ai_flag.description",
2180
+ inputSchema: { type: "object", properties: { flagId: Sn, resolution: Sn, notes: Sn }, required: ["flagId", "resolution"] },
2181
+ handler: async (a, c) => raw(c, "POST", `/ai/flags/${encodeURIComponent(getStr(a, "flagId"))}/resolve`, { resolution: getStr(a, "resolution"), notes: getOptStr(a, "notes") }),
2182
+ },
2183
+ {
2184
+ name: "list_ai_review_queue",
2185
+ descriptionKey: "mcp.tools.list_ai_review_queue.description",
2186
+ inputSchema: { type: "object", properties: {} },
2187
+ handler: async (_a, c) => raw(c, "GET", `/ai/review`),
2188
+ },
2189
+ {
2190
+ name: "decide_ai_approval",
2191
+ descriptionKey: "mcp.tools.decide_ai_approval.description",
2192
+ inputSchema: { type: "object", properties: { approvalId: Sn, decision: { type: "string", enum: ["approve", "reject"] } }, required: ["approvalId", "decision"] },
2193
+ handler: async (a, c) => raw(c, "POST", `/ai/approvals/${encodeURIComponent(getStr(a, "approvalId"))}/${getStr(a, "decision")}`),
2194
+ },
2195
+ {
2196
+ name: "list_ai_policies",
2197
+ descriptionKey: "mcp.tools.list_ai_policies.description",
2198
+ inputSchema: { type: "object", properties: {} },
2199
+ handler: async (_a, c) => raw(c, "GET", `/ai/policies`),
2200
+ },
2201
+ {
2202
+ name: "snapshot_ai_policies",
2203
+ descriptionKey: "mcp.tools.snapshot_ai_policies.description",
2204
+ inputSchema: { type: "object", properties: { label: Sn } },
2205
+ handler: async (a, c) => raw(c, "POST", `/ai/policies/snapshot`, { label: getOptStr(a, "label") }),
2206
+ },
2207
+ {
2208
+ name: "restore_ai_policies",
2209
+ descriptionKey: "mcp.tools.restore_ai_policies.description",
2210
+ inputSchema: { type: "object", properties: { version: Sn }, required: ["version"] },
2211
+ handler: async (a, c) => raw(c, "POST", `/ai/policies/${encodeURIComponent(getStr(a, "version"))}/restore`),
2212
+ },
2213
+ {
2214
+ name: "simulate_ai",
2215
+ descriptionKey: "mcp.tools.simulate_ai.description",
2216
+ inputSchema: { type: "object", properties: { sample: On }, required: ["sample"] },
2217
+ handler: async (a, c) => raw(c, "POST", `/ai/simulate`, getObj(a, "sample")),
2218
+ },
2219
+ {
2220
+ name: "run_ai_assistant",
2221
+ descriptionKey: "mcp.tools.run_ai_assistant.description",
2222
+ inputSchema: { type: "object", properties: { prompt: Sn, context: On }, required: ["prompt"] },
2223
+ handler: async (a, c) => raw(c, "POST", `/ai/run`, { prompt: getStr(a, "prompt"), context: getOptObj(a, "context") }),
2224
+ },
2225
+ {
2226
+ name: "get_ai_settings",
2227
+ descriptionKey: "mcp.tools.get_ai_settings.description",
2228
+ inputSchema: { type: "object", properties: {} },
2229
+ handler: async (_a, c) => raw(c, "GET", `/settings${qs({ module: "ai" })}`),
2230
+ },
2231
+ {
2232
+ name: "update_ai_settings",
2233
+ descriptionKey: "mcp.tools.update_ai_settings.description",
2234
+ inputSchema: { type: "object", properties: { patch: On }, required: ["patch"] },
2235
+ handler: async (a, c) => raw(c, "PATCH", `/settings`, { module: "ai", patch: getObj(a, "patch") }),
2236
+ },
2237
+ {
2238
+ name: "list_ai_credentials",
2239
+ descriptionKey: "mcp.tools.list_ai_credentials.description",
2240
+ inputSchema: { type: "object", properties: {} },
2241
+ handler: async (_a, c) => raw(c, "GET", `/ai/credentials`),
2242
+ },
2243
+ {
2244
+ name: "get_translation_settings",
2245
+ descriptionKey: "mcp.tools.get_translation_settings.description",
2246
+ inputSchema: { type: "object", properties: {} },
2247
+ handler: async (_a, c) => raw(c, "GET", `/translation`),
2248
+ },
2249
+ {
2250
+ name: "update_translation_settings",
2251
+ descriptionKey: "mcp.tools.update_translation_settings.description",
2252
+ inputSchema: { type: "object", properties: { patch: On }, required: ["patch"] },
2253
+ handler: async (a, c) => raw(c, "PATCH", `/translation`, getObj(a, "patch")),
2254
+ },
2255
+ {
2256
+ name: "translate_message",
2257
+ descriptionKey: "mcp.tools.translate_message.description",
2258
+ inputSchema: { type: "object", properties: { content: Sn, targetLang: Sn, sourceLang: Sn }, required: ["content", "targetLang"] },
2259
+ handler: async (a, c) => raw(c, "POST", `/translation/test`, {
2260
+ content: getStr(a, "content"), targetLang: getStr(a, "targetLang"), sourceLang: getOptStr(a, "sourceLang"),
2261
+ }),
2262
+ },
2263
+ {
2264
+ name: "list_tts_transcripts",
2265
+ descriptionKey: "mcp.tools.list_tts_transcripts.description",
2266
+ inputSchema: { type: "object", properties: { limit: Nn } },
2267
+ handler: async (a, c) => raw(c, "GET", `/tts/transcripts${qs({ limit: getOptNum(a, "limit") })}`),
2268
+ },
2269
+ {
2270
+ name: "get_tts_transcript",
2271
+ descriptionKey: "mcp.tools.get_tts_transcript.description",
2272
+ inputSchema: { type: "object", properties: { sessionId: Sn }, required: ["sessionId"] },
2273
+ handler: async (a, c) => raw(c, "GET", `/tts/transcripts/${encodeURIComponent(getStr(a, "sessionId"))}`),
2274
+ },
2275
+ {
2276
+ name: "delete_tts_transcript",
2277
+ descriptionKey: "mcp.tools.delete_tts_transcript.description",
2278
+ inputSchema: { type: "object", properties: { sessionId: Sn }, required: ["sessionId"] },
2279
+ handler: async (a, c) => raw(c, "DELETE", `/tts/transcripts/${encodeURIComponent(getStr(a, "sessionId"))}`),
2280
+ },
2281
+ {
2282
+ name: "tts_speak",
2283
+ descriptionKey: "mcp.tools.tts_speak.description",
2284
+ inputSchema: { type: "object", properties: { text: Sn, voice: Sn, channelId: Sn }, required: ["text"] },
2285
+ handler: async (a, c) => raw(c, "POST", `/tts/speak`, { text: getStr(a, "text"), voice: getOptStr(a, "voice"), channelId: getOptStr(a, "channelId") }),
2286
+ },
2287
+ {
2288
+ name: "list_ai_personas",
2289
+ descriptionKey: "mcp.tools.list_ai_personas.description",
2290
+ inputSchema: { type: "object", properties: {} },
2291
+ handler: async (_a, c) => raw(c, "GET", `/personas`),
2292
+ },
2293
+ {
2294
+ name: "save_ai_persona",
2295
+ descriptionKey: "mcp.tools.save_ai_persona.description",
2296
+ inputSchema: { type: "object", properties: { id: Sn, definition: On, scope: { type: "string", enum: ["preset", "own"] } }, required: ["definition"] },
2297
+ handler: async (a, c) => {
2298
+ const id = getOptStr(a, "id");
2299
+ const def = getObj(a, "definition");
2300
+ const scope = getOptStr(a, "scope") ?? "own";
2301
+ const seg = scope === "preset" ? "presets" : "own";
2302
+ return id
2303
+ ? raw(c, "PATCH", `/personas/${seg}/${encodeURIComponent(id)}`, def)
2304
+ : raw(c, "POST", `/personas/${seg}`, def);
2305
+ },
2306
+ },
2307
+ {
2308
+ name: "delete_ai_persona",
2309
+ descriptionKey: "mcp.tools.delete_ai_persona.description",
2310
+ inputSchema: { type: "object", properties: { id: Sn, scope: { type: "string", enum: ["preset", "own"] } }, required: ["id"] },
2311
+ handler: async (a, c) => {
2312
+ const scope = getOptStr(a, "scope") ?? "own";
2313
+ const seg = scope === "preset" ? "presets" : "own";
2314
+ return raw(c, "DELETE", `/personas/${seg}/${encodeURIComponent(getStr(a, "id"))}`);
2315
+ },
2316
+ },
2317
+ // ═══════════════════════════════════════════════════════════════════════
2318
+ // WEBHOOKS — OUTBOUND / INBOUND / BROADCASTER
2319
+ // ═══════════════════════════════════════════════════════════════════════
2320
+ {
2321
+ name: "list_outbound_webhooks",
2322
+ descriptionKey: "mcp.tools.list_outbound_webhooks.description",
2323
+ inputSchema: { type: "object", properties: {} },
2324
+ handler: async (_a, c) => raw(c, "GET", `/outbound-webhooks`),
2325
+ },
2326
+ {
2327
+ name: "list_outbound_webhook_events",
2328
+ descriptionKey: "mcp.tools.list_outbound_webhook_events.description",
2329
+ inputSchema: { type: "object", properties: {} },
2330
+ handler: async (_a, c) => raw(c, "GET", `/outbound-webhooks/events`),
2331
+ },
2332
+ {
2333
+ name: "create_outbound_webhook",
2334
+ descriptionKey: "mcp.tools.create_outbound_webhook.description",
2335
+ inputSchema: { type: "object", properties: { definition: On }, required: ["definition"] },
2336
+ handler: async (a, c) => raw(c, "POST", `/outbound-webhooks`, getObj(a, "definition")),
2337
+ },
2338
+ {
2339
+ name: "update_outbound_webhook",
2340
+ descriptionKey: "mcp.tools.update_outbound_webhook.description",
2341
+ inputSchema: { type: "object", properties: { hookId: Sn, patch: On }, required: ["hookId", "patch"] },
2342
+ handler: async (a, c) => raw(c, "PATCH", `/outbound-webhooks/${encodeURIComponent(getStr(a, "hookId"))}`, getObj(a, "patch")),
2343
+ },
2344
+ {
2345
+ name: "delete_outbound_webhook",
2346
+ descriptionKey: "mcp.tools.delete_outbound_webhook.description",
2347
+ inputSchema: { type: "object", properties: { hookId: Sn }, required: ["hookId"] },
2348
+ handler: async (a, c) => raw(c, "DELETE", `/outbound-webhooks/${encodeURIComponent(getStr(a, "hookId"))}`),
2349
+ },
2350
+ {
2351
+ name: "test_outbound_webhook",
2352
+ descriptionKey: "mcp.tools.test_outbound_webhook.description",
2353
+ inputSchema: { type: "object", properties: { hookId: Sn, event: Sn, payload: On }, required: ["hookId"] },
2354
+ handler: async (a, c) => raw(c, "POST", `/outbound-webhooks/${encodeURIComponent(getStr(a, "hookId"))}/test`, {
2355
+ event: getOptStr(a, "event"), payload: getOptObj(a, "payload"),
2356
+ }),
2357
+ },
2358
+ {
2359
+ name: "preview_outbound_webhook",
2360
+ descriptionKey: "mcp.tools.preview_outbound_webhook.description",
2361
+ inputSchema: { type: "object", properties: { definition: On }, required: ["definition"] },
2362
+ handler: async (a, c) => raw(c, "POST", `/outbound-webhooks/preview`, getObj(a, "definition")),
2363
+ },
2364
+ {
2365
+ name: "search_outbound_webhook_deliveries",
2366
+ descriptionKey: "mcp.tools.search_outbound_webhook_deliveries.description",
2367
+ inputSchema: { type: "object", properties: { hookId: Sn, event: Sn, status: Sn, limit: Nn }, required: ["hookId"] },
2368
+ handler: async (a, c) => raw(c, "GET", `/outbound-webhooks/${encodeURIComponent(getStr(a, "hookId"))}/deliveries${qs({
2369
+ event: getOptStr(a, "event"), status: getOptStr(a, "status"), limit: getOptNum(a, "limit"),
2370
+ })}`),
2371
+ },
2372
+ {
2373
+ name: "replay_outbound_webhook_delivery",
2374
+ descriptionKey: "mcp.tools.replay_outbound_webhook_delivery.description",
2375
+ inputSchema: { type: "object", properties: { hookId: Sn, deliveryId: Sn }, required: ["hookId", "deliveryId"] },
2376
+ handler: async (a, c) => raw(c, "POST", `/outbound-webhooks/${encodeURIComponent(getStr(a, "hookId"))}/deliveries/${encodeURIComponent(getStr(a, "deliveryId"))}/replay`),
2377
+ },
2378
+ {
2379
+ name: "list_inbound_webhooks",
2380
+ descriptionKey: "mcp.tools.list_inbound_webhooks.description",
2381
+ inputSchema: { type: "object", properties: {} },
2382
+ handler: async (_a, c) => raw(c, "GET", `/inbound-webhooks`),
2383
+ },
2384
+ {
2385
+ name: "list_inbound_webhook_presets",
2386
+ descriptionKey: "mcp.tools.list_inbound_webhook_presets.description",
2387
+ inputSchema: { type: "object", properties: {} },
2388
+ handler: async (_a, c) => raw(c, "GET", `/inbound-webhooks/presets`),
2389
+ },
2390
+ {
2391
+ name: "create_inbound_webhook",
2392
+ descriptionKey: "mcp.tools.create_inbound_webhook.description",
2393
+ inputSchema: { type: "object", properties: { definition: On }, required: ["definition"] },
2394
+ handler: async (a, c) => raw(c, "POST", `/inbound-webhooks`, getObj(a, "definition")),
2395
+ },
2396
+ {
2397
+ name: "update_inbound_webhook",
2398
+ descriptionKey: "mcp.tools.update_inbound_webhook.description",
2399
+ inputSchema: { type: "object", properties: { hookId: Sn, patch: On }, required: ["hookId", "patch"] },
2400
+ handler: async (a, c) => raw(c, "PATCH", `/inbound-webhooks/${encodeURIComponent(getStr(a, "hookId"))}`, getObj(a, "patch")),
2401
+ },
2402
+ {
2403
+ name: "delete_inbound_webhook",
2404
+ descriptionKey: "mcp.tools.delete_inbound_webhook.description",
2405
+ inputSchema: { type: "object", properties: { hookId: Sn }, required: ["hookId"] },
2406
+ handler: async (a, c) => raw(c, "DELETE", `/inbound-webhooks/${encodeURIComponent(getStr(a, "hookId"))}`),
2407
+ },
2408
+ {
2409
+ name: "rotate_inbound_webhook",
2410
+ descriptionKey: "mcp.tools.rotate_inbound_webhook.description",
2411
+ inputSchema: { type: "object", properties: { hookId: Sn }, required: ["hookId"] },
2412
+ handler: async (a, c) => raw(c, "POST", `/inbound-webhooks/${encodeURIComponent(getStr(a, "hookId"))}/rotate`),
2413
+ },
2414
+ {
2415
+ name: "test_inbound_webhook",
2416
+ descriptionKey: "mcp.tools.test_inbound_webhook.description",
2417
+ inputSchema: { type: "object", properties: { hookId: Sn, payload: On }, required: ["hookId"] },
2418
+ handler: async (a, c) => raw(c, "POST", `/inbound-webhooks/${encodeURIComponent(getStr(a, "hookId"))}/test`, getOptObj(a, "payload") ?? {}),
2419
+ },
2420
+ {
2421
+ name: "replay_inbound_webhook_delivery",
2422
+ descriptionKey: "mcp.tools.replay_inbound_webhook_delivery.description",
2423
+ inputSchema: { type: "object", properties: { hookId: Sn, deliveryId: Sn }, required: ["hookId", "deliveryId"] },
2424
+ handler: async (a, c) => raw(c, "POST", `/inbound-webhooks/${encodeURIComponent(getStr(a, "hookId"))}/deliveries/${encodeURIComponent(getStr(a, "deliveryId"))}/replay`),
2425
+ },
2426
+ {
2427
+ name: "get_inbound_webhook_variables",
2428
+ descriptionKey: "mcp.tools.get_inbound_webhook_variables.description",
2429
+ inputSchema: { type: "object", properties: { hookId: Sn }, required: ["hookId"] },
2430
+ handler: async (a, c) => raw(c, "GET", `/inbound-webhooks/${encodeURIComponent(getStr(a, "hookId"))}/variables`),
2431
+ },
2432
+ {
2433
+ name: "get_inbound_webhook_secrets",
2434
+ descriptionKey: "mcp.tools.get_inbound_webhook_secrets.description",
2435
+ inputSchema: { type: "object", properties: { hookId: Sn }, required: ["hookId"] },
2436
+ handler: async (a, c) => raw(c, "GET", `/inbound-webhooks/${encodeURIComponent(getStr(a, "hookId"))}/secrets`),
2437
+ },
2438
+ {
2439
+ name: "set_inbound_webhook_secret",
2440
+ descriptionKey: "mcp.tools.set_inbound_webhook_secret.description",
2441
+ inputSchema: { type: "object", properties: { hookId: Sn, key: Sn, value: Sn }, required: ["hookId", "key", "value"] },
2442
+ handler: async (a, c) => raw(c, "POST", `/inbound-webhooks/${encodeURIComponent(getStr(a, "hookId"))}/secrets`, { key: getStr(a, "key"), value: getStr(a, "value") }),
2443
+ },
2444
+ {
2445
+ name: "delete_inbound_webhook_secret",
2446
+ descriptionKey: "mcp.tools.delete_inbound_webhook_secret.description",
2447
+ inputSchema: { type: "object", properties: { hookId: Sn, key: Sn }, required: ["hookId", "key"] },
2448
+ handler: async (a, c) => raw(c, "DELETE", `/inbound-webhooks/${encodeURIComponent(getStr(a, "hookId"))}/secrets/${encodeURIComponent(getStr(a, "key"))}`),
2449
+ },
2450
+ {
2451
+ name: "wb_list_targets",
2452
+ descriptionKey: "mcp.tools.wb_list_targets.description",
2453
+ inputSchema: { type: "object", properties: {} },
2454
+ handler: async (_a, c) => c.webhooks.listTargets(),
2455
+ },
2456
+ {
2457
+ name: "wb_save_target",
2458
+ descriptionKey: "mcp.tools.wb_save_target.description",
2459
+ inputSchema: { type: "object", properties: { id: Sn, definition: On }, required: ["definition"] },
2460
+ handler: async (a, c) => {
2461
+ const id = getOptStr(a, "id");
2462
+ const def = getObj(a, "definition");
2463
+ return id
2464
+ ? raw(c, "PATCH", `/wb/targets/${encodeURIComponent(id)}`, def)
2465
+ : raw(c, "POST", `/wb/targets`, def);
2466
+ },
2467
+ },
2468
+ {
2469
+ name: "wb_delete_target",
2470
+ descriptionKey: "mcp.tools.wb_delete_target.description",
2471
+ inputSchema: { type: "object", properties: { id: Sn }, required: ["id"] },
2472
+ handler: async (a, c) => raw(c, "DELETE", `/wb/targets/${encodeURIComponent(getStr(a, "id"))}`),
2473
+ },
2474
+ {
2475
+ name: "wb_list_groups",
2476
+ descriptionKey: "mcp.tools.wb_list_groups.description",
2477
+ inputSchema: { type: "object", properties: {} },
2478
+ handler: async (_a, c) => c.webhooks.listGroups(),
2479
+ },
2480
+ {
2481
+ name: "wb_save_group",
2482
+ descriptionKey: "mcp.tools.wb_save_group.description",
2483
+ inputSchema: { type: "object", properties: { id: Sn, definition: On }, required: ["definition"] },
2484
+ handler: async (a, c) => {
2485
+ const id = getOptStr(a, "id");
2486
+ const def = getObj(a, "definition");
2487
+ return id
2488
+ ? raw(c, "PATCH", `/wb/groups/${encodeURIComponent(id)}`, def)
2489
+ : raw(c, "POST", `/wb/groups`, def);
2490
+ },
2491
+ },
2492
+ {
2493
+ name: "wb_delete_group",
2494
+ descriptionKey: "mcp.tools.wb_delete_group.description",
2495
+ inputSchema: { type: "object", properties: { id: Sn }, required: ["id"] },
2496
+ handler: async (a, c) => raw(c, "DELETE", `/wb/groups/${encodeURIComponent(getStr(a, "id"))}`),
2497
+ },
2498
+ {
2499
+ name: "wb_duplicate_group",
2500
+ descriptionKey: "mcp.tools.wb_duplicate_group.description",
2501
+ inputSchema: { type: "object", properties: { id: Sn }, required: ["id"] },
2502
+ handler: async (a, c) => raw(c, "POST", `/wb/groups/${encodeURIComponent(getStr(a, "id"))}/duplicate`),
2503
+ },
2504
+ {
2505
+ name: "wb_list_schedules",
2506
+ descriptionKey: "mcp.tools.wb_list_schedules.description",
2507
+ inputSchema: { type: "object", properties: {} },
2508
+ handler: async (_a, c) => raw(c, "GET", `/wb/schedules`),
2509
+ },
2510
+ {
2511
+ name: "wb_save_schedule",
2512
+ descriptionKey: "mcp.tools.wb_save_schedule.description",
2513
+ inputSchema: { type: "object", properties: { id: Sn, definition: On }, required: ["definition"] },
2514
+ handler: async (a, c) => {
2515
+ const id = getOptStr(a, "id");
2516
+ const def = getObj(a, "definition");
2517
+ return id
2518
+ ? raw(c, "PATCH", `/wb/schedules/${encodeURIComponent(id)}`, def)
2519
+ : raw(c, "POST", `/wb/schedules`, def);
2520
+ },
2521
+ },
2522
+ {
2523
+ name: "wb_delete_schedule",
2524
+ descriptionKey: "mcp.tools.wb_delete_schedule.description",
2525
+ inputSchema: { type: "object", properties: { id: Sn }, required: ["id"] },
2526
+ handler: async (a, c) => raw(c, "DELETE", `/wb/schedules/${encodeURIComponent(getStr(a, "id"))}`),
2527
+ },
2528
+ {
2529
+ name: "wb_send_now",
2530
+ descriptionKey: "mcp.tools.wb_send_now.description",
2531
+ inputSchema: {
2532
+ type: "object",
2533
+ properties: {
2534
+ targetIds: { type: "array", items: Sn, minItems: 1 },
2535
+ embedTemplateName: Sn, content: Sn,
2536
+ },
2537
+ required: ["targetIds"],
2538
+ },
2539
+ handler: async (a, c) => {
2540
+ const targetIds = getStrArr(a, "targetIds");
2541
+ const embedTemplateName = getOptStr(a, "embedTemplateName");
2542
+ const content = getOptStr(a, "content");
2543
+ return c.webhooks.sendNow({
2544
+ targetIds,
2545
+ ...(embedTemplateName !== undefined ? { embedTemplateName } : {}),
2546
+ ...(content !== undefined ? { content } : {}),
2547
+ });
2548
+ },
2549
+ },
2550
+ {
2551
+ name: "wb_export",
2552
+ descriptionKey: "mcp.tools.wb_export.description",
2553
+ inputSchema: { type: "object", properties: {} },
2554
+ handler: async (_a, c) => raw(c, "GET", `/wb/export`),
2555
+ },
2556
+ // ═══════════════════════════════════════════════════════════════════════
2557
+ // FEEDS — SOCIAL / GITHUB-ACTIVITY / RELAY / INVITE-TRACKER / CONNECTIONS
2558
+ // ═══════════════════════════════════════════════════════════════════════
2559
+ {
2560
+ name: "list_social_subscriptions",
2561
+ descriptionKey: "mcp.tools.list_social_subscriptions.description",
2562
+ inputSchema: { type: "object", properties: {} },
2563
+ handler: async (_a, c) => raw(c, "GET", `/social-tracking`),
2564
+ },
2565
+ {
2566
+ name: "create_social_subscription",
2567
+ descriptionKey: "mcp.tools.create_social_subscription.description",
2568
+ inputSchema: { type: "object", properties: { definition: On }, required: ["definition"] },
2569
+ handler: async (a, c) => raw(c, "POST", `/social-tracking/subscriptions`, getObj(a, "definition")),
2570
+ },
2571
+ {
2572
+ name: "delete_social_subscription",
2573
+ descriptionKey: "mcp.tools.delete_social_subscription.description",
2574
+ inputSchema: { type: "object", properties: { subscriptionId: Sn }, required: ["subscriptionId"] },
2575
+ handler: async (a, c) => raw(c, "DELETE", `/social-tracking/subscriptions/${encodeURIComponent(getStr(a, "subscriptionId"))}`),
2576
+ },
2577
+ {
2578
+ name: "test_social_subscription",
2579
+ descriptionKey: "mcp.tools.test_social_subscription.description",
2580
+ inputSchema: { type: "object", properties: { sample: On } },
2581
+ handler: async (a, c) => raw(c, "POST", `/social-tracking/test`, getOptObj(a, "sample") ?? {}),
2582
+ },
2583
+ {
2584
+ name: "replay_social_subscription",
2585
+ descriptionKey: "mcp.tools.replay_social_subscription.description",
2586
+ inputSchema: { type: "object", properties: { subscriptionId: Sn }, required: ["subscriptionId"] },
2587
+ handler: async (a, c) => raw(c, "POST", `/social-tracking/subscriptions/${encodeURIComponent(getStr(a, "subscriptionId"))}/replay`),
2588
+ },
2589
+ {
2590
+ name: "reset_social_subscription_cursor",
2591
+ descriptionKey: "mcp.tools.reset_social_subscription_cursor.description",
2592
+ inputSchema: { type: "object", properties: { subscriptionId: Sn }, required: ["subscriptionId"] },
2593
+ handler: async (a, c) => raw(c, "POST", `/social-tracking/subscriptions/${encodeURIComponent(getStr(a, "subscriptionId"))}/reset-cursor`),
2594
+ },
2595
+ {
2596
+ name: "list_invite_tracker",
2597
+ descriptionKey: "mcp.tools.list_invite_tracker.description",
2598
+ inputSchema: { type: "object", properties: {} },
2599
+ handler: async (_a, c) => raw(c, "GET", `/invite-tracker`),
2600
+ },
2601
+ {
2602
+ name: "save_invite_bonus",
2603
+ descriptionKey: "mcp.tools.save_invite_bonus.description",
2604
+ inputSchema: { type: "object", properties: { definition: On }, required: ["definition"] },
2605
+ handler: async (a, c) => raw(c, "POST", `/invite-tracker/bonuses`, getObj(a, "definition")),
2606
+ },
2607
+ {
2608
+ name: "save_invite_reward",
2609
+ descriptionKey: "mcp.tools.save_invite_reward.description",
2610
+ inputSchema: { type: "object", properties: { definition: On }, required: ["definition"] },
2611
+ handler: async (a, c) => raw(c, "POST", `/invite-tracker/rewards`, getObj(a, "definition")),
2612
+ },
2613
+ {
2614
+ name: "delete_invite_reward",
2615
+ descriptionKey: "mcp.tools.delete_invite_reward.description",
2616
+ inputSchema: { type: "object", properties: { roleId: Sn }, required: ["roleId"] },
2617
+ handler: async (a, c) => raw(c, "DELETE", `/invite-tracker/rewards/${encodeURIComponent(getStr(a, "roleId"))}`),
2618
+ },
2619
+ {
2620
+ name: "set_invite_label",
2621
+ descriptionKey: "mcp.tools.set_invite_label.description",
2622
+ inputSchema: { type: "object", properties: { code: Sn, label: Sn }, required: ["code"] },
2623
+ handler: async (a, c) => raw(c, "PATCH", `/invite-tracker/labels/${encodeURIComponent(getStr(a, "code"))}`, { label: getOptStr(a, "label") }),
2624
+ },
2625
+ {
2626
+ name: "save_invite_leaderboard",
2627
+ descriptionKey: "mcp.tools.save_invite_leaderboard.description",
2628
+ inputSchema: { type: "object", properties: { leaderboardId: Sn, definition: On }, required: ["definition"] },
2629
+ handler: async (a, c) => {
2630
+ const id = getOptStr(a, "leaderboardId");
2631
+ const def = getObj(a, "definition");
2632
+ return id
2633
+ ? raw(c, "PATCH", `/invite-tracker/leaderboards/${encodeURIComponent(id)}`, def)
2634
+ : raw(c, "POST", `/invite-tracker/leaderboards`, def);
2635
+ },
2636
+ },
2637
+ {
2638
+ name: "block_invite_user",
2639
+ descriptionKey: "mcp.tools.block_invite_user.description",
2640
+ inputSchema: { type: "object", properties: { userId: Sn, reason: Sn }, required: ["userId"] },
2641
+ handler: async (a, c) => raw(c, "POST", `/invite-tracker/blocklist`, { userId: getStr(a, "userId"), reason: getOptStr(a, "reason") }),
2642
+ },
2643
+ {
2644
+ name: "list_my_connections",
2645
+ descriptionKey: "mcp.tools.list_my_connections.description",
2646
+ inputSchema: { type: "object", properties: {} },
2647
+ handler: async (_a, c) => rawAbs(c, "GET", `/api/me/connections`),
2648
+ },
2649
+ {
2650
+ name: "list_github_subscriptions",
2651
+ descriptionKey: "mcp.tools.list_github_subscriptions.description",
2652
+ inputSchema: { type: "object", properties: {} },
2653
+ handler: async (_a, c) => rawAbs(c, "GET", `/api/me/connections/github/subscriptions`),
2654
+ },
2655
+ // ═══════════════════════════════════════════════════════════════════════
2656
+ // SETTINGS / MODULES / COMPLIANCE / DISCOVERY / RECIPES / AUDIT / LOGS
2657
+ // ═══════════════════════════════════════════════════════════════════════
2658
+ {
2659
+ name: "list_modules",
2660
+ descriptionKey: "mcp.tools.list_modules.description",
2661
+ inputSchema: { type: "object", properties: {} },
2662
+ handler: async (_a, c) => rawAbs(c, "GET", `/api/modules`),
2663
+ },
2664
+ {
2665
+ name: "get_module_schema",
2666
+ descriptionKey: "mcp.tools.get_module_schema.description",
2667
+ inputSchema: { type: "object", properties: { moduleKey: Sn }, required: ["moduleKey"] },
2668
+ handler: async (a, c) => rawAbs(c, "GET", `/api/modules/${encodeURIComponent(getStr(a, "moduleKey"))}/schema`),
2669
+ },
2670
+ {
2671
+ name: "list_guild_modules",
2672
+ descriptionKey: "mcp.tools.list_guild_modules.description",
2673
+ inputSchema: { type: "object", properties: {} },
2674
+ handler: async (_a, c) => rawAbs(c, "GET", `/api/guilds/${c.guildId}/modules`),
2675
+ },
2676
+ {
2677
+ name: "enable_module",
2678
+ descriptionKey: "mcp.tools.enable_module.description",
2679
+ inputSchema: { type: "object", properties: { moduleKey: Sn }, required: ["moduleKey"] },
2680
+ handler: async (a, c) => rawAbs(c, "PATCH", `/api/guilds/${c.guildId}/modules/${encodeURIComponent(getStr(a, "moduleKey"))}`, { enabled: true }),
2681
+ },
2682
+ {
2683
+ name: "disable_module",
2684
+ descriptionKey: "mcp.tools.disable_module.description",
2685
+ inputSchema: { type: "object", properties: { moduleKey: Sn }, required: ["moduleKey"] },
2686
+ handler: async (a, c) => rawAbs(c, "PATCH", `/api/guilds/${c.guildId}/modules/${encodeURIComponent(getStr(a, "moduleKey"))}`, { enabled: false }),
2687
+ },
2688
+ {
2689
+ name: "get_setting",
2690
+ descriptionKey: "mcp.tools.get_setting.description",
2691
+ inputSchema: { type: "object", properties: { module: Sn, key: Sn }, required: ["module"] },
2692
+ handler: async (a, c) => raw(c, "GET", `/settings${qs({ module: getStr(a, "module"), key: getOptStr(a, "key") })}`),
2693
+ },
2694
+ {
2695
+ name: "set_setting",
2696
+ descriptionKey: "mcp.tools.set_setting.description",
2697
+ inputSchema: { type: "object", properties: { module: Sn, key: Sn, value: {} }, required: ["module", "key"] },
2698
+ handler: async (a, c) => raw(c, "PATCH", `/settings`, { module: getStr(a, "module"), patch: { [getStr(a, "key")]: a["value"] } }),
2699
+ },
2700
+ {
2701
+ name: "get_settings_bulk",
2702
+ descriptionKey: "mcp.tools.get_settings_bulk.description",
2703
+ inputSchema: { type: "object", properties: { module: Sn }, required: ["module"] },
2704
+ handler: async (a, c) => rawAbs(c, "GET", `/api/guilds/${c.guildId}/settings${qs({ module: getStr(a, "module") })}`),
2705
+ },
2706
+ {
2707
+ name: "set_settings_bulk",
2708
+ descriptionKey: "mcp.tools.set_settings_bulk.description",
2709
+ inputSchema: { type: "object", properties: { module: Sn, patch: On }, required: ["module", "patch"] },
2710
+ handler: async (a, c) => rawAbs(c, "PATCH", `/api/guilds/${c.guildId}/settings`, { module: getStr(a, "module"), patch: getObj(a, "patch") }),
2711
+ },
2712
+ {
2713
+ name: "export_settings",
2714
+ descriptionKey: "mcp.tools.export_settings.description",
2715
+ inputSchema: { type: "object", properties: {} },
2716
+ handler: async (_a, c) => raw(c, "GET", `/settings/export`),
2717
+ },
2718
+ {
2719
+ name: "import_settings",
2720
+ descriptionKey: "mcp.tools.import_settings.description",
2721
+ inputSchema: { type: "object", properties: { data: On }, required: ["data"] },
2722
+ handler: async (a, c) => raw(c, "POST", `/settings/import`, getObj(a, "data")),
2723
+ },
2724
+ {
2725
+ name: "get_compliance_report",
2726
+ descriptionKey: "mcp.tools.get_compliance_report.description",
2727
+ inputSchema: { type: "object", properties: {} },
2728
+ handler: async (_a, c) => raw(c, "GET", `/compliance/report`),
2729
+ },
2730
+ {
2731
+ name: "list_compliance_reports",
2732
+ descriptionKey: "mcp.tools.list_compliance_reports.description",
2733
+ inputSchema: { type: "object", properties: {} },
2734
+ handler: async (_a, c) => raw(c, "GET", `/compliance/reports`),
2735
+ },
2736
+ {
2737
+ name: "list_audit_entries",
2738
+ descriptionKey: "mcp.tools.list_audit_entries.description",
2739
+ inputSchema: { type: "object", properties: { limit: Nn, cursor: Sn } },
2740
+ handler: async (a, c) => rawAbs(c, "GET", `/api/guilds/${c.guildId}/audit${qs({ limit: getOptNum(a, "limit"), cursor: getOptStr(a, "cursor") })}`),
2741
+ },
2742
+ {
2743
+ name: "get_audit_entry",
2744
+ descriptionKey: "mcp.tools.get_audit_entry.description",
2745
+ inputSchema: { type: "object", properties: { entryId: Sn }, required: ["entryId"] },
2746
+ handler: async (a, c) => rawAbs(c, "GET", `/api/guilds/${c.guildId}/audit/${encodeURIComponent(getStr(a, "entryId"))}`),
2747
+ },
2748
+ {
2749
+ name: "restore_audit_entry",
2750
+ descriptionKey: "mcp.tools.restore_audit_entry.description",
2751
+ inputSchema: { type: "object", properties: { entryId: Sn }, required: ["entryId"] },
2752
+ handler: async (a, c) => rawAbs(c, "POST", `/api/guilds/${c.guildId}/audit/${encodeURIComponent(getStr(a, "entryId"))}/restore`),
2753
+ },
2754
+ {
2755
+ name: "get_discovery_profile",
2756
+ descriptionKey: "mcp.tools.get_discovery_profile.description",
2757
+ inputSchema: { type: "object", properties: {} },
2758
+ handler: async (_a, c) => rawAbs(c, "GET", `/api/guilds/${c.guildId}/discovery`),
2759
+ },
2760
+ {
2761
+ name: "update_discovery_profile",
2762
+ descriptionKey: "mcp.tools.update_discovery_profile.description",
2763
+ inputSchema: { type: "object", properties: { patch: On }, required: ["patch"] },
2764
+ handler: async (a, c) => rawAbs(c, "PATCH", `/api/guilds/${c.guildId}/discovery`, getObj(a, "patch")),
2765
+ },
2766
+ {
2767
+ name: "create_discovery_profile",
2768
+ descriptionKey: "mcp.tools.create_discovery_profile.description",
2769
+ inputSchema: { type: "object", properties: { definition: On }, required: ["definition"] },
2770
+ handler: async (a, c) => rawAbs(c, "POST", `/api/guilds/${c.guildId}/discovery`, getObj(a, "definition")),
2771
+ },
2772
+ {
2773
+ name: "delete_discovery_profile",
2774
+ descriptionKey: "mcp.tools.delete_discovery_profile.description",
2775
+ inputSchema: { type: "object", properties: {} },
2776
+ handler: async (_a, c) => rawAbs(c, "DELETE", `/api/guilds/${c.guildId}/discovery`),
2777
+ },
2778
+ {
2779
+ name: "list_recipes",
2780
+ descriptionKey: "mcp.tools.list_recipes.description",
2781
+ inputSchema: { type: "object", properties: {} },
2782
+ handler: async (_a, c) => rawAbs(c, "GET", `/api/recipes`),
2783
+ },
2784
+ {
2785
+ name: "install_recipe",
2786
+ descriptionKey: "mcp.tools.install_recipe.description",
2787
+ inputSchema: { type: "object", properties: { recipeSlug: Sn, overrides: On }, required: ["recipeSlug"] },
2788
+ handler: async (a, c) => raw(c, "POST", `/recipes/install`, {
2789
+ slug: getStr(a, "recipeSlug"),
2790
+ overrides: getOptObj(a, "overrides") ?? {},
2791
+ }),
2792
+ },
2793
+ {
2794
+ name: "list_logs",
2795
+ descriptionKey: "mcp.tools.list_logs.description",
2796
+ inputSchema: { type: "object", properties: { limit: Nn, kind: Sn } },
2797
+ handler: async (a, c) => raw(c, "GET", `/logs${qs({ limit: getOptNum(a, "limit"), kind: getOptStr(a, "kind") })}`),
2798
+ },
2799
+ {
2800
+ name: "export_logs",
2801
+ descriptionKey: "mcp.tools.export_logs.description",
2802
+ inputSchema: { type: "object", properties: {} },
2803
+ handler: async (_a, c) => raw(c, "GET", `/logs/export`),
2804
+ },
2805
+ {
2806
+ name: "get_workload",
2807
+ descriptionKey: "mcp.tools.get_workload.description",
2808
+ inputSchema: { type: "object", properties: {} },
2809
+ handler: async (_a, c) => raw(c, "GET", `/workload`),
2810
+ },
2811
+ {
2812
+ name: "get_stats",
2813
+ descriptionKey: "mcp.tools.get_stats.description",
2814
+ inputSchema: { type: "object", properties: {} },
2815
+ handler: async (_a, c) => rawAbs(c, "GET", `/api/stats`),
2816
+ },
2817
+ {
2818
+ name: "list_mod_coach_runs",
2819
+ descriptionKey: "mcp.tools.list_mod_coach_runs.description",
2820
+ inputSchema: { type: "object", properties: { limit: Nn } },
2821
+ handler: async (a, c) => raw(c, "GET", `/mod-coach/runs${qs({ limit: getOptNum(a, "limit") })}`),
2822
+ },
2823
+ {
2824
+ name: "run_mod_coach",
2825
+ descriptionKey: "mcp.tools.run_mod_coach.description",
2826
+ inputSchema: { type: "object", properties: { sample: On } },
2827
+ handler: async (a, c) => raw(c, "POST", `/mod-coach/run`, getOptObj(a, "sample") ?? {}),
2828
+ },
2829
+ {
2830
+ name: "ask_mod_coach",
2831
+ descriptionKey: "mcp.tools.ask_mod_coach.description",
2832
+ inputSchema: { type: "object", properties: { runId: Sn, question: Sn }, required: ["runId", "question"] },
2833
+ handler: async (a, c) => raw(c, "POST", `/mod-coach/runs/${encodeURIComponent(getStr(a, "runId"))}/ask`, { question: getStr(a, "question") }),
2834
+ },
2835
+ {
2836
+ name: "apply_mod_coach_recommendation",
2837
+ descriptionKey: "mcp.tools.apply_mod_coach_recommendation.description",
2838
+ inputSchema: { type: "object", properties: { runId: Sn, recommendationId: Sn }, required: ["runId", "recommendationId"] },
2839
+ handler: async (a, c) => raw(c, "POST", `/mod-coach/runs/${encodeURIComponent(getStr(a, "runId"))}/recommendations/${encodeURIComponent(getStr(a, "recommendationId"))}/apply`),
2840
+ },
2841
+ {
2842
+ name: "list_secrets",
2843
+ descriptionKey: "mcp.tools.list_secrets.description",
2844
+ inputSchema: { type: "object", properties: {} },
2845
+ handler: async (_a, c) => rawAbs(c, "GET", `/api/secrets/${c.guildId}`),
2846
+ },
2847
+ {
2848
+ name: "set_secret",
2849
+ descriptionKey: "mcp.tools.set_secret.description",
2850
+ inputSchema: { type: "object", properties: { key: Sn, value: Sn }, required: ["key", "value"] },
2851
+ handler: async (a, c) => rawAbs(c, "POST", `/api/secrets/${c.guildId}`, { key: getStr(a, "key"), value: getStr(a, "value") }),
2852
+ },
2853
+ {
2854
+ name: "delete_secret",
2855
+ descriptionKey: "mcp.tools.delete_secret.description",
2856
+ inputSchema: { type: "object", properties: { key: Sn }, required: ["key"] },
2857
+ handler: async (a, c) => rawAbs(c, "DELETE", `/api/secrets/${c.guildId}/${encodeURIComponent(getStr(a, "key"))}`),
2858
+ },
2859
+ // ═══════════════════════════════════════════════════════════════════════
2860
+ // COMPATIBILITY / CHANNEL-GAMES / GAMES / MISC
2861
+ // ═══════════════════════════════════════════════════════════════════════
2862
+ {
2863
+ name: "compatibility_summary",
2864
+ descriptionKey: "mcp.tools.compatibility_summary.description",
2865
+ inputSchema: { type: "object", properties: {} },
2866
+ handler: async (_a, c) => raw(c, "GET", `/compatibility/summary`),
2867
+ },
2868
+ {
2869
+ name: "compatibility_pair",
2870
+ descriptionKey: "mcp.tools.compatibility_pair.description",
2871
+ inputSchema: { type: "object", properties: { userA: Sn, userB: Sn }, required: ["userA", "userB"] },
2872
+ handler: async (a, c) => raw(c, "GET", `/compatibility/pair${qs({ a: getStr(a, "userA"), b: getStr(a, "userB") })}`),
2873
+ },
2874
+ {
2875
+ name: "compatibility_should_meet",
2876
+ descriptionKey: "mcp.tools.compatibility_should_meet.description",
2877
+ inputSchema: { type: "object", properties: { userId: Sn }, required: ["userId"] },
2878
+ handler: async (a, c) => raw(c, "GET", `/compatibility/should-meet${qs({ userId: getStr(a, "userId") })}`),
2879
+ },
2880
+ {
2881
+ name: "compatibility_alerts",
2882
+ descriptionKey: "mcp.tools.compatibility_alerts.description",
2883
+ inputSchema: { type: "object", properties: { limit: Nn } },
2884
+ handler: async (a, c) => raw(c, "GET", `/compatibility/alerts${qs({ limit: getOptNum(a, "limit") })}`),
2885
+ },
2886
+ {
2887
+ name: "compatibility_report",
2888
+ descriptionKey: "mcp.tools.compatibility_report.description",
2889
+ inputSchema: { type: "object", properties: {} },
2890
+ handler: async (_a, c) => raw(c, "GET", `/compatibility/report`),
2891
+ },
2892
+ {
2893
+ name: "list_channel_games",
2894
+ descriptionKey: "mcp.tools.list_channel_games.description",
2895
+ inputSchema: { type: "object", properties: {} },
2896
+ handler: async (_a, c) => raw(c, "GET", `/channel-games`),
2897
+ },
2898
+ {
2899
+ name: "save_channel_game",
2900
+ descriptionKey: "mcp.tools.save_channel_game.description",
2901
+ inputSchema: { type: "object", properties: { ruleId: Sn, definition: On }, required: ["definition"] },
2902
+ handler: async (a, c) => {
2903
+ const ruleId = getOptStr(a, "ruleId");
2904
+ const def = getObj(a, "definition");
2905
+ return ruleId
2906
+ ? raw(c, "PATCH", `/channel-games/${encodeURIComponent(ruleId)}`, def)
2907
+ : raw(c, "POST", `/channel-games`, def);
2908
+ },
2909
+ },
2910
+ {
2911
+ name: "delete_channel_game",
2912
+ descriptionKey: "mcp.tools.delete_channel_game.description",
2913
+ inputSchema: { type: "object", properties: { ruleId: Sn }, required: ["ruleId"] },
2914
+ handler: async (a, c) => raw(c, "DELETE", `/channel-games/${encodeURIComponent(getStr(a, "ruleId"))}`),
2915
+ },
2916
+ {
2917
+ name: "channel_games_leaderboard",
2918
+ descriptionKey: "mcp.tools.channel_games_leaderboard.description",
2919
+ inputSchema: { type: "object", properties: {} },
2920
+ handler: async (_a, c) => raw(c, "GET", `/channel-games/leaderboard`),
2921
+ },
2922
+ {
2923
+ name: "list_games",
2924
+ descriptionKey: "mcp.tools.list_games.description",
2925
+ inputSchema: { type: "object", properties: {} },
2926
+ handler: async (_a, c) => raw(c, "GET", `/games`),
2927
+ },
2928
+ {
2929
+ name: "games_leaderboard",
2930
+ descriptionKey: "mcp.tools.games_leaderboard.description",
2931
+ inputSchema: { type: "object", properties: { limit: Nn } },
2932
+ handler: async (a, c) => raw(c, "GET", `/games/leaderboard${qs({ limit: getOptNum(a, "limit") })}`),
2933
+ },
2934
+ {
2935
+ name: "list_command_policies",
2936
+ descriptionKey: "mcp.tools.list_command_policies.description",
2937
+ inputSchema: { type: "object", properties: {} },
2938
+ handler: async (_a, c) => rawAbs(c, "GET", `/api/guilds/${c.guildId}/commands`),
2939
+ },
2940
+ {
2941
+ name: "list_public_tools",
2942
+ descriptionKey: "mcp.tools.list_public_tools.description",
2943
+ inputSchema: { type: "object", properties: {} },
2944
+ handler: async (_a, c) => rawAbs(c, "GET", `/api/public/tools`),
2945
+ },
2946
+ ];
2947
+ export async function dispatch(name, args, client) {
2948
+ const tool = TOOLS.find((t) => t.name === name);
2949
+ if (!tool)
2950
+ throw new Error(`unknown_tool: ${name}`);
2951
+ return tool.handler(args, client);
2952
+ }
2953
+ //# sourceMappingURL=tools.js.map