@rcs-campaigns/agent-toolkit 0.1.10 → 0.1.11
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/cli.js +5 -3
- package/dist/cliDispatch.d.ts.map +1 -1
- package/dist/cliDispatch.js +12 -1
- package/dist/mcp.js +1 -2
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +316 -5
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -107,7 +107,7 @@ Surveys:
|
|
|
107
107
|
${BIN} survey send <id> [--to +1555... ...] [--audience <audienceId> ...]
|
|
108
108
|
${BIN} survey send-test <id> --to +1555...
|
|
109
109
|
${BIN} survey sends <id>
|
|
110
|
-
${BIN} survey results <id>
|
|
110
|
+
${BIN} survey results <id> [--campaign <campaignId>]
|
|
111
111
|
|
|
112
112
|
Everything else, straight from the tool catalog (scope shown after each):
|
|
113
113
|
${(0, cliDispatch_1.catalogUsage)(BIN)}
|
|
@@ -339,10 +339,12 @@ async function run() {
|
|
|
339
339
|
path: `/surveys/${enc(id)}/sends`
|
|
340
340
|
}));
|
|
341
341
|
case 'results':
|
|
342
|
-
requireArg(id, 'survey results <id>');
|
|
342
|
+
requireArg(id, 'survey results <id> [--campaign <campaignId>]');
|
|
343
343
|
return print(await client.call({
|
|
344
344
|
method: 'GET',
|
|
345
|
-
path: `/surveys/${enc(id)}/results
|
|
345
|
+
path: `/surveys/${enc(id)}/results`,
|
|
346
|
+
// One send's results (the campaignId `survey send` returns).
|
|
347
|
+
query: { campaignId: str(argv.flags.campaign) }
|
|
346
348
|
}));
|
|
347
349
|
default:
|
|
348
350
|
// `survey render|clone|delete` and anything the catalog grows later.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cliDispatch.d.ts","sourceRoot":"","sources":["../src/cliDispatch.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAmB,KAAK,OAAO,EAAE,MAAM,SAAS,CAAC;AAExD,MAAM,WAAW,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,CAmC1C,CAAC;AAEF,+EAA+E;AAC/E,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,EAAE,CAElD;AAED,yEAAyE;AACzE,wBAAgB,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAG7C;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,MAAM,EAAE,GACd;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAa7C;AAED,yEAAyE;AACzE,wBAAgB,MAAM,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CA4B7D;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,OAAO,EACb,WAAW,EAAE,MAAM,EAAE,EACrB,IAAI,EAAE,UAAU,EAChB,QAAQ,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAuC,GAClE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAiDrB;AAED,kFAAkF;AAClF,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,SAAQ,GAAG,MAAM,CAc5D;AAED,oFAAoF;AACpF,wBAAgB,YAAY,CAAC,GAAG,SAAQ,GAAG,MAAM,CAIhD"}
|
package/dist/cliDispatch.js
CHANGED
|
@@ -110,6 +110,8 @@ exports.ALIASES = {
|
|
|
110
110
|
'audience contacts': 'list_audience_contacts',
|
|
111
111
|
'audience create': 'create_audience',
|
|
112
112
|
'audience import': 'import_contacts',
|
|
113
|
+
'audience update': 'update_audience',
|
|
114
|
+
'audience remove': 'remove_audience_contacts',
|
|
113
115
|
'audience delete': 'delete_audience',
|
|
114
116
|
contacts: 'list_contacts',
|
|
115
117
|
'contact get': 'get_contact',
|
|
@@ -127,7 +129,16 @@ exports.ALIASES = {
|
|
|
127
129
|
'template delete': 'delete_template',
|
|
128
130
|
'survey render': 'render_survey',
|
|
129
131
|
'survey clone': 'clone_survey',
|
|
130
|
-
'survey delete': 'delete_survey'
|
|
132
|
+
'survey delete': 'delete_survey',
|
|
133
|
+
campaigns: 'list_campaigns',
|
|
134
|
+
analytics: 'get_campaign_analytics',
|
|
135
|
+
groups: 'list_campaign_groups',
|
|
136
|
+
'group get': 'get_campaign_group',
|
|
137
|
+
'group create': 'create_campaign_group',
|
|
138
|
+
'group update': 'update_campaign_group',
|
|
139
|
+
'group delete': 'delete_campaign_group',
|
|
140
|
+
'group add': 'add_campaigns_to_group',
|
|
141
|
+
'group remove': 'remove_campaigns_from_group'
|
|
131
142
|
};
|
|
132
143
|
/** The `:param` names in a tool's route, in the order the route names them. */
|
|
133
144
|
function pathParams(tool) {
|
package/dist/mcp.js
CHANGED
|
@@ -31,7 +31,6 @@ const PROTOCOL_VERSION = '2024-11-05';
|
|
|
31
31
|
* "RCS-first" in its own tool list, contradicting the docs that sent it here.
|
|
32
32
|
* Same catalog, same gateway — only the words the model reads differ.
|
|
33
33
|
*/
|
|
34
|
-
const SKIN = (0, client_1.detectSkin)();
|
|
35
34
|
const { product: PRODUCT, channel: CHANNEL, slug: SLUG } = (0, client_1.skinLabels)((0, client_1.detectBrand)());
|
|
36
35
|
const SERVER_INFO = { name: SLUG, version: (0, client_1.readVersion)() };
|
|
37
36
|
/**
|
|
@@ -48,7 +47,7 @@ const INSTRUCTIONS = [
|
|
|
48
47
|
' search_templates → clone_template (into your org) → render_template (preview)',
|
|
49
48
|
' → submit_template (provider approval) → send_message.',
|
|
50
49
|
'Surveys mirror it: search_surveys/create_survey → submit_survey → send_survey →',
|
|
51
|
-
'get_results.',
|
|
50
|
+
'get_results (pass the campaignId send_survey returns for that send only).',
|
|
52
51
|
'',
|
|
53
52
|
`IMPORTANT — rich ${CHANNEL} requires approval. A freshly created or cloned`,
|
|
54
53
|
'template delivers as SMS fallback ONLY until it is submitted AND',
|
package/dist/tools.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAoB,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5E,8DAA8D;AAC9D,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;AAErE,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;;;;;;;OAYG;IACH,MAAM,EAAE,UAAU,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,GAAG,GAAG,GAAG,CAAC;IAC1B,4EAA4E;IAC5E,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ,CAAC;QACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACpC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QACpB,oBAAoB,CAAC,EAAE,OAAO,CAAC;KAChC,CAAC;IACF,qEAAqE;IACrE,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,WAAW,CAAC;CACvD;AAmBD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,mBAAmB,8QA+BtB,CAAC;AAEX,eAAO,MAAM,KAAK,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../src/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAoB,KAAK,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5E,8DAA8D;AAC9D,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAA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
|
name: 'search_templates',
|
|
104
|
-
description: 'Search the published
|
|
104
|
+
description: 'Search the published template MARKETPLACE (templates from every org, to clone). Returns normalized listings (id, name, rating, cloneCount, categoryKeys). For your OWN templates use list_templates.',
|
|
105
105
|
scope: 'campaigns:read',
|
|
106
106
|
method: 'GET',
|
|
107
107
|
path: '/templates',
|
|
@@ -136,6 +136,41 @@ exports.TOOLS = [
|
|
|
136
136
|
}
|
|
137
137
|
})
|
|
138
138
|
},
|
|
139
|
+
{
|
|
140
|
+
name: 'list_templates',
|
|
141
|
+
description: "List YOUR org's own message templates (not the marketplace), newest first, with channel and provider approval status (APPROVED / PENDING / REJECTED / NOT_SUBMITTED) and any rejection reason. Filter by text, channel or approvalStatus. Archived templates only with includeArchived.",
|
|
142
|
+
scope: 'campaigns:read',
|
|
143
|
+
method: 'GET',
|
|
144
|
+
path: '/my-templates',
|
|
145
|
+
inputSchema: {
|
|
146
|
+
type: 'object',
|
|
147
|
+
properties: {
|
|
148
|
+
q: { type: 'string', description: 'Free-text search over name + description.' },
|
|
149
|
+
channel: { type: 'string', enum: ['RCS', 'WHATSAPP', 'SMS'] },
|
|
150
|
+
approvalStatus: {
|
|
151
|
+
type: 'string',
|
|
152
|
+
enum: ['APPROVED', 'PENDING', 'REJECTED', 'NOT_SUBMITTED'],
|
|
153
|
+
description: 'Only templates in this provider approval state.'
|
|
154
|
+
},
|
|
155
|
+
includeArchived: { type: 'boolean', default: false },
|
|
156
|
+
page: { type: 'number', minimum: 1 },
|
|
157
|
+
pageSize: { type: 'number', minimum: 1, maximum: 100 }
|
|
158
|
+
},
|
|
159
|
+
additionalProperties: false
|
|
160
|
+
},
|
|
161
|
+
toRequest: (a) => ({
|
|
162
|
+
method: 'GET',
|
|
163
|
+
path: '/my-templates',
|
|
164
|
+
query: {
|
|
165
|
+
q: a.q,
|
|
166
|
+
channel: a.channel,
|
|
167
|
+
approvalStatus: a.approvalStatus,
|
|
168
|
+
includeArchived: a.includeArchived,
|
|
169
|
+
page: a.page,
|
|
170
|
+
pageSize: a.pageSize
|
|
171
|
+
}
|
|
172
|
+
})
|
|
173
|
+
},
|
|
139
174
|
{
|
|
140
175
|
name: 'get_template',
|
|
141
176
|
description: 'Fetch one template by id (a published marketplace listing or one your org owns).',
|
|
@@ -523,7 +558,7 @@ exports.TOOLS = [
|
|
|
523
558
|
},
|
|
524
559
|
{
|
|
525
560
|
name: 'send_survey',
|
|
526
|
-
description: 'Send a survey to explicit E.164 numbers (the CRM-triggered single-customer send) and/or saved audiences. Flips the survey ACTIVE. Bills your org. Returns { recipients, sent }.',
|
|
561
|
+
description: 'Send a survey to explicit E.164 numbers (the CRM-triggered single-customer send) and/or saved audiences. Flips the survey ACTIVE. Bills your org. Returns { recipients, sent }. Every send is a campaign (WhatsApp sends the approved Flow, RCS the question-by-question run) and also returns campaignId and queued: sending: true means the rest is still going out in the background (do not send again), and halted / heldByAllowance / groundStopped say why a send stopped short.',
|
|
527
562
|
scope: 'surveys:send',
|
|
528
563
|
method: 'POST',
|
|
529
564
|
path: '/surveys/:id/send',
|
|
@@ -630,19 +665,26 @@ exports.TOOLS = [
|
|
|
630
665
|
},
|
|
631
666
|
{
|
|
632
667
|
name: 'get_results',
|
|
633
|
-
description: 'Read a survey’s aggregated results: per-question option counts / rating averages / text samples + completion totals (multi-part questions aggregate per part; free-text answers are auto-translated to English).',
|
|
668
|
+
description: 'Read a survey’s aggregated results: per-question option counts / rating averages / text samples + completion totals (multi-part questions aggregate per part; free-text answers are auto-translated to English). Pass campaignId (returned by send_survey, or a SURVEY campaign’s id from list_campaigns) for that one send’s results; without it the totals span the whole survey, test sends and every campaign included.',
|
|
634
669
|
scope: 'results:read',
|
|
635
670
|
method: 'GET',
|
|
636
671
|
path: '/surveys/:id/results',
|
|
637
672
|
inputSchema: {
|
|
638
673
|
type: 'object',
|
|
639
|
-
properties: {
|
|
674
|
+
properties: {
|
|
675
|
+
id: { type: 'string' },
|
|
676
|
+
campaignId: {
|
|
677
|
+
type: 'string',
|
|
678
|
+
description: 'Only the responses answered from this survey campaign (24-hex id). A campaign that is not this survey’s is a 404.'
|
|
679
|
+
}
|
|
680
|
+
},
|
|
640
681
|
required: ['id'],
|
|
641
682
|
additionalProperties: false
|
|
642
683
|
},
|
|
643
684
|
toRequest: (a) => ({
|
|
644
685
|
method: 'GET',
|
|
645
|
-
path: `/surveys/${encodeURIComponent(a.id)}/results
|
|
686
|
+
path: `/surveys/${encodeURIComponent(a.id)}/results`,
|
|
687
|
+
query: { campaignId: a.campaignId }
|
|
646
688
|
})
|
|
647
689
|
},
|
|
648
690
|
{
|
|
@@ -930,6 +972,54 @@ exports.TOOLS = [
|
|
|
930
972
|
body: { contacts: a.contacts }
|
|
931
973
|
})
|
|
932
974
|
},
|
|
975
|
+
{
|
|
976
|
+
name: 'update_audience',
|
|
977
|
+
description: 'Rename an audience or change its description (null or an empty string clears it). Only the fields you pass change; its contacts are untouched.',
|
|
978
|
+
scope: 'audiences:write',
|
|
979
|
+
method: 'PATCH',
|
|
980
|
+
path: '/audiences/:id',
|
|
981
|
+
inputSchema: {
|
|
982
|
+
type: 'object',
|
|
983
|
+
properties: {
|
|
984
|
+
id: { type: 'string' },
|
|
985
|
+
name: { type: 'string', minLength: 1, maxLength: 120 },
|
|
986
|
+
description: { type: ['string', 'null'], maxLength: 500 }
|
|
987
|
+
},
|
|
988
|
+
required: ['id'],
|
|
989
|
+
additionalProperties: false
|
|
990
|
+
},
|
|
991
|
+
toRequest: (a) => ({
|
|
992
|
+
method: 'PATCH',
|
|
993
|
+
path: `/audiences/${encodeURIComponent(a.id)}`,
|
|
994
|
+
body: { name: a.name, description: a.description }
|
|
995
|
+
})
|
|
996
|
+
},
|
|
997
|
+
{
|
|
998
|
+
name: 'remove_audience_contacts',
|
|
999
|
+
description: "Take people off an audience, by each row's `id` from list_audience_contacts (its `contactId` works too). This is not an opt-out: the person, their message history and their other audiences are untouched, and ids not in the audience are ignored. Returns the audience with its new contactCount and how many were removed.",
|
|
1000
|
+
scope: 'audiences:write',
|
|
1001
|
+
method: 'POST',
|
|
1002
|
+
path: '/audiences/:id/contacts/remove',
|
|
1003
|
+
inputSchema: {
|
|
1004
|
+
type: 'object',
|
|
1005
|
+
properties: {
|
|
1006
|
+
id: { type: 'string' },
|
|
1007
|
+
contactIds: {
|
|
1008
|
+
type: 'array',
|
|
1009
|
+
items: { type: 'string' },
|
|
1010
|
+
minItems: 1,
|
|
1011
|
+
maxItems: 500
|
|
1012
|
+
}
|
|
1013
|
+
},
|
|
1014
|
+
required: ['id', 'contactIds'],
|
|
1015
|
+
additionalProperties: false
|
|
1016
|
+
},
|
|
1017
|
+
toRequest: (a) => ({
|
|
1018
|
+
method: 'POST',
|
|
1019
|
+
path: `/audiences/${encodeURIComponent(a.id)}/contacts/remove`,
|
|
1020
|
+
body: { contactIds: a.contactIds }
|
|
1021
|
+
})
|
|
1022
|
+
},
|
|
933
1023
|
{
|
|
934
1024
|
name: 'delete_audience',
|
|
935
1025
|
description: 'Delete an audience and all of its contacts (org-scoped, irreversible).',
|
|
@@ -1293,6 +1383,227 @@ exports.TOOLS = [
|
|
|
1293
1383
|
tags: a.tags
|
|
1294
1384
|
}
|
|
1295
1385
|
})
|
|
1386
|
+
},
|
|
1387
|
+
// ── Campaign reads (the Messages list + the Analytics page, aggregate only) ──
|
|
1388
|
+
{
|
|
1389
|
+
name: 'list_campaigns',
|
|
1390
|
+
description: "List YOUR org's campaigns (broadcasts), newest first, with status (DRAFT / SCHEDULED / SENDING / SENT / FAILED / CANCELLED), channel, the template sent, audience count, schedule (scheduledAt in the campaign's own timezone) and the delivery funnel (total, delivered, read, failed, fellBackToSms, clicked). Archived campaigns are hidden. Read-only: creating, scheduling or sending a campaign happens in the web app.",
|
|
1391
|
+
scope: 'campaigns:read',
|
|
1392
|
+
method: 'GET',
|
|
1393
|
+
path: '/campaigns',
|
|
1394
|
+
inputSchema: {
|
|
1395
|
+
type: 'object',
|
|
1396
|
+
properties: {
|
|
1397
|
+
q: { type: 'string', maxLength: 120, description: 'Free-text search over the campaign name.' },
|
|
1398
|
+
status: {
|
|
1399
|
+
type: 'string',
|
|
1400
|
+
enum: ['DRAFT', 'SCHEDULED', 'SENDING', 'SENT', 'FAILED', 'CANCELLED']
|
|
1401
|
+
},
|
|
1402
|
+
channel: { type: 'string', enum: ['RCS', 'WHATSAPP'] },
|
|
1403
|
+
page: { type: 'number', minimum: 1 },
|
|
1404
|
+
pageSize: { type: 'number', minimum: 1, maximum: 100 }
|
|
1405
|
+
},
|
|
1406
|
+
additionalProperties: false
|
|
1407
|
+
},
|
|
1408
|
+
toRequest: (a) => ({
|
|
1409
|
+
method: 'GET',
|
|
1410
|
+
path: '/campaigns',
|
|
1411
|
+
query: {
|
|
1412
|
+
q: a.q,
|
|
1413
|
+
status: a.status,
|
|
1414
|
+
channel: a.channel,
|
|
1415
|
+
page: a.page,
|
|
1416
|
+
pageSize: a.pageSize
|
|
1417
|
+
}
|
|
1418
|
+
})
|
|
1419
|
+
},
|
|
1420
|
+
{
|
|
1421
|
+
name: 'get_campaign_analytics',
|
|
1422
|
+
description: "Campaign analytics, the same figures as the web app's Analytics page: totals and rates (delivered, read, clicked, failed, fell back to SMS) over the last N days (default 30, max 365), a daily series (UTC days; hourly for a 1-day window), failure classes by provider error code, after-delivery outcomes (replied, opportunity, not interested) and a per-campaign table. Pass broadcastId (a list_campaigns id) to narrow every figure to one campaign over its own lifetime. Aggregate only — no phone numbers or message text.",
|
|
1423
|
+
scope: 'campaigns:read',
|
|
1424
|
+
method: 'GET',
|
|
1425
|
+
path: '/analytics',
|
|
1426
|
+
inputSchema: {
|
|
1427
|
+
type: 'object',
|
|
1428
|
+
properties: {
|
|
1429
|
+
channel: {
|
|
1430
|
+
type: 'string',
|
|
1431
|
+
enum: ['RCS', 'WHATSAPP'],
|
|
1432
|
+
description: 'Only this channel. Omit for every campaign.'
|
|
1433
|
+
},
|
|
1434
|
+
days: { type: 'number', minimum: 1, maximum: 365 },
|
|
1435
|
+
broadcastId: { type: 'string', description: 'One campaign (its list_campaigns id).' }
|
|
1436
|
+
},
|
|
1437
|
+
additionalProperties: false
|
|
1438
|
+
},
|
|
1439
|
+
toRequest: (a) => ({
|
|
1440
|
+
method: 'GET',
|
|
1441
|
+
path: '/analytics',
|
|
1442
|
+
query: { channel: a.channel, days: a.days, broadcastId: a.broadcastId }
|
|
1443
|
+
})
|
|
1444
|
+
},
|
|
1445
|
+
// ── Campaign groups (named sets of campaigns — bookkeeping, never a send) ──
|
|
1446
|
+
{
|
|
1447
|
+
name: 'list_campaign_groups',
|
|
1448
|
+
description: "List YOUR org's campaign groups — named sets of campaigns filed together (an event, a launch, a quarter) — most recently changed first, each with its member campaign ids, campaign count and combined delivery funnel (every member's funnel added together, from cached figures). Pass broadcastId (a list_campaigns id) for only the groups that campaign is in.",
|
|
1449
|
+
scope: 'campaigns:read',
|
|
1450
|
+
method: 'GET',
|
|
1451
|
+
path: '/campaign-groups',
|
|
1452
|
+
inputSchema: {
|
|
1453
|
+
type: 'object',
|
|
1454
|
+
properties: {
|
|
1455
|
+
broadcastId: {
|
|
1456
|
+
type: 'string',
|
|
1457
|
+
description: 'Only the groups this campaign (a list_campaigns id) is in.'
|
|
1458
|
+
}
|
|
1459
|
+
},
|
|
1460
|
+
additionalProperties: false
|
|
1461
|
+
},
|
|
1462
|
+
toRequest: (a) => ({
|
|
1463
|
+
method: 'GET',
|
|
1464
|
+
path: '/campaign-groups',
|
|
1465
|
+
query: { broadcastId: a.broadcastId }
|
|
1466
|
+
})
|
|
1467
|
+
},
|
|
1468
|
+
{
|
|
1469
|
+
name: 'get_campaign_group',
|
|
1470
|
+
description: 'One campaign group: its member campaigns (status, channel, schedule and each funnel, refreshed when stale) and their combined funnel. Campaigns deleted since they were filed are left out.',
|
|
1471
|
+
scope: 'campaigns:read',
|
|
1472
|
+
method: 'GET',
|
|
1473
|
+
path: '/campaign-groups/:id',
|
|
1474
|
+
inputSchema: {
|
|
1475
|
+
type: 'object',
|
|
1476
|
+
properties: { id: { type: 'string' } },
|
|
1477
|
+
required: ['id'],
|
|
1478
|
+
additionalProperties: false
|
|
1479
|
+
},
|
|
1480
|
+
toRequest: (a) => ({
|
|
1481
|
+
method: 'GET',
|
|
1482
|
+
path: `/campaign-groups/${encodeURIComponent(a.id)}`
|
|
1483
|
+
})
|
|
1484
|
+
},
|
|
1485
|
+
{
|
|
1486
|
+
name: 'create_campaign_group',
|
|
1487
|
+
description: 'Create a campaign group, optionally filing campaigns (list_campaigns ids) in it at once. Names are unique per org, ignoring case and spacing. A group never changes who a campaign reaches or when it sends; a campaign may be in several groups.',
|
|
1488
|
+
scope: 'campaigns:write',
|
|
1489
|
+
method: 'POST',
|
|
1490
|
+
path: '/campaign-groups',
|
|
1491
|
+
successStatus: 201,
|
|
1492
|
+
inputSchema: {
|
|
1493
|
+
type: 'object',
|
|
1494
|
+
properties: {
|
|
1495
|
+
name: { type: 'string', minLength: 1, maxLength: 120 },
|
|
1496
|
+
description: { type: 'string', maxLength: 500 },
|
|
1497
|
+
broadcastIds: {
|
|
1498
|
+
type: 'array',
|
|
1499
|
+
items: { type: 'string' },
|
|
1500
|
+
maxItems: 500,
|
|
1501
|
+
description: 'Campaigns (list_campaigns ids) to start the group with.'
|
|
1502
|
+
}
|
|
1503
|
+
},
|
|
1504
|
+
required: ['name'],
|
|
1505
|
+
additionalProperties: false
|
|
1506
|
+
},
|
|
1507
|
+
toRequest: (a) => ({
|
|
1508
|
+
method: 'POST',
|
|
1509
|
+
path: '/campaign-groups',
|
|
1510
|
+
body: {
|
|
1511
|
+
name: a.name,
|
|
1512
|
+
description: a.description,
|
|
1513
|
+
broadcastIds: a.broadcastIds
|
|
1514
|
+
}
|
|
1515
|
+
})
|
|
1516
|
+
},
|
|
1517
|
+
{
|
|
1518
|
+
name: 'update_campaign_group',
|
|
1519
|
+
description: "Rename a campaign group or change its description (null clears it). Only the fields you pass change; use add_campaigns_to_group / remove_campaigns_from_group to change its campaigns.",
|
|
1520
|
+
scope: 'campaigns:write',
|
|
1521
|
+
method: 'PATCH',
|
|
1522
|
+
path: '/campaign-groups/:id',
|
|
1523
|
+
inputSchema: {
|
|
1524
|
+
type: 'object',
|
|
1525
|
+
properties: {
|
|
1526
|
+
id: { type: 'string' },
|
|
1527
|
+
name: { type: 'string', minLength: 1, maxLength: 120 },
|
|
1528
|
+
description: { type: ['string', 'null'], maxLength: 500 }
|
|
1529
|
+
},
|
|
1530
|
+
required: ['id'],
|
|
1531
|
+
additionalProperties: false
|
|
1532
|
+
},
|
|
1533
|
+
toRequest: (a) => ({
|
|
1534
|
+
method: 'PATCH',
|
|
1535
|
+
path: `/campaign-groups/${encodeURIComponent(a.id)}`,
|
|
1536
|
+
body: { name: a.name, description: a.description }
|
|
1537
|
+
})
|
|
1538
|
+
},
|
|
1539
|
+
{
|
|
1540
|
+
name: 'delete_campaign_group',
|
|
1541
|
+
description: 'Delete a campaign group. Only the group goes: its campaigns, their recipients and their results are untouched.',
|
|
1542
|
+
scope: 'campaigns:write',
|
|
1543
|
+
method: 'DELETE',
|
|
1544
|
+
path: '/campaign-groups/:id',
|
|
1545
|
+
inputSchema: {
|
|
1546
|
+
type: 'object',
|
|
1547
|
+
properties: { id: { type: 'string' } },
|
|
1548
|
+
required: ['id'],
|
|
1549
|
+
additionalProperties: false
|
|
1550
|
+
},
|
|
1551
|
+
toRequest: (a) => ({
|
|
1552
|
+
method: 'DELETE',
|
|
1553
|
+
path: `/campaign-groups/${encodeURIComponent(a.id)}`
|
|
1554
|
+
})
|
|
1555
|
+
},
|
|
1556
|
+
{
|
|
1557
|
+
name: 'add_campaigns_to_group',
|
|
1558
|
+
description: 'File campaigns (list_campaigns ids) in a campaign group. Idempotent: a campaign already in the group stays where it is. Returns the group with its campaigns.',
|
|
1559
|
+
scope: 'campaigns:write',
|
|
1560
|
+
method: 'POST',
|
|
1561
|
+
path: '/campaign-groups/:id/campaigns',
|
|
1562
|
+
inputSchema: {
|
|
1563
|
+
type: 'object',
|
|
1564
|
+
properties: {
|
|
1565
|
+
id: { type: 'string' },
|
|
1566
|
+
broadcastIds: {
|
|
1567
|
+
type: 'array',
|
|
1568
|
+
items: { type: 'string' },
|
|
1569
|
+
minItems: 1,
|
|
1570
|
+
maxItems: 500
|
|
1571
|
+
}
|
|
1572
|
+
},
|
|
1573
|
+
required: ['id', 'broadcastIds'],
|
|
1574
|
+
additionalProperties: false
|
|
1575
|
+
},
|
|
1576
|
+
toRequest: (a) => ({
|
|
1577
|
+
method: 'POST',
|
|
1578
|
+
path: `/campaign-groups/${encodeURIComponent(a.id)}/campaigns`,
|
|
1579
|
+
body: { broadcastIds: a.broadcastIds }
|
|
1580
|
+
})
|
|
1581
|
+
},
|
|
1582
|
+
{
|
|
1583
|
+
name: 'remove_campaigns_from_group',
|
|
1584
|
+
description: 'Take campaigns out of a campaign group. The campaigns themselves are untouched; ids not in the group are ignored. Returns the group with its campaigns.',
|
|
1585
|
+
scope: 'campaigns:write',
|
|
1586
|
+
method: 'POST',
|
|
1587
|
+
path: '/campaign-groups/:id/campaigns/remove',
|
|
1588
|
+
inputSchema: {
|
|
1589
|
+
type: 'object',
|
|
1590
|
+
properties: {
|
|
1591
|
+
id: { type: 'string' },
|
|
1592
|
+
broadcastIds: {
|
|
1593
|
+
type: 'array',
|
|
1594
|
+
items: { type: 'string' },
|
|
1595
|
+
minItems: 1,
|
|
1596
|
+
maxItems: 500
|
|
1597
|
+
}
|
|
1598
|
+
},
|
|
1599
|
+
required: ['id', 'broadcastIds'],
|
|
1600
|
+
additionalProperties: false
|
|
1601
|
+
},
|
|
1602
|
+
toRequest: (a) => ({
|
|
1603
|
+
method: 'POST',
|
|
1604
|
+
path: `/campaign-groups/${encodeURIComponent(a.id)}/campaigns/remove`,
|
|
1605
|
+
body: { broadcastIds: a.broadcastIds }
|
|
1606
|
+
})
|
|
1296
1607
|
}
|
|
1297
1608
|
];
|
|
1298
1609
|
/** Look up a tool by name. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rcs-campaigns/agent-toolkit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"mcpName": "com.rcs-campaigns/campaigns",
|
|
5
5
|
"description": "Agent skins for the RCS Campaigns gateway: an MCP server (rcs-mcp / wa-mcp) and a CLI (rcs / wa) over one shared client.",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"scripts": {
|
|
64
64
|
"build": "tsc",
|
|
65
65
|
"dev": "tsc --watch",
|
|
66
|
-
"typecheck": "tsc --noEmit",
|
|
66
|
+
"typecheck": "tsc --noEmit --incremental --tsBuildInfoFile node_modules/.cache/tsc/typecheck.tsbuildinfo",
|
|
67
67
|
"test": "vitest run",
|
|
68
68
|
"test:watch": "vitest"
|
|
69
69
|
}
|