@carrierllc/mcp 0.2.6 → 0.2.8

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.
File without changes
package/dist/index.js CHANGED
@@ -438,9 +438,10 @@ function registerAllTools(server2, ctx) {
438
438
  "esim_status_per_account",
439
439
  {
440
440
  title: "eSIM Status Per Account",
441
- description: "Use this to get eSIM status counts broken down by account: active, suspended, inventory (not yet activated), and other states. Good for fleet health dashboards and capacity planning. Params: `accountId` (integer, optional \u2014 omit for all accounts under the reseller). Returns: array of per-account objects with `accountId`, `active`, `suspended`, `inventory`, `other`. Do NOT use this to check a single subscriber's status \u2014 use `get_subscriber` for that. Do NOT use this for billing or balance checks \u2014 use `list_reseller_accounts` for balances.",
441
+ description: "Use this to get eSIM status counts broken down by account: active, suspended, inventory (not yet activated), and other states. Good for fleet health dashboards and capacity planning. OCS requires either `accountId` OR `resellerId`. If both omitted, the token owner's reseller is resolved automatically. Params: `accountId` (integer, optional \u2014 for a single account), `resellerId` (integer, optional \u2014 for all accounts under a specific reseller). Returns: array of per-account objects with `accountId`, `active`, `suspended`, `inventory`, `other`. Do NOT use this to check a single subscriber's status \u2014 use `get_subscriber` for that. Do NOT use this for billing or balance checks \u2014 use `list_reseller_accounts` for balances.",
442
442
  inputSchema: {
443
- accountId: z.number().optional().describe("Filter to a specific account")
443
+ accountId: z.number().optional().describe("Filter to a specific account"),
444
+ resellerId: z.number().optional().describe("Reseller ID (omit to use the token owner's reseller)")
444
445
  },
445
446
  annotations: { readOnlyHint: true }
446
447
  },
@@ -449,9 +450,13 @@ function registerAllTools(server2, ctx) {
449
450
  "esimStatusPerAccount",
450
451
  TOOL_SCOPES["esim_status_per_account"],
451
452
  ctx,
452
- async ({ accountId }, token2) => {
453
+ async ({ accountId, resellerId }, token2) => {
453
454
  const params = {};
454
- if (accountId !== void 0) params.accountId = accountId;
455
+ if (accountId !== void 0) {
456
+ params.accountId = accountId;
457
+ } else {
458
+ params.resellerId = resellerId ?? await getDefaultResellerId(ctx.env, token2);
459
+ }
455
460
  return ocsCall(ctx.env, token2, "esimStatusPerAccount", params);
456
461
  }
457
462
  )
@@ -3128,9 +3133,20 @@ function registerIntelligenceTools(server2, ctx) {
3128
3133
  annotations: { readOnlyHint: true }
3129
3134
  }, async ({ accountId }) => {
3130
3135
  const token2 = await ctx.getUserToken(ctx.props.sub);
3136
+ const resellerId = await getDefaultResellerId(ctx.env, token2).catch(() => void 0);
3131
3137
  const [statusResult, accountsResult] = await Promise.all([
3132
- safeCall(ctx.env, token2, "esimStatusPerAccount", accountId !== void 0 ? { accountId } : {}),
3133
- safeCall(ctx.env, token2, "listResellerAccount", {})
3138
+ safeCall(
3139
+ ctx.env,
3140
+ token2,
3141
+ "esimStatusPerAccount",
3142
+ accountId !== void 0 ? { accountId } : resellerId !== void 0 ? { resellerId } : {}
3143
+ ),
3144
+ safeCall(
3145
+ ctx.env,
3146
+ token2,
3147
+ "listResellerAccount",
3148
+ resellerId !== void 0 ? { resellerId } : {}
3149
+ )
3134
3150
  ]);
3135
3151
  const sections = ["# Fleet Health Dashboard\n"];
3136
3152
  let totalActive = 0, totalSuspended = 0, totalInventory = 0, totalOther = 0;