@carrierllc/mcp 0.13.61 → 0.13.62
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/index.js
CHANGED
|
@@ -82,7 +82,7 @@ import {
|
|
|
82
82
|
verifyStorefront,
|
|
83
83
|
withOcsListSummary,
|
|
84
84
|
withTemplateResellerId
|
|
85
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-SZR42TUZ.js";
|
|
86
86
|
import "./chunk-SHKKVIIA.js";
|
|
87
87
|
|
|
88
88
|
// src/index.ts
|
|
@@ -6189,7 +6189,12 @@ var CARRIER_API_TOOL_SCOPES = {
|
|
|
6189
6189
|
list_connectivity_offering_templates: "read",
|
|
6190
6190
|
create_benefit_campaign: "write",
|
|
6191
6191
|
claim_benefit: "write",
|
|
6192
|
-
issue_benefit_claim: "write"
|
|
6192
|
+
issue_benefit_claim: "write",
|
|
6193
|
+
set_benefit_campaign_status: "write",
|
|
6194
|
+
create_benefit_entitlement: "write",
|
|
6195
|
+
reconcile_benefit_claim: "write",
|
|
6196
|
+
record_experiment_event: "write",
|
|
6197
|
+
experiment_report: "read"
|
|
6193
6198
|
};
|
|
6194
6199
|
var CAMPAIGN_ID_PATTERN = /^cbc_[0-9a-f]{32}$/;
|
|
6195
6200
|
var CLAIM_ID_PATTERN = /^cbl_[0-9a-f]{32}$/;
|
|
@@ -6369,6 +6374,151 @@ function registerCarrierApiTools(server2, ctx) {
|
|
|
6369
6374
|
{ skipUserToken: true }
|
|
6370
6375
|
)
|
|
6371
6376
|
);
|
|
6377
|
+
server2.registerTool(
|
|
6378
|
+
"set_benefit_campaign_status",
|
|
6379
|
+
{
|
|
6380
|
+
title: "Pause or resume a benefit campaign",
|
|
6381
|
+
description: "Pause a campaign so it accepts no new claims, or resume it. Calls POST /v1/connectivity/benefit-campaigns/{id}/status on api.carrier.llc with your own MCP access token. Needs write scope. Pausing blocks NEW claims; it does not release holds that were already made. Params: campaign_id (cbc_ plus 32 hex), status (active or paused).",
|
|
6382
|
+
inputSchema: {
|
|
6383
|
+
campaign_id: z6.string().regex(CAMPAIGN_ID_PATTERN).describe("Campaign id, cbc_ followed by 32 hex characters."),
|
|
6384
|
+
status: z6.enum(["active", "paused"]).describe("The status to set.")
|
|
6385
|
+
},
|
|
6386
|
+
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true }
|
|
6387
|
+
},
|
|
6388
|
+
wrapHandler(
|
|
6389
|
+
"set_benefit_campaign_status",
|
|
6390
|
+
"carrier-api.benefit-campaigns.status",
|
|
6391
|
+
"write",
|
|
6392
|
+
ctx,
|
|
6393
|
+
(args, _token, extra) => {
|
|
6394
|
+
if (typeof args.campaign_id !== "string" || !CAMPAIGN_ID_PATTERN.test(args.campaign_id)) return Promise.resolve(idPathError("campaign_id"));
|
|
6395
|
+
return carrierApiRequest(ctx, extra, {
|
|
6396
|
+
method: "POST",
|
|
6397
|
+
path: `/v1/connectivity/benefit-campaigns/${args.campaign_id}/status`,
|
|
6398
|
+
body: { status: args.status }
|
|
6399
|
+
});
|
|
6400
|
+
},
|
|
6401
|
+
{ skipUserToken: true }
|
|
6402
|
+
)
|
|
6403
|
+
);
|
|
6404
|
+
server2.registerTool(
|
|
6405
|
+
"create_benefit_entitlement",
|
|
6406
|
+
{
|
|
6407
|
+
title: "Issue a claim right for a booking reference",
|
|
6408
|
+
description: "Issue ONE single-use right for one external booking or member reference, which the claimant presents to claim a benefit. Calls POST /v1/connectivity/benefit-campaigns/{id}/entitlements on api.carrier.llc with your own MCP access token. Needs write scope. The token is returned once and is never stored in plain text; a second right for the same reference is refused. Params: campaign_id (cbc_ plus 32 hex), external_ref (1 to 200 characters), ttl_ms (optional lifetime in milliseconds).",
|
|
6409
|
+
inputSchema: {
|
|
6410
|
+
campaign_id: z6.string().regex(CAMPAIGN_ID_PATTERN).describe("Campaign id, cbc_ followed by 32 hex characters."),
|
|
6411
|
+
external_ref: z6.string().min(1).max(200).describe("Your own reference for the person, 1 to 200 characters."),
|
|
6412
|
+
ttl_ms: z6.number().int().min(1).max(Number.MAX_SAFE_INTEGER).optional().describe("Lifetime of the right in milliseconds. Defaults to 30 days.")
|
|
6413
|
+
},
|
|
6414
|
+
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true }
|
|
6415
|
+
},
|
|
6416
|
+
wrapHandler(
|
|
6417
|
+
"create_benefit_entitlement",
|
|
6418
|
+
"carrier-api.benefit-entitlements.create",
|
|
6419
|
+
"write",
|
|
6420
|
+
ctx,
|
|
6421
|
+
(args, _token, extra) => {
|
|
6422
|
+
if (typeof args.campaign_id !== "string" || !CAMPAIGN_ID_PATTERN.test(args.campaign_id)) return Promise.resolve(idPathError("campaign_id"));
|
|
6423
|
+
return carrierApiRequest(ctx, extra, {
|
|
6424
|
+
method: "POST",
|
|
6425
|
+
path: `/v1/connectivity/benefit-campaigns/${args.campaign_id}/entitlements`,
|
|
6426
|
+
body: {
|
|
6427
|
+
external_ref: args.external_ref,
|
|
6428
|
+
...args.ttl_ms !== void 0 ? { ttl_ms: args.ttl_ms } : {}
|
|
6429
|
+
}
|
|
6430
|
+
});
|
|
6431
|
+
},
|
|
6432
|
+
{ skipUserToken: true }
|
|
6433
|
+
)
|
|
6434
|
+
);
|
|
6435
|
+
server2.registerTool(
|
|
6436
|
+
"reconcile_benefit_claim",
|
|
6437
|
+
{
|
|
6438
|
+
title: "Close a claim whose issuance outcome is unknown",
|
|
6439
|
+
description: "Ask the provider what happened to a claim whose issuance ended in an unknown outcome. Calls POST /v1/connectivity/benefit-campaigns/{id}/claims/{claimId}/reconcile on api.carrier.llc with your own MCP access token. Needs write scope. It never dispatches a second eSIM: it reads the existing issuance under the same claim id. Results: 200 the claim is closed, 202 the outcome is still unknown (call again later), 409 the claim never started issuing or is not held. Params: campaign_id (cbc_ plus 32 hex), claim_id (cbl_ plus 32 hex).",
|
|
6440
|
+
inputSchema: {
|
|
6441
|
+
campaign_id: z6.string().regex(CAMPAIGN_ID_PATTERN).describe("Campaign id, cbc_ followed by 32 hex characters."),
|
|
6442
|
+
claim_id: z6.string().regex(CLAIM_ID_PATTERN).describe("Claim id, cbl_ followed by 32 hex characters.")
|
|
6443
|
+
},
|
|
6444
|
+
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true }
|
|
6445
|
+
},
|
|
6446
|
+
wrapHandler(
|
|
6447
|
+
"reconcile_benefit_claim",
|
|
6448
|
+
"carrier-api.benefit-claims.reconcile",
|
|
6449
|
+
"write",
|
|
6450
|
+
ctx,
|
|
6451
|
+
(args, _token, extra) => {
|
|
6452
|
+
if (typeof args.campaign_id !== "string" || !CAMPAIGN_ID_PATTERN.test(args.campaign_id)) return Promise.resolve(idPathError("campaign_id"));
|
|
6453
|
+
if (typeof args.claim_id !== "string" || !CLAIM_ID_PATTERN.test(args.claim_id)) return Promise.resolve(idPathError("claim_id"));
|
|
6454
|
+
return carrierApiRequest(ctx, extra, {
|
|
6455
|
+
method: "POST",
|
|
6456
|
+
path: `/v1/connectivity/benefit-campaigns/${args.campaign_id}/claims/${args.claim_id}/reconcile`
|
|
6457
|
+
});
|
|
6458
|
+
},
|
|
6459
|
+
{ skipUserToken: true }
|
|
6460
|
+
)
|
|
6461
|
+
);
|
|
6462
|
+
server2.registerTool(
|
|
6463
|
+
"record_experiment_event",
|
|
6464
|
+
{
|
|
6465
|
+
title: "Record one experiment event",
|
|
6466
|
+
description: "Record ONE event of an experiment: what a participant saw or did. Calls POST /v1/connectivity/experiment-events on api.carrier.llc with your own MCP access token. Needs write scope. Safe to repeat with the same event_id: the event is stored once and the replay returns 200. Params: event_id (your own id for this event), experiment_id, revision (>=1), link (the participant), measure (viewed, confirmed, issued or first_data).",
|
|
6467
|
+
inputSchema: {
|
|
6468
|
+
event_id: z6.string().min(1).max(200).describe("Your own id for this event."),
|
|
6469
|
+
experiment_id: z6.string().min(1).max(200).describe("The experiment this event belongs to."),
|
|
6470
|
+
revision: z6.number().int().min(1).max(Number.MAX_SAFE_INTEGER).describe("The revision of the experiment."),
|
|
6471
|
+
link: z6.string().min(1).max(200).describe("The participant this event is about."),
|
|
6472
|
+
measure: z6.enum(["viewed", "confirmed", "issued", "first_data"]).describe("What the participant did.")
|
|
6473
|
+
},
|
|
6474
|
+
annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true }
|
|
6475
|
+
},
|
|
6476
|
+
wrapHandler(
|
|
6477
|
+
"record_experiment_event",
|
|
6478
|
+
"carrier-api.experiment-events.create",
|
|
6479
|
+
"write",
|
|
6480
|
+
ctx,
|
|
6481
|
+
(args, _token, extra) => carrierApiRequest(ctx, extra, {
|
|
6482
|
+
method: "POST",
|
|
6483
|
+
path: "/v1/connectivity/experiment-events",
|
|
6484
|
+
body: {
|
|
6485
|
+
event_id: args.event_id,
|
|
6486
|
+
experiment_id: args.experiment_id,
|
|
6487
|
+
revision: args.revision,
|
|
6488
|
+
link: args.link,
|
|
6489
|
+
measure: args.measure
|
|
6490
|
+
}
|
|
6491
|
+
}),
|
|
6492
|
+
{ skipUserToken: true }
|
|
6493
|
+
)
|
|
6494
|
+
);
|
|
6495
|
+
server2.registerTool(
|
|
6496
|
+
"experiment_report",
|
|
6497
|
+
{
|
|
6498
|
+
title: "Counts for one experiment",
|
|
6499
|
+
description: "Count the events of one experiment per measure inside a time window. Calls GET /v1/connectivity/experiment-events/{experimentId}/report on api.carrier.llc with your own MCP access token. Needs read scope. The counts describe what happened; they do not say why. A measure without events is absent, never zero. Params: experiment_id, from and to (epoch milliseconds, to is exclusive).",
|
|
6500
|
+
inputSchema: {
|
|
6501
|
+
experiment_id: z6.string().min(1).max(200).describe("The experiment to report on."),
|
|
6502
|
+
from: z6.number().int().min(0).max(Number.MAX_SAFE_INTEGER).describe("Start of the window, epoch milliseconds."),
|
|
6503
|
+
to: z6.number().int().min(0).max(Number.MAX_SAFE_INTEGER).describe("End of the window, epoch milliseconds, exclusive.")
|
|
6504
|
+
},
|
|
6505
|
+
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true }
|
|
6506
|
+
},
|
|
6507
|
+
wrapHandler(
|
|
6508
|
+
"experiment_report",
|
|
6509
|
+
"carrier-api.experiment-events.report",
|
|
6510
|
+
"read",
|
|
6511
|
+
ctx,
|
|
6512
|
+
(args, _token, extra) => {
|
|
6513
|
+
const q = `from=${encodeURIComponent(String(args.from))}&to=${encodeURIComponent(String(args.to))}`;
|
|
6514
|
+
return carrierApiRequest(ctx, extra, {
|
|
6515
|
+
method: "GET",
|
|
6516
|
+
path: `/v1/connectivity/experiment-events/${encodeURIComponent(args.experiment_id)}/report?${q}`
|
|
6517
|
+
});
|
|
6518
|
+
},
|
|
6519
|
+
{ skipUserToken: true }
|
|
6520
|
+
)
|
|
6521
|
+
);
|
|
6372
6522
|
}
|
|
6373
6523
|
|
|
6374
6524
|
// src/tools-ui-agent-schedule.ts
|