@carrierllc/mcp 0.13.9 → 0.13.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 CHANGED
@@ -39,7 +39,7 @@ import {
39
39
  verifyStorefront,
40
40
  walletScreen,
41
41
  which
42
- } from "./chunk-DF2PGR5H.js";
42
+ } from "./chunk-ZLPXWOYO.js";
43
43
  import {
44
44
  copyTree,
45
45
  exists,
package/dist/index.js CHANGED
@@ -19,6 +19,7 @@ import {
19
19
  extractDailyUsage,
20
20
  extractEsimStatusCounts,
21
21
  extractResellerBalance,
22
+ extractSimProviderStatus,
22
23
  extractSubscriberStatus,
23
24
  filterActiveSubscribers,
24
25
  fleetScreen,
@@ -37,6 +38,7 @@ import {
37
38
  locationZoneCreateParams,
38
39
  mccToIso,
39
40
  mergeEnvLocal,
41
+ modifySubscriberStatusParams,
40
42
  networkEventRows,
41
43
  networkEventsOverPeriodParams,
42
44
  ocsHlrBitrate,
@@ -69,7 +71,7 @@ import {
69
71
  usageOverPeriodParams,
70
72
  verifyStorefront,
71
73
  withOcsListSummary
72
- } from "./chunk-DF2PGR5H.js";
74
+ } from "./chunk-ZLPXWOYO.js";
73
75
  import "./chunk-SHKKVIIA.js";
74
76
 
75
77
  // src/index.ts
@@ -1200,7 +1202,7 @@ var DESTRUCTIVE_TOOLS = /* @__PURE__ */ new Set([
1200
1202
  // S6 live-smoke gap fill (CAR-105)
1201
1203
  "change_network_profile_of_location_zone"
1202
1204
  ]);
1203
- function wrapHandler(toolName, ocsMethod, requiredScope, ctx, handler) {
1205
+ function wrapHandler(toolName, ocsMethod, requiredScope, ctx, handler, options) {
1204
1206
  return async (args) => {
1205
1207
  const start = Date.now();
1206
1208
  const isDryRun = args.dry_run === true;
@@ -1253,11 +1255,12 @@ function wrapHandler(toolName, ocsMethod, requiredScope, ctx, handler) {
1253
1255
  dry_run: true,
1254
1256
  duration_ms: 0
1255
1257
  });
1258
+ const preview = options?.dryRunPayload ? options.dryRunPayload(args) : args;
1256
1259
  return {
1257
1260
  content: [
1258
1261
  {
1259
1262
  type: "text",
1260
- text: `[dry_run=true] Would execute '${toolName}' (OCS method '${ocsMethod}') with args: ${JSON.stringify(args)}. No changes made.`
1263
+ text: `[dry_run=true] Would execute '${toolName}' (OCS method '${ocsMethod}') with args: ${JSON.stringify(preview)}. No changes made.`
1261
1264
  }
1262
1265
  ]
1263
1266
  };
@@ -1458,7 +1461,7 @@ function registerAllTools(server2, ctx) {
1458
1461
  "list_steering_lists",
1459
1462
  {
1460
1463
  title: "List Steering Lists",
1461
- description: "Use this to retrieve all network steering lists configured for this reseller. A steering list is a named configuration of excluded and priority mobile operators that controls which networks an eSIM prefers to roam onto \u2014 the primary mechanism for network quality optimisation and cost control. Call this before `modify_subscriber_steering_list` to obtain valid steering list IDs. Params: `resellerId` (integer, optional \u2014 omit to use the token owner's reseller). Returns: array of steering list records with `steeringListId`, `name`, and configured operators. Do NOT use this to assign a steering list to a subscriber \u2014 use `modify_subscriber_steering_list`. Do NOT use this to push a steering change to a device \u2014 use `push_steering_to_subscriber` after assignment.",
1464
+ description: "Use this to retrieve all network steering lists configured for this reseller. A steering list is a named configuration of excluded and priority mobile operators that controls which networks an eSIM prefers to roam onto \u2014 the primary mechanism for network quality optimisation and cost control. Call this before `modify_subscriber_steering_list` to obtain valid steering list IDs. Params: `resellerId` (integer, optional \u2014 omit to use the token owner's reseller). Returns: an array of steering list records with `steeringListId`, `name`, and configured operators. An empty catalog is `[]`. When OCS answers a successful list with null, that null is this empty array, not an error. Do NOT use this to assign a steering list to a subscriber \u2014 use `modify_subscriber_steering_list`. Do NOT use this to push a steering change to a device \u2014 use `push_steering_to_subscriber` after assignment.",
1462
1465
  inputSchema: {
1463
1466
  resellerId: z.number().optional().describe("Reseller ID (omit to use token owner's reseller)")
1464
1467
  },
@@ -1576,7 +1579,7 @@ function registerAllTools(server2, ctx) {
1576
1579
  "modify_subscriber_status",
1577
1580
  {
1578
1581
  title: "Modify Subscriber Status",
1579
- description: "Use this to change the OCS lifecycle status of a subscriber. Common transitions: ACTIVE \u2192 SUSPENDED (pause without losing packages), SUSPENDED \u2192 ACTIVE (reactivate), ACTIVE/SUSPENDED \u2192 TERMINATED (irreversible). WARNING: TERMINATED status is permanent \u2014 the subscriber record cannot be reactivated. \u26A0 Setting status to END_OF_LIFE is irreversible. The subscriber becomes read-only (OCS error 17 on subsequent mutations). Confirm before calling. Params: `iccid` (subscriber identifier), `status` (new status string, e.g. 'ACTIVE', 'SUSPENDED', 'TERMINATED', 'END_OF_LIFE'). Returns: updated subscriber record with the new status. Do NOT use this to disable the SIM card at the network level \u2014 use `change_sim_status` for that. Always call `get_subscriber` first to confirm current status before modifying.",
1582
+ description: "Use this to change the OCS lifecycle status of a subscriber. Common transitions: ACTIVE \u2192 SUSPENDED (pause without losing packages), SUSPENDED \u2192 ACTIVE (reactivate), ACTIVE/SUSPENDED \u2192 TERMINATED (irreversible). WARNING: TERMINATED status is permanent \u2014 the subscriber record cannot be reactivated. \u26A0 Setting status to END_OF_LIFE is irreversible. The subscriber becomes read-only (OCS error 17 on subsequent mutations). Confirm before calling. Params: `iccid` (subscriber identifier), `status` (new status string, e.g. 'ACTIVE', 'SUSPENDED', 'TERMINATED', 'END_OF_LIFE'). OCS receives `{ subscriber: { iccid }, newStatus }`. `subscriber` is a SubscriberId object, never a bare ICCID string. Returns: updated subscriber record with the new status. Do NOT use this to disable the SIM card at the network level \u2014 use `change_sim_status` for that. Always call `get_subscriber` first to confirm current status before modifying.",
1580
1583
  inputSchema: {
1581
1584
  iccid: z.string().describe("The subscriber ICCID"),
1582
1585
  status: z.string().describe("New status value"),
@@ -1589,10 +1592,15 @@ function registerAllTools(server2, ctx) {
1589
1592
  "modifySubscriberStatus",
1590
1593
  TOOL_SCOPES["modify_subscriber_status"],
1591
1594
  ctx,
1592
- async ({ iccid, status }, token2) => ocsCall(ctx.env, token2, "modifySubscriberStatus", {
1593
- subscriber: iccid,
1594
- newStatus: status
1595
- })
1595
+ async ({ iccid, status }, token2) => ocsCall(
1596
+ ctx.env,
1597
+ token2,
1598
+ "modifySubscriberStatus",
1599
+ modifySubscriberStatusParams(iccid, status)
1600
+ ),
1601
+ {
1602
+ dryRunPayload: ({ iccid, status }) => modifySubscriberStatusParams(iccid, status)
1603
+ }
1596
1604
  )
1597
1605
  );
1598
1606
  server2.registerTool(
@@ -1640,7 +1648,7 @@ function registerAllTools(server2, ctx) {
1640
1648
  "get_sim_provider_status",
1641
1649
  {
1642
1650
  title: "Get SIM Provider Status",
1643
- description: "Use this to check the physical SIM/eSIM card status at the SIM provider level (ENABLED, DISABLED, DELETED) \u2014 distinct from the OCS subscriber status. Useful when `get_subscriber` shows ACTIVE but connectivity is broken; the SIM may be DISABLED at the provider level. Internally resolves ICCID \u2192 numeric simId. Params: `iccid` (subscriber identifier). Returns: provider status object with `simStatus`, `activationDate`, `lastStatusChange`. Do NOT use this to change the SIM status \u2014 use `change_sim_status` for that.",
1651
+ description: "Use this to check the physical SIM/eSIM card status at the SIM provider level (ENABLED, DISABLED, DELETED) \u2014 distinct from the OCS subscriber status. Useful when `get_subscriber` shows ACTIVE but connectivity is broken; the SIM may be DISABLED at the provider level. Internally resolves ICCID \u2192 numeric simId. Params: `iccid` (subscriber identifier). Returns: an array of provider status periods. Each entry has `status`, `start`, `end`, `profileType`, and `statusModification`. Do NOT use this to change the SIM status \u2014 use `change_sim_status` for that.",
1644
1652
  inputSchema: {
1645
1653
  iccid: z.string().describe("The subscriber ICCID")
1646
1654
  },
@@ -2042,7 +2050,7 @@ function registerAllTools(server2, ctx) {
2042
2050
  "modify_package_status",
2043
2051
  {
2044
2052
  title: "Modify Package Status",
2045
- description: "Use this to activate or deactivate a specific prepaid package on a subscriber without removing it. A deactivated package retains its allowances and can be reactivated later. Params: `iccid` (subscriber identifier), `packageId` (integer from `list_subscriber_packages`), `status` (new package status string, e.g. 'ACTIVE', 'INACTIVE'). Returns: updated package record with the new status. Do NOT use this to delete a package \u2014 use `delete_subscriber_package` for permanent removal. Do NOT use this to change the subscriber's overall account status \u2014 use `modify_subscriber_status`.",
2053
+ description: "Use this to activate or deactivate a specific prepaid package on a subscriber without removing it. A deactivated package retains its allowances and can be reactivated later. Params: `iccid` (subscriber identifier), `packageId` (integer from `list_subscriber_packages`), `status` (new package status string, e.g. 'ACTIVE', 'INACTIVE'). Returns: confirmation `{ updated: true, subsPrepaidPackageId, active, status }` where `status` is `ACTIVE` or `INACTIVE`. OCS accepts the write and returns no package body, so a null response is this confirmation rather than a missing record. Do NOT use this to delete a package \u2014 use `delete_subscriber_package` for permanent removal. Do NOT use this to change the subscriber's overall account status \u2014 use `modify_subscriber_status`.",
2046
2054
  inputSchema: {
2047
2055
  iccid: z.string().describe("The subscriber ICCID"),
2048
2056
  packageId: z.number().describe("The active package ID"),
@@ -3756,7 +3764,7 @@ function registerIntelligenceTools(server2, ctx) {
3756
3764
  const simId = subscriberSimId(sub.data);
3757
3765
  const sim = simId !== void 0 ? await safeCall(ctx.env, token2, "getSimProviderStatus", simId) : { data: null, error: null };
3758
3766
  if (sim.data) {
3759
- const simStatus = String(sim.data.simStatus ?? sim.data.status ?? "").toUpperCase();
3767
+ const simStatus = (extractSimProviderStatus(sim.data) ?? "").toUpperCase();
3760
3768
  if (simStatus && !["ENABLED", "ACTIVE", "ACTIVATED"].includes(simStatus)) {
3761
3769
  findings.push(`SIM provider status is ${simStatus} \u2014 SIM may be disabled at network level`);
3762
3770
  actions.push(`Enable SIM via change_sim_status`);