@flexprice/mcp-server 2.0.1 → 2.0.3

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.
Files changed (119) hide show
  1. package/bin/mcp-server.js +374 -203
  2. package/bin/mcp-server.js.map +26 -22
  3. package/bun.lock +25 -25
  4. package/esm/funcs/invoicesRecalculateInvoice.d.ts +2 -2
  5. package/esm/funcs/invoicesRecalculateInvoice.js +3 -7
  6. package/esm/funcs/invoicesRecalculateInvoice.js.map +1 -1
  7. package/esm/funcs/invoicesRecalculateInvoiceV2.d.ts +16 -0
  8. package/esm/funcs/invoicesRecalculateInvoiceV2.d.ts.map +1 -0
  9. package/esm/funcs/invoicesRecalculateInvoiceV2.js +91 -0
  10. package/esm/funcs/invoicesRecalculateInvoiceV2.js.map +1 -0
  11. package/esm/landing-page.js +9 -9
  12. package/esm/landing-page.js.map +1 -1
  13. package/esm/lib/config.d.ts +6 -6
  14. package/esm/lib/config.d.ts.map +1 -1
  15. package/esm/lib/config.js +11 -4
  16. package/esm/lib/config.js.map +1 -1
  17. package/esm/lib/sdks.d.ts +1 -1
  18. package/esm/lib/sdks.d.ts.map +1 -1
  19. package/esm/lib/sdks.js +1 -1
  20. package/esm/lib/sdks.js.map +1 -1
  21. package/esm/mcp-server/cli/serve/command.js +1 -1
  22. package/esm/mcp-server/cli/serve/command.js.map +1 -1
  23. package/esm/mcp-server/cli/start/command.js +1 -1
  24. package/esm/mcp-server/cli/start/command.js.map +1 -1
  25. package/esm/mcp-server/flags.d.ts +1 -1
  26. package/esm/mcp-server/flags.d.ts.map +1 -1
  27. package/esm/mcp-server/mcp-server.js +1 -1
  28. package/esm/mcp-server/server.d.ts +1 -1
  29. package/esm/mcp-server/server.d.ts.map +1 -1
  30. package/esm/mcp-server/server.js +3 -1
  31. package/esm/mcp-server/server.js.map +1 -1
  32. package/esm/mcp-server/tools/invoicesRecalculateInvoice.js +2 -2
  33. package/esm/mcp-server/tools/invoicesRecalculateInvoice.js.map +1 -1
  34. package/esm/mcp-server/tools/invoicesRecalculateInvoiceV2.d.ts +7 -0
  35. package/esm/mcp-server/tools/invoicesRecalculateInvoiceV2.d.ts.map +1 -0
  36. package/esm/mcp-server/tools/invoicesRecalculateInvoiceV2.js +34 -0
  37. package/esm/mcp-server/tools/invoicesRecalculateInvoiceV2.js.map +1 -0
  38. package/esm/models/dtofeatureresponse.d.ts +5 -0
  39. package/esm/models/dtofeatureresponse.d.ts.map +1 -1
  40. package/esm/models/dtofeatureresponse.js +5 -0
  41. package/esm/models/dtofeatureresponse.js.map +1 -1
  42. package/esm/models/dtoinvoiceresponse.d.ts +1 -0
  43. package/esm/models/dtoinvoiceresponse.d.ts.map +1 -1
  44. package/esm/models/dtoinvoiceresponse.js +1 -0
  45. package/esm/models/dtoinvoiceresponse.js.map +1 -1
  46. package/esm/models/dtousageanalyticitem.d.ts +3 -0
  47. package/esm/models/dtousageanalyticitem.d.ts.map +1 -1
  48. package/esm/models/dtousageanalyticitem.js +3 -0
  49. package/esm/models/dtousageanalyticitem.js.map +1 -1
  50. package/esm/models/filtercondition.d.ts +2 -2
  51. package/esm/models/filtercondition.d.ts.map +1 -1
  52. package/esm/models/filtercondition.js +2 -2
  53. package/esm/models/filtercondition.js.map +1 -1
  54. package/esm/models/githubcomflexpriceflexpriceinternaldomainfeaturefeature.d.ts +5 -0
  55. package/esm/models/githubcomflexpriceflexpriceinternaldomainfeaturefeature.d.ts.map +1 -1
  56. package/esm/models/githubcomflexpriceflexpriceinternaldomainfeaturefeature.js +5 -0
  57. package/esm/models/githubcomflexpriceflexpriceinternaldomainfeaturefeature.js.map +1 -1
  58. package/esm/models/groupentitytype.d.ts +12 -0
  59. package/esm/models/groupentitytype.d.ts.map +1 -0
  60. package/esm/models/groupentitytype.js +13 -0
  61. package/esm/models/groupentitytype.js.map +1 -0
  62. package/esm/models/groupgroup.d.ts +21 -0
  63. package/esm/models/groupgroup.d.ts.map +1 -0
  64. package/esm/models/groupgroup.js +21 -0
  65. package/esm/models/groupgroup.js.map +1 -0
  66. package/esm/models/meteraggregation.d.ts +1 -0
  67. package/esm/models/meteraggregation.d.ts.map +1 -1
  68. package/esm/models/meteraggregation.js +1 -0
  69. package/esm/models/meteraggregation.js.map +1 -1
  70. package/esm/models/recalculateinvoiceop.d.ts +2 -3
  71. package/esm/models/recalculateinvoiceop.d.ts.map +1 -1
  72. package/esm/models/recalculateinvoiceop.js +2 -3
  73. package/esm/models/recalculateinvoiceop.js.map +1 -1
  74. package/esm/models/recalculateinvoicev2op.d.ts +11 -0
  75. package/esm/models/recalculateinvoicev2op.d.ts.map +1 -0
  76. package/esm/models/recalculateinvoicev2op.js +15 -0
  77. package/esm/models/recalculateinvoicev2op.js.map +1 -0
  78. package/esm/models/reportingunit.d.ts +8 -0
  79. package/esm/models/reportingunit.d.ts.map +1 -0
  80. package/esm/models/reportingunit.js +10 -0
  81. package/esm/models/reportingunit.js.map +1 -0
  82. package/esm/models/value.d.ts +10 -0
  83. package/esm/models/value.d.ts.map +1 -0
  84. package/esm/models/{githubcomflexpriceflexpriceinternaltypesvalue.js → value.js} +2 -2
  85. package/esm/models/value.js.map +1 -0
  86. package/esm/tool-names.d.ts.map +1 -1
  87. package/esm/tool-names.js +5 -1
  88. package/esm/tool-names.js.map +1 -1
  89. package/esm/tsconfig.tsbuildinfo +1 -1
  90. package/manifest.json +17 -11
  91. package/package.json +1 -1
  92. package/src/funcs/invoicesRecalculateInvoice.ts +3 -7
  93. package/src/funcs/invoicesRecalculateInvoiceV2.ts +156 -0
  94. package/src/landing-page.ts +9 -9
  95. package/src/lib/config.ts +13 -6
  96. package/src/lib/sdks.ts +1 -1
  97. package/src/mcp-server/cli/serve/command.ts +1 -1
  98. package/src/mcp-server/cli/start/command.ts +1 -1
  99. package/src/mcp-server/flags.ts +1 -1
  100. package/src/mcp-server/mcp-server.ts +1 -1
  101. package/src/mcp-server/server.ts +4 -2
  102. package/src/mcp-server/tools/invoicesRecalculateInvoice.ts +2 -2
  103. package/src/mcp-server/tools/invoicesRecalculateInvoiceV2.ts +42 -0
  104. package/src/models/dtofeatureresponse.ts +11 -0
  105. package/src/models/dtoinvoiceresponse.ts +2 -0
  106. package/src/models/dtousageanalyticitem.ts +5 -0
  107. package/src/models/filtercondition.ts +3 -6
  108. package/src/models/githubcomflexpriceflexpriceinternaldomainfeaturefeature.ts +8 -0
  109. package/src/models/groupentitytype.ts +17 -0
  110. package/src/models/groupgroup.ts +40 -0
  111. package/src/models/meteraggregation.ts +2 -0
  112. package/src/models/recalculateinvoiceop.ts +7 -13
  113. package/src/models/recalculateinvoicev2op.ts +38 -0
  114. package/src/models/reportingunit.ts +17 -0
  115. package/src/models/{githubcomflexpriceflexpriceinternaltypesvalue.ts → value.ts} +2 -4
  116. package/src/tool-names.ts +5 -1
  117. package/esm/models/githubcomflexpriceflexpriceinternaltypesvalue.d.ts +0 -10
  118. package/esm/models/githubcomflexpriceflexpriceinternaltypesvalue.d.ts.map +0 -1
  119. package/esm/models/githubcomflexpriceflexpriceinternaltypesvalue.js.map +0 -1
package/bin/mcp-server.js CHANGED
@@ -5597,15 +5597,32 @@ var RequestError, toRequestError = (e) => {
5597
5597
  }
5598
5598
  }, responseViaCache = async (res, outgoing) => {
5599
5599
  let [status, body, header] = res[cacheKey];
5600
- if (header instanceof Headers) {
5600
+ let hasContentLength = false;
5601
+ if (!header) {
5602
+ header = { "content-type": "text/plain; charset=UTF-8" };
5603
+ } else if (header instanceof Headers) {
5604
+ hasContentLength = header.has("content-length");
5601
5605
  header = buildOutgoingHttpHeaders(header);
5606
+ } else if (Array.isArray(header)) {
5607
+ const headerObj = new Headers(header);
5608
+ hasContentLength = headerObj.has("content-length");
5609
+ header = buildOutgoingHttpHeaders(headerObj);
5610
+ } else {
5611
+ for (const key in header) {
5612
+ if (key.length === 14 && key.toLowerCase() === "content-length") {
5613
+ hasContentLength = true;
5614
+ break;
5615
+ }
5616
+ }
5602
5617
  }
5603
- if (typeof body === "string") {
5604
- header["Content-Length"] = Buffer.byteLength(body);
5605
- } else if (body instanceof Uint8Array) {
5606
- header["Content-Length"] = body.byteLength;
5607
- } else if (body instanceof Blob) {
5608
- header["Content-Length"] = body.size;
5618
+ if (!hasContentLength) {
5619
+ if (typeof body === "string") {
5620
+ header["Content-Length"] = Buffer.byteLength(body);
5621
+ } else if (body instanceof Uint8Array) {
5622
+ header["Content-Length"] = body.byteLength;
5623
+ } else if (body instanceof Blob) {
5624
+ header["Content-Length"] = body.size;
5625
+ }
5609
5626
  }
5610
5627
  outgoing.writeHead(status, header);
5611
5628
  if (typeof body === "string" || body instanceof Uint8Array) {
@@ -5871,15 +5888,14 @@ var init_dist = __esm(() => {
5871
5888
  this.#init = init;
5872
5889
  }
5873
5890
  if (typeof body === "string" || typeof body?.getReader !== "undefined" || body instanceof Blob || body instanceof Uint8Array) {
5874
- headers ||= init?.headers || { "content-type": "text/plain; charset=UTF-8" };
5875
- this[cacheKey] = [init?.status || 200, body, headers];
5891
+ this[cacheKey] = [init?.status || 200, body, headers || init?.headers];
5876
5892
  }
5877
5893
  }
5878
5894
  get headers() {
5879
5895
  const cache = this[cacheKey];
5880
5896
  if (cache) {
5881
5897
  if (!(cache[2] instanceof Headers)) {
5882
- cache[2] = new Headers(cache[2]);
5898
+ cache[2] = new Headers(cache[2] || { "content-type": "text/plain; charset=UTF-8" });
5883
5899
  }
5884
5900
  return cache[2];
5885
5901
  }
@@ -50413,14 +50429,15 @@ var ServerList, SDK_METADATA;
50413
50429
  var init_config = __esm(() => {
50414
50430
  init_url();
50415
50431
  ServerList = [
50416
- "/v1"
50432
+ "https://us.api.flexprice.io/v1",
50433
+ "https://api.cloud.flexprice.io/v1"
50417
50434
  ];
50418
50435
  SDK_METADATA = {
50419
50436
  language: "typescript",
50420
50437
  openapiDocVersion: "1.0",
50421
- sdkVersion: "2.0.1",
50422
- genVersion: "2.845.12",
50423
- userAgent: "speakeasy-sdk/mcp-typescript 2.0.1 2.845.12 1.0 @flexprice/mcp-server"
50438
+ sdkVersion: "2.0.3",
50439
+ genVersion: "2.856.1",
50440
+ userAgent: "speakeasy-sdk/mcp-typescript 2.0.3 2.856.1 1.0 @flexprice/mcp-server"
50424
50441
  };
50425
50442
  });
50426
50443
 
@@ -50961,7 +50978,7 @@ class ClientSDK {
50961
50978
  #logger;
50962
50979
  _baseURL;
50963
50980
  _options;
50964
- constructor(options) {
50981
+ constructor(options = {}) {
50965
50982
  const opt = options;
50966
50983
  if (typeof opt === "object" && opt != null && "hooks" in opt && opt.hooks instanceof SDKHooks) {
50967
50984
  this.#hooks = opt.hooks;
@@ -52496,6 +52513,23 @@ var init_alertsettings = __esm(() => {
52496
52513
  });
52497
52514
  });
52498
52515
 
52516
+ // src/models/dtogroupresponse.ts
52517
+ var DtoGroupResponse$zodSchema;
52518
+ var init_dtogroupresponse = __esm(() => {
52519
+ init_zod();
52520
+ DtoGroupResponse$zodSchema = object({
52521
+ created_at: string2().optional(),
52522
+ entity_ids: array(string2()).optional(),
52523
+ entity_type: string2().optional(),
52524
+ id: string2().optional(),
52525
+ lookup_key: string2().optional(),
52526
+ metadata: record(string2(), string2()).optional(),
52527
+ name: string2().optional(),
52528
+ status: string2().optional(),
52529
+ updated_at: string2().optional()
52530
+ });
52531
+ });
52532
+
52499
52533
  // src/models/aggregationtype.ts
52500
52534
  var AggregationType$zodSchema;
52501
52535
  var init_aggregationtype = __esm(() => {
@@ -52538,6 +52572,7 @@ var init_meteraggregation = __esm(() => {
52538
52572
  init_windowsize();
52539
52573
  MeterAggregation$zodSchema = object({
52540
52574
  bucket_size: WindowSize$zodSchema.optional(),
52575
+ expression: string2().optional(),
52541
52576
  field: string2().optional(),
52542
52577
  group_by: string2().optional(),
52543
52578
  multiplier: string2().optional(),
@@ -52597,13 +52632,26 @@ var init_featuretype = __esm(() => {
52597
52632
  ]);
52598
52633
  });
52599
52634
 
52635
+ // src/models/reportingunit.ts
52636
+ var ReportingUnit$zodSchema;
52637
+ var init_reportingunit = __esm(() => {
52638
+ init_zod();
52639
+ ReportingUnit$zodSchema = object({
52640
+ conversion_rate: number2().optional(),
52641
+ unit_plural: string2().optional(),
52642
+ unit_singular: string2().optional()
52643
+ });
52644
+ });
52645
+
52600
52646
  // src/models/dtofeatureresponse.ts
52601
52647
  var DtoFeatureResponse$zodSchema;
52602
52648
  var init_dtofeatureresponse = __esm(() => {
52603
52649
  init_zod();
52604
52650
  init_alertsettings();
52651
+ init_dtogroupresponse();
52605
52652
  init_dtometerresponse();
52606
52653
  init_featuretype();
52654
+ init_reportingunit();
52607
52655
  init_status();
52608
52656
  DtoFeatureResponse$zodSchema = object({
52609
52657
  alert_settings: AlertSettings$zodSchema.optional(),
@@ -52611,12 +52659,15 @@ var init_dtofeatureresponse = __esm(() => {
52611
52659
  created_by: string2().optional(),
52612
52660
  description: string2().optional(),
52613
52661
  environment_id: string2().optional(),
52662
+ group: DtoGroupResponse$zodSchema.optional(),
52663
+ group_id: string2().optional(),
52614
52664
  id: string2().optional(),
52615
52665
  lookup_key: string2().optional(),
52616
52666
  metadata: record(string2(), string2()).optional(),
52617
52667
  meter: DtoMeterResponse$zodSchema.optional(),
52618
52668
  meter_id: string2().optional(),
52619
52669
  name: string2().optional(),
52670
+ reporting_unit: ReportingUnit$zodSchema.optional(),
52620
52671
  status: Status$zodSchema.optional(),
52621
52672
  tenant_id: string2().optional(),
52622
52673
  type: FeatureType$zodSchema.optional(),
@@ -53212,11 +53263,11 @@ var init_filteroperatortype = __esm(() => {
53212
53263
  ]);
53213
53264
  });
53214
53265
 
53215
- // src/models/githubcomflexpriceflexpriceinternaltypesvalue.ts
53216
- var GithubComFlexpriceFlexpriceInternalTypesValue$zodSchema;
53217
- var init_githubcomflexpriceflexpriceinternaltypesvalue = __esm(() => {
53266
+ // src/models/value.ts
53267
+ var Value$zodSchema;
53268
+ var init_value = __esm(() => {
53218
53269
  init_zod();
53219
- GithubComFlexpriceFlexpriceInternalTypesValue$zodSchema = object({
53270
+ Value$zodSchema = object({
53220
53271
  array: array(string2()).optional(),
53221
53272
  boolean: boolean2().optional(),
53222
53273
  date: string2().optional(),
@@ -53231,12 +53282,12 @@ var init_filtercondition = __esm(() => {
53231
53282
  init_zod();
53232
53283
  init_datatype();
53233
53284
  init_filteroperatortype();
53234
- init_githubcomflexpriceflexpriceinternaltypesvalue();
53285
+ init_value();
53235
53286
  FilterCondition$zodSchema = object({
53236
53287
  data_type: DataType$zodSchema.optional(),
53237
53288
  field: string2().optional(),
53238
53289
  operator: FilterOperatorType$zodSchema.optional(),
53239
- value: GithubComFlexpriceFlexpriceInternalTypesValue$zodSchema.optional()
53290
+ value: Value$zodSchema.optional()
53240
53291
  });
53241
53292
  });
53242
53293
 
@@ -56084,23 +56135,6 @@ var init_addontype = __esm(() => {
56084
56135
  ]);
56085
56136
  });
56086
56137
 
56087
- // src/models/dtogroupresponse.ts
56088
- var DtoGroupResponse$zodSchema;
56089
- var init_dtogroupresponse = __esm(() => {
56090
- init_zod();
56091
- DtoGroupResponse$zodSchema = object({
56092
- created_at: string2().optional(),
56093
- entity_ids: array(string2()).optional(),
56094
- entity_type: string2().optional(),
56095
- id: string2().optional(),
56096
- lookup_key: string2().optional(),
56097
- metadata: record(string2(), string2()).optional(),
56098
- name: string2().optional(),
56099
- status: string2().optional(),
56100
- updated_at: string2().optional()
56101
- });
56102
- });
56103
-
56104
56138
  // src/models/dtopriceunitresponse.ts
56105
56139
  var DtoPriceUnitResponse$zodSchema;
56106
56140
  var init_dtopriceunitresponse = __esm(() => {
@@ -56571,6 +56605,7 @@ var init_dtoinvoiceresponse = __esm(() => {
56571
56605
  payment_status: PaymentStatus$zodSchema.optional(),
56572
56606
  period_end: string2().optional(),
56573
56607
  period_start: string2().optional(),
56608
+ recalculated_invoice_id: string2().optional(),
56574
56609
  refunded_amount: string2().optional(),
56575
56610
  status: Status$zodSchema.optional(),
56576
56611
  subscription: lazy(() => DtoSubscriptionResponse$zodSchema).optional(),
@@ -57125,18 +57160,28 @@ Use when listing or searching invoices (e.g. admin view or customer history). Re
57125
57160
  };
57126
57161
  });
57127
57162
 
57163
+ // src/models/modelstemporalworkflowresult.ts
57164
+ var ModelsTemporalWorkflowResult$zodSchema;
57165
+ var init_modelstemporalworkflowresult = __esm(() => {
57166
+ init_zod();
57167
+ ModelsTemporalWorkflowResult$zodSchema = object({
57168
+ message: string2().optional(),
57169
+ run_id: string2().optional(),
57170
+ workflow_id: string2().optional()
57171
+ });
57172
+ });
57173
+
57128
57174
  // src/models/recalculateinvoiceop.ts
57129
57175
  var RecalculateInvoiceRequest$zodSchema, RecalculateInvoiceResponse$zodSchema;
57130
57176
  var init_recalculateinvoiceop = __esm(() => {
57131
57177
  init_zod();
57132
- init_dtoinvoiceresponse();
57133
57178
  init_errorserrorresponse();
57179
+ init_modelstemporalworkflowresult();
57134
57180
  RecalculateInvoiceRequest$zodSchema = object({
57135
- finalize: boolean2().describe("Whether to finalize the invoice after recalculation (default: true)").optional(),
57136
57181
  id: string2().describe("Invoice ID")
57137
57182
  });
57138
57183
  RecalculateInvoiceResponse$zodSchema = union([
57139
- DtoInvoiceResponse$zodSchema,
57184
+ ModelsTemporalWorkflowResult$zodSchema,
57140
57185
  ErrorsErrorResponse$zodSchema
57141
57186
  ]);
57142
57187
  });
@@ -57159,9 +57204,6 @@ async function $do26(client$, request, options) {
57159
57204
  })
57160
57205
  };
57161
57206
  const path$ = pathToFunc("/invoices/{id}/recalculate")(pathParams$);
57162
- const query$ = encodeFormQuery({
57163
- finalize: payload$.finalize
57164
- });
57165
57207
  const headers$ = new Headers(compactMap({
57166
57208
  Accept: "application/json"
57167
57209
  }));
@@ -57189,7 +57231,6 @@ async function $do26(client$, request, options) {
57189
57231
  baseURL: options?.serverURL,
57190
57232
  path: path$,
57191
57233
  headers: headers$,
57192
- query: query$,
57193
57234
  body: body$,
57194
57235
  userAgent: client$._options.userAgent,
57195
57236
  timeoutMs: options?.timeoutMs || client$._options.timeoutMs || -1
@@ -57234,9 +57275,9 @@ var init_invoicesRecalculateInvoice2 = __esm(() => {
57234
57275
  };
57235
57276
  tool$invoicesRecalculateInvoice = {
57236
57277
  name: "recalculate-invoice",
57237
- description: `Recalculate invoice
57278
+ description: `Recalculate invoice (voided invoice)
57238
57279
 
57239
- Use when subscription or usage data changed and you need to refresh a draft invoice before finalizing. Optional finalize=true to lock after recalc.`,
57280
+ Starts an async workflow that creates a fresh replacement invoice for a voided SUBSCRIPTION invoice (same billing period). Returns workflow_id and run_id; poll workflow status or GET the new invoice via recalculated_invoice_id after completion.`,
57240
57281
  annotations: {
57241
57282
  title: "",
57242
57283
  destructiveHint: false,
@@ -57258,6 +57299,139 @@ Use when subscription or usage data changed and you need to refresh a draft invo
57258
57299
  };
57259
57300
  });
57260
57301
 
57302
+ // src/models/recalculateinvoicev2op.ts
57303
+ var RecalculateInvoiceV2Request$zodSchema, RecalculateInvoiceV2Response$zodSchema;
57304
+ var init_recalculateinvoicev2op = __esm(() => {
57305
+ init_zod();
57306
+ init_dtoinvoiceresponse();
57307
+ init_errorserrorresponse();
57308
+ RecalculateInvoiceV2Request$zodSchema = object({
57309
+ finalize: boolean2().describe("Whether to finalize the invoice after recalculation (default: true)").optional(),
57310
+ id: string2().describe("Invoice ID")
57311
+ });
57312
+ RecalculateInvoiceV2Response$zodSchema = union([
57313
+ DtoInvoiceResponse$zodSchema,
57314
+ ErrorsErrorResponse$zodSchema
57315
+ ]);
57316
+ });
57317
+
57318
+ // src/funcs/invoicesRecalculateInvoiceV2.ts
57319
+ function invoicesRecalculateInvoiceV2(client$, request, options) {
57320
+ return new APIPromise($do27(client$, request, options));
57321
+ }
57322
+ async function $do27(client$, request, options) {
57323
+ const parsed$ = safeParse4(request, (value$) => RecalculateInvoiceV2Request$zodSchema.parse(value$), "Input validation failed");
57324
+ if (!parsed$.ok) {
57325
+ return [parsed$, { status: "invalid" }];
57326
+ }
57327
+ const payload$ = parsed$.value;
57328
+ const body$ = null;
57329
+ const pathParams$ = {
57330
+ id: encodeSimple("id", payload$.id, {
57331
+ explode: false,
57332
+ charEncoding: "percent"
57333
+ })
57334
+ };
57335
+ const path$ = pathToFunc("/invoices/{id}/recalculate-v2")(pathParams$);
57336
+ const query$ = encodeFormQuery({
57337
+ finalize: payload$.finalize
57338
+ });
57339
+ const headers$ = new Headers(compactMap({
57340
+ Accept: "application/json"
57341
+ }));
57342
+ const securityInput = await extractSecurity(client$._options.security);
57343
+ const requestSecurity = resolveGlobalSecurity(securityInput);
57344
+ const context = {
57345
+ options: client$._options,
57346
+ baseURL: options?.serverURL ?? client$._baseURL ?? "",
57347
+ operationID: "recalculateInvoiceV2",
57348
+ oAuth2Scopes: null,
57349
+ resolvedSecurity: requestSecurity,
57350
+ securitySource: client$._options.security,
57351
+ retryConfig: options?.retries || client$._options.retryConfig || { strategy: "none" },
57352
+ retryCodes: options?.retryCodes || [
57353
+ "429",
57354
+ "500",
57355
+ "502",
57356
+ "503",
57357
+ "504"
57358
+ ]
57359
+ };
57360
+ const requestRes = client$._createRequest(context, {
57361
+ security: requestSecurity,
57362
+ method: "POST",
57363
+ baseURL: options?.serverURL,
57364
+ path: path$,
57365
+ headers: headers$,
57366
+ query: query$,
57367
+ body: body$,
57368
+ userAgent: client$._options.userAgent,
57369
+ timeoutMs: options?.timeoutMs || client$._options.timeoutMs || -1
57370
+ }, options);
57371
+ if (!requestRes.ok) {
57372
+ return [requestRes, { status: "invalid" }];
57373
+ }
57374
+ const req$ = requestRes.value;
57375
+ const doResult = await client$._do(req$, {
57376
+ context,
57377
+ errorCodes: [],
57378
+ retryConfig: context.retryConfig,
57379
+ retryCodes: context.retryCodes
57380
+ });
57381
+ if (!doResult.ok) {
57382
+ return [doResult, { status: "request-error", request: req$ }];
57383
+ }
57384
+ return [doResult, {
57385
+ status: "complete",
57386
+ request: req$,
57387
+ response: doResult.value
57388
+ }];
57389
+ }
57390
+ var init_invoicesRecalculateInvoiceV2 = __esm(() => {
57391
+ init_encodings();
57392
+ init_primitives();
57393
+ init_schemas4();
57394
+ init_security();
57395
+ init_url();
57396
+ init_recalculateinvoicev2op();
57397
+ init_async();
57398
+ });
57399
+
57400
+ // src/mcp-server/tools/invoicesRecalculateInvoiceV2.ts
57401
+ var args26, tool$invoicesRecalculateInvoiceV2;
57402
+ var init_invoicesRecalculateInvoiceV22 = __esm(() => {
57403
+ init_invoicesRecalculateInvoiceV2();
57404
+ init_recalculateinvoicev2op();
57405
+ init_tools();
57406
+ args26 = {
57407
+ request: RecalculateInvoiceV2Request$zodSchema
57408
+ };
57409
+ tool$invoicesRecalculateInvoiceV2 = {
57410
+ name: "recalculate-invoice-v2",
57411
+ description: `Recalculate draft invoice (v2)
57412
+
57413
+ Recalculates a draft SUBSCRIPTION invoice in-place (replaces line items, reapplies credits/coupons/taxes). Use when subscription or usage data changed before finalizing.`,
57414
+ annotations: {
57415
+ title: "",
57416
+ destructiveHint: false,
57417
+ idempotentHint: false,
57418
+ openWorldHint: false,
57419
+ readOnlyHint: false
57420
+ },
57421
+ args: args26,
57422
+ tool: async (client, args27, ctx) => {
57423
+ const [result] = await invoicesRecalculateInvoiceV2(client, args27.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
57424
+ if (!result.ok) {
57425
+ return {
57426
+ content: [{ type: "text", text: result.error.message }],
57427
+ isError: true
57428
+ };
57429
+ }
57430
+ return formatResult(result.value);
57431
+ }
57432
+ };
57433
+ });
57434
+
57261
57435
  // src/models/triggerinvoicecommswebhookop.ts
57262
57436
  var TriggerInvoiceCommsWebhookRequest$zodSchema, TriggerInvoiceCommsWebhookResponse$zodSchema;
57263
57437
  var init_triggerinvoicecommswebhookop = __esm(() => {
@@ -57275,9 +57449,9 @@ var init_triggerinvoicecommswebhookop = __esm(() => {
57275
57449
 
57276
57450
  // src/funcs/invoicesTriggerInvoiceCommsWebhook.ts
57277
57451
  function invoicesTriggerInvoiceCommsWebhook(client$, request, options) {
57278
- return new APIPromise($do27(client$, request, options));
57452
+ return new APIPromise($do28(client$, request, options));
57279
57453
  }
57280
- async function $do27(client$, request, options) {
57454
+ async function $do28(client$, request, options) {
57281
57455
  const parsed$ = safeParse4(request, (value$) => TriggerInvoiceCommsWebhookRequest$zodSchema.parse(value$), "Input validation failed");
57282
57456
  if (!parsed$.ok) {
57283
57457
  return [parsed$, { status: "invalid" }];
@@ -57352,12 +57526,12 @@ var init_invoicesTriggerInvoiceCommsWebhook = __esm(() => {
57352
57526
  });
57353
57527
 
57354
57528
  // src/mcp-server/tools/invoicesTriggerInvoiceCommsWebhook.ts
57355
- var args26, tool$invoicesTriggerInvoiceCommsWebhook;
57529
+ var args27, tool$invoicesTriggerInvoiceCommsWebhook;
57356
57530
  var init_invoicesTriggerInvoiceCommsWebhook2 = __esm(() => {
57357
57531
  init_invoicesTriggerInvoiceCommsWebhook();
57358
57532
  init_triggerinvoicecommswebhookop();
57359
57533
  init_tools();
57360
- args26 = {
57534
+ args27 = {
57361
57535
  request: TriggerInvoiceCommsWebhookRequest$zodSchema
57362
57536
  };
57363
57537
  tool$invoicesTriggerInvoiceCommsWebhook = {
@@ -57372,9 +57546,9 @@ Use when sending an invoice to the customer (e.g. trigger email or Slack). Paylo
57372
57546
  openWorldHint: false,
57373
57547
  readOnlyHint: false
57374
57548
  },
57375
- args: args26,
57376
- tool: async (client, args27, ctx) => {
57377
- const [result] = await invoicesTriggerInvoiceCommsWebhook(client, args27.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
57549
+ args: args27,
57550
+ tool: async (client, args28, ctx) => {
57551
+ const [result] = await invoicesTriggerInvoiceCommsWebhook(client, args28.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
57378
57552
  if (!result.ok) {
57379
57553
  return {
57380
57554
  content: [{ type: "text", text: result.error.message }],
@@ -57416,9 +57590,9 @@ var init_updateinvoiceop = __esm(() => {
57416
57590
 
57417
57591
  // src/funcs/invoicesUpdateInvoice.ts
57418
57592
  function invoicesUpdateInvoice(client$, request, options) {
57419
- return new APIPromise($do28(client$, request, options));
57593
+ return new APIPromise($do29(client$, request, options));
57420
57594
  }
57421
- async function $do28(client$, request, options) {
57595
+ async function $do29(client$, request, options) {
57422
57596
  const parsed$ = safeParse4(request, (value$) => UpdateInvoiceRequest$zodSchema.parse(value$), "Input validation failed");
57423
57597
  if (!parsed$.ok) {
57424
57598
  return [parsed$, { status: "invalid" }];
@@ -57494,12 +57668,12 @@ var init_invoicesUpdateInvoice = __esm(() => {
57494
57668
  });
57495
57669
 
57496
57670
  // src/mcp-server/tools/invoicesUpdateInvoice.ts
57497
- var args27, tool$invoicesUpdateInvoice;
57671
+ var args28, tool$invoicesUpdateInvoice;
57498
57672
  var init_invoicesUpdateInvoice2 = __esm(() => {
57499
57673
  init_invoicesUpdateInvoice();
57500
57674
  init_updateinvoiceop();
57501
57675
  init_tools();
57502
- args27 = {
57676
+ args28 = {
57503
57677
  request: UpdateInvoiceRequest$zodSchema
57504
57678
  };
57505
57679
  tool$invoicesUpdateInvoice = {
@@ -57514,9 +57688,9 @@ Use when updating invoice metadata or due date (e.g. PDF URL, net terms). For pa
57514
57688
  openWorldHint: false,
57515
57689
  readOnlyHint: false
57516
57690
  },
57517
- args: args27,
57518
- tool: async (client, args28, ctx) => {
57519
- const [result] = await invoicesUpdateInvoice(client, args28.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
57691
+ args: args28,
57692
+ tool: async (client, args29, ctx) => {
57693
+ const [result] = await invoicesUpdateInvoice(client, args29.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
57520
57694
  if (!result.ok) {
57521
57695
  return {
57522
57696
  content: [{ type: "text", text: result.error.message }],
@@ -57558,9 +57732,9 @@ var init_updateinvoicepaymentstatusop = __esm(() => {
57558
57732
 
57559
57733
  // src/funcs/invoicesUpdateInvoicePaymentStatus.ts
57560
57734
  function invoicesUpdateInvoicePaymentStatus(client$, request, options) {
57561
- return new APIPromise($do29(client$, request, options));
57735
+ return new APIPromise($do30(client$, request, options));
57562
57736
  }
57563
- async function $do29(client$, request, options) {
57737
+ async function $do30(client$, request, options) {
57564
57738
  const parsed$ = safeParse4(request, (value$) => UpdateInvoicePaymentStatusRequest$zodSchema.parse(value$), "Input validation failed");
57565
57739
  if (!parsed$.ok) {
57566
57740
  return [parsed$, { status: "invalid" }];
@@ -57636,12 +57810,12 @@ var init_invoicesUpdateInvoicePaymentStatus = __esm(() => {
57636
57810
  });
57637
57811
 
57638
57812
  // src/mcp-server/tools/invoicesUpdateInvoicePaymentStatus.ts
57639
- var args28, tool$invoicesUpdateInvoicePaymentStatus;
57813
+ var args29, tool$invoicesUpdateInvoicePaymentStatus;
57640
57814
  var init_invoicesUpdateInvoicePaymentStatus2 = __esm(() => {
57641
57815
  init_invoicesUpdateInvoicePaymentStatus();
57642
57816
  init_updateinvoicepaymentstatusop();
57643
57817
  init_tools();
57644
- args28 = {
57818
+ args29 = {
57645
57819
  request: UpdateInvoicePaymentStatusRequest$zodSchema
57646
57820
  };
57647
57821
  tool$invoicesUpdateInvoicePaymentStatus = {
@@ -57656,9 +57830,9 @@ Use when reconciling payment status from an external gateway or manual entry (e.
57656
57830
  openWorldHint: false,
57657
57831
  readOnlyHint: false
57658
57832
  },
57659
- args: args28,
57660
- tool: async (client, args29, ctx) => {
57661
- const [result] = await invoicesUpdateInvoicePaymentStatus(client, args29.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
57833
+ args: args29,
57834
+ tool: async (client, args30, ctx) => {
57835
+ const [result] = await invoicesUpdateInvoicePaymentStatus(client, args30.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
57662
57836
  if (!result.ok) {
57663
57837
  return {
57664
57838
  content: [{ type: "text", text: result.error.message }],
@@ -57687,9 +57861,9 @@ var init_voidinvoiceop = __esm(() => {
57687
57861
 
57688
57862
  // src/funcs/invoicesVoidInvoice.ts
57689
57863
  function invoicesVoidInvoice(client$, request, options) {
57690
- return new APIPromise($do30(client$, request, options));
57864
+ return new APIPromise($do31(client$, request, options));
57691
57865
  }
57692
- async function $do30(client$, request, options) {
57866
+ async function $do31(client$, request, options) {
57693
57867
  const parsed$ = safeParse4(request, (value$) => VoidInvoiceRequest$zodSchema.parse(value$), "Input validation failed");
57694
57868
  if (!parsed$.ok) {
57695
57869
  return [parsed$, { status: "invalid" }];
@@ -57764,12 +57938,12 @@ var init_invoicesVoidInvoice = __esm(() => {
57764
57938
  });
57765
57939
 
57766
57940
  // src/mcp-server/tools/invoicesVoidInvoice.ts
57767
- var args29, tool$invoicesVoidInvoice;
57941
+ var args30, tool$invoicesVoidInvoice;
57768
57942
  var init_invoicesVoidInvoice2 = __esm(() => {
57769
57943
  init_invoicesVoidInvoice();
57770
57944
  init_voidinvoiceop();
57771
57945
  init_tools();
57772
- args29 = {
57946
+ args30 = {
57773
57947
  request: VoidInvoiceRequest$zodSchema
57774
57948
  };
57775
57949
  tool$invoicesVoidInvoice = {
@@ -57784,9 +57958,9 @@ Use when cancelling an invoice (e.g. order cancelled or duplicate). Only unpaid
57784
57958
  openWorldHint: false,
57785
57959
  readOnlyHint: false
57786
57960
  },
57787
- args: args29,
57788
- tool: async (client, args30, ctx) => {
57789
- const [result] = await invoicesVoidInvoice(client, args30.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
57961
+ args: args30,
57962
+ tool: async (client, args31, ctx) => {
57963
+ const [result] = await invoicesVoidInvoice(client, args31.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
57790
57964
  if (!result.ok) {
57791
57965
  return {
57792
57966
  content: [{ type: "text", text: result.error.message }],
@@ -57813,9 +57987,9 @@ var init_dtocreateplanrequest = __esm(() => {
57813
57987
 
57814
57988
  // src/funcs/plansCreatePlan.ts
57815
57989
  function plansCreatePlan(client$, request, options) {
57816
- return new APIPromise($do31(client$, request, options));
57990
+ return new APIPromise($do32(client$, request, options));
57817
57991
  }
57818
- async function $do31(client$, request, options) {
57992
+ async function $do32(client$, request, options) {
57819
57993
  const parsed$ = safeParse4(request, (value$) => DtoCreatePlanRequest$zodSchema.parse(value$), "Input validation failed");
57820
57994
  if (!parsed$.ok) {
57821
57995
  return [parsed$, { status: "invalid" }];
@@ -57885,12 +58059,12 @@ var init_plansCreatePlan = __esm(() => {
57885
58059
  });
57886
58060
 
57887
58061
  // src/mcp-server/tools/plansCreatePlan.ts
57888
- var args30, tool$plansCreatePlan;
58062
+ var args31, tool$plansCreatePlan;
57889
58063
  var init_plansCreatePlan2 = __esm(() => {
57890
58064
  init_plansCreatePlan();
57891
58065
  init_dtocreateplanrequest();
57892
58066
  init_tools();
57893
- args30 = {
58067
+ args31 = {
57894
58068
  request: DtoCreatePlanRequest$zodSchema
57895
58069
  };
57896
58070
  tool$plansCreatePlan = {
@@ -57905,9 +58079,9 @@ Use when defining a new pricing plan (e.g. Free, Pro, Enterprise). Attach prices
57905
58079
  openWorldHint: false,
57906
58080
  readOnlyHint: false
57907
58081
  },
57908
- args: args30,
57909
- tool: async (client, args31, ctx) => {
57910
- const [result] = await plansCreatePlan(client, args31.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
58082
+ args: args31,
58083
+ tool: async (client, args32, ctx) => {
58084
+ const [result] = await plansCreatePlan(client, args32.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
57911
58085
  if (!result.ok) {
57912
58086
  return {
57913
58087
  content: [{ type: "text", text: result.error.message }],
@@ -57936,9 +58110,9 @@ var init_deleteplanop = __esm(() => {
57936
58110
 
57937
58111
  // src/funcs/plansDeletePlan.ts
57938
58112
  function plansDeletePlan(client$, request, options) {
57939
- return new APIPromise($do32(client$, request, options));
58113
+ return new APIPromise($do33(client$, request, options));
57940
58114
  }
57941
- async function $do32(client$, request, options) {
58115
+ async function $do33(client$, request, options) {
57942
58116
  const parsed$ = safeParse4(request, (value$) => DeletePlanRequest$zodSchema.parse(value$), "Input validation failed");
57943
58117
  if (!parsed$.ok) {
57944
58118
  return [parsed$, { status: "invalid" }];
@@ -58013,12 +58187,12 @@ var init_plansDeletePlan = __esm(() => {
58013
58187
  });
58014
58188
 
58015
58189
  // src/mcp-server/tools/plansDeletePlan.ts
58016
- var args31, tool$plansDeletePlan;
58190
+ var args32, tool$plansDeletePlan;
58017
58191
  var init_plansDeletePlan2 = __esm(() => {
58018
58192
  init_plansDeletePlan();
58019
58193
  init_deleteplanop();
58020
58194
  init_tools();
58021
- args31 = {
58195
+ args32 = {
58022
58196
  request: DeletePlanRequest$zodSchema
58023
58197
  };
58024
58198
  tool$plansDeletePlan = {
@@ -58033,9 +58207,9 @@ Use when retiring a plan (e.g. end-of-life). Existing subscriptions may be affec
58033
58207
  openWorldHint: false,
58034
58208
  readOnlyHint: false
58035
58209
  },
58036
- args: args31,
58037
- tool: async (client, args32, ctx) => {
58038
- const [result] = await plansDeletePlan(client, args32.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
58210
+ args: args32,
58211
+ tool: async (client, args33, ctx) => {
58212
+ const [result] = await plansDeletePlan(client, args33.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
58039
58213
  if (!result.ok) {
58040
58214
  return {
58041
58215
  content: [{ type: "text", text: result.error.message }],
@@ -58064,9 +58238,9 @@ var init_getplanop = __esm(() => {
58064
58238
 
58065
58239
  // src/funcs/plansGetPlan.ts
58066
58240
  function plansGetPlan(client$, request, options) {
58067
- return new APIPromise($do33(client$, request, options));
58241
+ return new APIPromise($do34(client$, request, options));
58068
58242
  }
58069
- async function $do33(client$, request, options) {
58243
+ async function $do34(client$, request, options) {
58070
58244
  const parsed$ = safeParse4(request, (value$) => GetPlanRequest$zodSchema.parse(value$), "Input validation failed");
58071
58245
  if (!parsed$.ok) {
58072
58246
  return [parsed$, { status: "invalid" }];
@@ -58141,12 +58315,12 @@ var init_plansGetPlan = __esm(() => {
58141
58315
  });
58142
58316
 
58143
58317
  // src/mcp-server/tools/plansGetPlan.ts
58144
- var args32, tool$plansGetPlan;
58318
+ var args33, tool$plansGetPlan;
58145
58319
  var init_plansGetPlan2 = __esm(() => {
58146
58320
  init_plansGetPlan();
58147
58321
  init_getplanop();
58148
58322
  init_tools();
58149
- args32 = {
58323
+ args33 = {
58150
58324
  request: GetPlanRequest$zodSchema
58151
58325
  };
58152
58326
  tool$plansGetPlan = {
@@ -58161,9 +58335,9 @@ Use when you need to load a single plan (e.g. for display or to create a subscri
58161
58335
  openWorldHint: false,
58162
58336
  readOnlyHint: false
58163
58337
  },
58164
- args: args32,
58165
- tool: async (client, args33, ctx) => {
58166
- const [result] = await plansGetPlan(client, args33.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
58338
+ args: args33,
58339
+ tool: async (client, args34, ctx) => {
58340
+ const [result] = await plansGetPlan(client, args34.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
58167
58341
  if (!result.ok) {
58168
58342
  return {
58169
58343
  content: [{ type: "text", text: result.error.message }],
@@ -58207,9 +58381,9 @@ var init_postplansidcloneop = __esm(() => {
58207
58381
 
58208
58382
  // src/funcs/plansPostPlansIdClone.ts
58209
58383
  function plansPostPlansIdClone(client$, request, options) {
58210
- return new APIPromise($do34(client$, request, options));
58384
+ return new APIPromise($do35(client$, request, options));
58211
58385
  }
58212
- async function $do34(client$, request, options) {
58386
+ async function $do35(client$, request, options) {
58213
58387
  const parsed$ = safeParse4(request, (value$) => PostPlansIdCloneRequest$zodSchema.parse(value$), "Input validation failed");
58214
58388
  if (!parsed$.ok) {
58215
58389
  return [parsed$, { status: "invalid" }];
@@ -58285,12 +58459,12 @@ var init_plansPostPlansIdClone = __esm(() => {
58285
58459
  });
58286
58460
 
58287
58461
  // src/mcp-server/tools/plansPostPlansIdClone.ts
58288
- var args33, tool$plansPostPlansIdClone;
58462
+ var args34, tool$plansPostPlansIdClone;
58289
58463
  var init_plansPostPlansIdClone2 = __esm(() => {
58290
58464
  init_plansPostPlansIdClone();
58291
58465
  init_postplansidcloneop();
58292
58466
  init_tools();
58293
- args33 = {
58467
+ args34 = {
58294
58468
  request: PostPlansIdCloneRequest$zodSchema
58295
58469
  };
58296
58470
  tool$plansPostPlansIdClone = {
@@ -58305,9 +58479,9 @@ Clone an existing plan, copying its active prices, published entitlements, and p
58305
58479
  openWorldHint: false,
58306
58480
  readOnlyHint: false
58307
58481
  },
58308
- args: args33,
58309
- tool: async (client, args34, ctx) => {
58310
- const [result] = await plansPostPlansIdClone(client, args34.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
58482
+ args: args34,
58483
+ tool: async (client, args35, ctx) => {
58484
+ const [result] = await plansPostPlansIdClone(client, args35.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
58311
58485
  if (!result.ok) {
58312
58486
  return {
58313
58487
  content: [{ type: "text", text: result.error.message }],
@@ -58347,9 +58521,9 @@ var init_planfilter = __esm(() => {
58347
58521
 
58348
58522
  // src/funcs/plansQueryPlan.ts
58349
58523
  function plansQueryPlan(client$, request, options) {
58350
- return new APIPromise($do35(client$, request, options));
58524
+ return new APIPromise($do36(client$, request, options));
58351
58525
  }
58352
- async function $do35(client$, request, options) {
58526
+ async function $do36(client$, request, options) {
58353
58527
  const parsed$ = safeParse4(request, (value$) => PlanFilter$zodSchema.parse(value$), "Input validation failed");
58354
58528
  if (!parsed$.ok) {
58355
58529
  return [parsed$, { status: "invalid" }];
@@ -58419,12 +58593,12 @@ var init_plansQueryPlan = __esm(() => {
58419
58593
  });
58420
58594
 
58421
58595
  // src/mcp-server/tools/plansQueryPlan.ts
58422
- var args34, tool$plansQueryPlan;
58596
+ var args35, tool$plansQueryPlan;
58423
58597
  var init_plansQueryPlan2 = __esm(() => {
58424
58598
  init_plansQueryPlan();
58425
58599
  init_planfilter();
58426
58600
  init_tools();
58427
- args34 = {
58601
+ args35 = {
58428
58602
  request: PlanFilter$zodSchema
58429
58603
  };
58430
58604
  tool$plansQueryPlan = {
@@ -58439,9 +58613,9 @@ Use when listing or searching plans (e.g. plan picker or admin catalog). Returns
58439
58613
  openWorldHint: false,
58440
58614
  readOnlyHint: false
58441
58615
  },
58442
- args: args34,
58443
- tool: async (client, args35, ctx) => {
58444
- const [result] = await plansQueryPlan(client, args35.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
58616
+ args: args35,
58617
+ tool: async (client, args36, ctx) => {
58618
+ const [result] = await plansQueryPlan(client, args36.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
58445
58619
  if (!result.ok) {
58446
58620
  return {
58447
58621
  content: [{ type: "text", text: result.error.message }],
@@ -58453,17 +58627,6 @@ Use when listing or searching plans (e.g. plan picker or admin catalog). Returns
58453
58627
  };
58454
58628
  });
58455
58629
 
58456
- // src/models/modelstemporalworkflowresult.ts
58457
- var ModelsTemporalWorkflowResult$zodSchema;
58458
- var init_modelstemporalworkflowresult = __esm(() => {
58459
- init_zod();
58460
- ModelsTemporalWorkflowResult$zodSchema = object({
58461
- message: string2().optional(),
58462
- run_id: string2().optional(),
58463
- workflow_id: string2().optional()
58464
- });
58465
- });
58466
-
58467
58630
  // src/models/syncplanpricesop.ts
58468
58631
  var SyncPlanPricesRequest$zodSchema, SyncPlanPricesResponse$zodSchema;
58469
58632
  var init_syncplanpricesop = __esm(() => {
@@ -58481,9 +58644,9 @@ var init_syncplanpricesop = __esm(() => {
58481
58644
 
58482
58645
  // src/funcs/plansSyncPlanPrices.ts
58483
58646
  function plansSyncPlanPrices(client$, request, options) {
58484
- return new APIPromise($do36(client$, request, options));
58647
+ return new APIPromise($do37(client$, request, options));
58485
58648
  }
58486
- async function $do36(client$, request, options) {
58649
+ async function $do37(client$, request, options) {
58487
58650
  const parsed$ = safeParse4(request, (value$) => SyncPlanPricesRequest$zodSchema.parse(value$), "Input validation failed");
58488
58651
  if (!parsed$.ok) {
58489
58652
  return [parsed$, { status: "invalid" }];
@@ -58558,12 +58721,12 @@ var init_plansSyncPlanPrices = __esm(() => {
58558
58721
  });
58559
58722
 
58560
58723
  // src/mcp-server/tools/plansSyncPlanPrices.ts
58561
- var args35, tool$plansSyncPlanPrices;
58724
+ var args36, tool$plansSyncPlanPrices;
58562
58725
  var init_plansSyncPlanPrices2 = __esm(() => {
58563
58726
  init_plansSyncPlanPrices();
58564
58727
  init_syncplanpricesop();
58565
58728
  init_tools();
58566
- args35 = {
58729
+ args36 = {
58567
58730
  request: SyncPlanPricesRequest$zodSchema
58568
58731
  };
58569
58732
  tool$plansSyncPlanPrices = {
@@ -58578,9 +58741,9 @@ Use when you have changed plan prices and need to push them to all active subscr
58578
58741
  openWorldHint: false,
58579
58742
  readOnlyHint: false
58580
58743
  },
58581
- args: args35,
58582
- tool: async (client, args36, ctx) => {
58583
- const [result] = await plansSyncPlanPrices(client, args36.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
58744
+ args: args36,
58745
+ tool: async (client, args37, ctx) => {
58746
+ const [result] = await plansSyncPlanPrices(client, args37.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
58584
58747
  if (!result.ok) {
58585
58748
  return {
58586
58749
  content: [{ type: "text", text: result.error.message }],
@@ -58624,9 +58787,9 @@ var init_updateplanop = __esm(() => {
58624
58787
 
58625
58788
  // src/funcs/plansUpdatePlan.ts
58626
58789
  function plansUpdatePlan(client$, request, options) {
58627
- return new APIPromise($do37(client$, request, options));
58790
+ return new APIPromise($do38(client$, request, options));
58628
58791
  }
58629
- async function $do37(client$, request, options) {
58792
+ async function $do38(client$, request, options) {
58630
58793
  const parsed$ = safeParse4(request, (value$) => UpdatePlanRequest$zodSchema.parse(value$), "Input validation failed");
58631
58794
  if (!parsed$.ok) {
58632
58795
  return [parsed$, { status: "invalid" }];
@@ -58702,12 +58865,12 @@ var init_plansUpdatePlan = __esm(() => {
58702
58865
  });
58703
58866
 
58704
58867
  // src/mcp-server/tools/plansUpdatePlan.ts
58705
- var args36, tool$plansUpdatePlan;
58868
+ var args37, tool$plansUpdatePlan;
58706
58869
  var init_plansUpdatePlan2 = __esm(() => {
58707
58870
  init_plansUpdatePlan();
58708
58871
  init_updateplanop();
58709
58872
  init_tools();
58710
- args36 = {
58873
+ args37 = {
58711
58874
  request: UpdatePlanRequest$zodSchema
58712
58875
  };
58713
58876
  tool$plansUpdatePlan = {
@@ -58722,9 +58885,9 @@ Use when changing plan details (e.g. name, interval, or metadata). Partial updat
58722
58885
  openWorldHint: false,
58723
58886
  readOnlyHint: false
58724
58887
  },
58725
- args: args36,
58726
- tool: async (client, args37, ctx) => {
58727
- const [result] = await plansUpdatePlan(client, args37.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
58888
+ args: args37,
58889
+ tool: async (client, args38, ctx) => {
58890
+ const [result] = await plansUpdatePlan(client, args38.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
58728
58891
  if (!result.ok) {
58729
58892
  return {
58730
58893
  content: [{ type: "text", text: result.error.message }],
@@ -58817,9 +58980,9 @@ var init_dtocreatepricerequest = __esm(() => {
58817
58980
 
58818
58981
  // src/funcs/pricesCreatePrice.ts
58819
58982
  function pricesCreatePrice(client$, request, options) {
58820
- return new APIPromise($do38(client$, request, options));
58983
+ return new APIPromise($do39(client$, request, options));
58821
58984
  }
58822
- async function $do38(client$, request, options) {
58985
+ async function $do39(client$, request, options) {
58823
58986
  const parsed$ = safeParse4(request, (value$) => DtoCreatePriceRequest$zodSchema.parse(value$), "Input validation failed");
58824
58987
  if (!parsed$.ok) {
58825
58988
  return [parsed$, { status: "invalid" }];
@@ -58889,12 +59052,12 @@ var init_pricesCreatePrice = __esm(() => {
58889
59052
  });
58890
59053
 
58891
59054
  // src/mcp-server/tools/pricesCreatePrice.ts
58892
- var args37, tool$pricesCreatePrice;
59055
+ var args38, tool$pricesCreatePrice;
58893
59056
  var init_pricesCreatePrice2 = __esm(() => {
58894
59057
  init_pricesCreatePrice();
58895
59058
  init_dtocreatepricerequest();
58896
59059
  init_tools();
58897
- args37 = {
59060
+ args38 = {
58898
59061
  request: DtoCreatePriceRequest$zodSchema
58899
59062
  };
58900
59063
  tool$pricesCreatePrice = {
@@ -58909,9 +59072,9 @@ Use when adding a new price to a plan or catalog (e.g. per-seat, flat, or metere
58909
59072
  openWorldHint: false,
58910
59073
  readOnlyHint: false
58911
59074
  },
58912
- args: args37,
58913
- tool: async (client, args38, ctx) => {
58914
- const [result] = await pricesCreatePrice(client, args38.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59075
+ args: args38,
59076
+ tool: async (client, args39, ctx) => {
59077
+ const [result] = await pricesCreatePrice(client, args39.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
58915
59078
  if (!result.ok) {
58916
59079
  return {
58917
59080
  content: [{ type: "text", text: result.error.message }],
@@ -58935,9 +59098,9 @@ var init_dtocreatebulkpricerequest = __esm(() => {
58935
59098
 
58936
59099
  // src/funcs/pricesCreatePricesBulk.ts
58937
59100
  function pricesCreatePricesBulk(client$, request, options) {
58938
- return new APIPromise($do39(client$, request, options));
59101
+ return new APIPromise($do40(client$, request, options));
58939
59102
  }
58940
- async function $do39(client$, request, options) {
59103
+ async function $do40(client$, request, options) {
58941
59104
  const parsed$ = safeParse4(request, (value$) => DtoCreateBulkPriceRequest$zodSchema.parse(value$), "Input validation failed");
58942
59105
  if (!parsed$.ok) {
58943
59106
  return [parsed$, { status: "invalid" }];
@@ -59007,12 +59170,12 @@ var init_pricesCreatePricesBulk = __esm(() => {
59007
59170
  });
59008
59171
 
59009
59172
  // src/mcp-server/tools/pricesCreatePricesBulk.ts
59010
- var args38, tool$pricesCreatePricesBulk;
59173
+ var args39, tool$pricesCreatePricesBulk;
59011
59174
  var init_pricesCreatePricesBulk2 = __esm(() => {
59012
59175
  init_pricesCreatePricesBulk();
59013
59176
  init_dtocreatebulkpricerequest();
59014
59177
  init_tools();
59015
- args38 = {
59178
+ args39 = {
59016
59179
  request: DtoCreateBulkPriceRequest$zodSchema
59017
59180
  };
59018
59181
  tool$pricesCreatePricesBulk = {
@@ -59027,9 +59190,9 @@ Use when creating many prices at once (e.g. importing a catalog or setting up a
59027
59190
  openWorldHint: false,
59028
59191
  readOnlyHint: false
59029
59192
  },
59030
- args: args38,
59031
- tool: async (client, args39, ctx) => {
59032
- const [result] = await pricesCreatePricesBulk(client, args39.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59193
+ args: args39,
59194
+ tool: async (client, args40, ctx) => {
59195
+ const [result] = await pricesCreatePricesBulk(client, args40.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59033
59196
  if (!result.ok) {
59034
59197
  return {
59035
59198
  content: [{ type: "text", text: result.error.message }],
@@ -59069,9 +59232,9 @@ var init_deletepriceop = __esm(() => {
59069
59232
 
59070
59233
  // src/funcs/pricesDeletePrice.ts
59071
59234
  function pricesDeletePrice(client$, request, options) {
59072
- return new APIPromise($do40(client$, request, options));
59235
+ return new APIPromise($do41(client$, request, options));
59073
59236
  }
59074
- async function $do40(client$, request, options) {
59237
+ async function $do41(client$, request, options) {
59075
59238
  const parsed$ = safeParse4(request, (value$) => DeletePriceRequest$zodSchema.parse(value$), "Input validation failed");
59076
59239
  if (!parsed$.ok) {
59077
59240
  return [parsed$, { status: "invalid" }];
@@ -59147,12 +59310,12 @@ var init_pricesDeletePrice = __esm(() => {
59147
59310
  });
59148
59311
 
59149
59312
  // src/mcp-server/tools/pricesDeletePrice.ts
59150
- var args39, tool$pricesDeletePrice;
59313
+ var args40, tool$pricesDeletePrice;
59151
59314
  var init_pricesDeletePrice2 = __esm(() => {
59152
59315
  init_pricesDeletePrice();
59153
59316
  init_deletepriceop();
59154
59317
  init_tools();
59155
- args39 = {
59318
+ args40 = {
59156
59319
  request: DeletePriceRequest$zodSchema
59157
59320
  };
59158
59321
  tool$pricesDeletePrice = {
@@ -59167,9 +59330,9 @@ Use when retiring a price (e.g. end-of-life or replacement). Optional effective
59167
59330
  openWorldHint: false,
59168
59331
  readOnlyHint: false
59169
59332
  },
59170
- args: args39,
59171
- tool: async (client, args40, ctx) => {
59172
- const [result] = await pricesDeletePrice(client, args40.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59333
+ args: args40,
59334
+ tool: async (client, args41, ctx) => {
59335
+ const [result] = await pricesDeletePrice(client, args41.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59173
59336
  if (!result.ok) {
59174
59337
  return {
59175
59338
  content: [{ type: "text", text: result.error.message }],
@@ -59198,9 +59361,9 @@ var init_getpriceop = __esm(() => {
59198
59361
 
59199
59362
  // src/funcs/pricesGetPrice.ts
59200
59363
  function pricesGetPrice(client$, request, options) {
59201
- return new APIPromise($do41(client$, request, options));
59364
+ return new APIPromise($do42(client$, request, options));
59202
59365
  }
59203
- async function $do41(client$, request, options) {
59366
+ async function $do42(client$, request, options) {
59204
59367
  const parsed$ = safeParse4(request, (value$) => GetPriceRequest$zodSchema.parse(value$), "Input validation failed");
59205
59368
  if (!parsed$.ok) {
59206
59369
  return [parsed$, { status: "invalid" }];
@@ -59275,12 +59438,12 @@ var init_pricesGetPrice = __esm(() => {
59275
59438
  });
59276
59439
 
59277
59440
  // src/mcp-server/tools/pricesGetPrice.ts
59278
- var args40, tool$pricesGetPrice;
59441
+ var args41, tool$pricesGetPrice;
59279
59442
  var init_pricesGetPrice2 = __esm(() => {
59280
59443
  init_pricesGetPrice();
59281
59444
  init_getpriceop();
59282
59445
  init_tools();
59283
- args40 = {
59446
+ args41 = {
59284
59447
  request: GetPriceRequest$zodSchema
59285
59448
  };
59286
59449
  tool$pricesGetPrice = {
@@ -59295,9 +59458,9 @@ Use when you need to load a single price (e.g. for display or editing). Response
59295
59458
  openWorldHint: false,
59296
59459
  readOnlyHint: false
59297
59460
  },
59298
- args: args40,
59299
- tool: async (client, args41, ctx) => {
59300
- const [result] = await pricesGetPrice(client, args41.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59461
+ args: args41,
59462
+ tool: async (client, args42, ctx) => {
59463
+ const [result] = await pricesGetPrice(client, args42.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59301
59464
  if (!result.ok) {
59302
59465
  return {
59303
59466
  content: [{ type: "text", text: result.error.message }],
@@ -59326,9 +59489,9 @@ var init_getpricebylookupkeyop = __esm(() => {
59326
59489
 
59327
59490
  // src/funcs/pricesGetPriceByLookupKey.ts
59328
59491
  function pricesGetPriceByLookupKey(client$, request, options) {
59329
- return new APIPromise($do42(client$, request, options));
59492
+ return new APIPromise($do43(client$, request, options));
59330
59493
  }
59331
- async function $do42(client$, request, options) {
59494
+ async function $do43(client$, request, options) {
59332
59495
  const parsed$ = safeParse4(request, (value$) => GetPriceByLookupKeyRequest$zodSchema.parse(value$), "Input validation failed");
59333
59496
  if (!parsed$.ok) {
59334
59497
  return [parsed$, { status: "invalid" }];
@@ -59403,12 +59566,12 @@ var init_pricesGetPriceByLookupKey = __esm(() => {
59403
59566
  });
59404
59567
 
59405
59568
  // src/mcp-server/tools/pricesGetPriceByLookupKey.ts
59406
- var args41, tool$pricesGetPriceByLookupKey;
59569
+ var args42, tool$pricesGetPriceByLookupKey;
59407
59570
  var init_pricesGetPriceByLookupKey2 = __esm(() => {
59408
59571
  init_pricesGetPriceByLookupKey();
59409
59572
  init_getpricebylookupkeyop();
59410
59573
  init_tools();
59411
- args41 = {
59574
+ args42 = {
59412
59575
  request: GetPriceByLookupKeyRequest$zodSchema
59413
59576
  };
59414
59577
  tool$pricesGetPriceByLookupKey = {
@@ -59423,9 +59586,9 @@ Use when resolving a price by external id (e.g. from your catalog or CMS). Ideal
59423
59586
  openWorldHint: false,
59424
59587
  readOnlyHint: false
59425
59588
  },
59426
- args: args41,
59427
- tool: async (client, args42, ctx) => {
59428
- const [result] = await pricesGetPriceByLookupKey(client, args42.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59589
+ args: args42,
59590
+ tool: async (client, args43, ctx) => {
59591
+ const [result] = await pricesGetPriceByLookupKey(client, args43.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59429
59592
  if (!result.ok) {
59430
59593
  return {
59431
59594
  content: [{ type: "text", text: result.error.message }],
@@ -59472,9 +59635,9 @@ var init_pricefilter = __esm(() => {
59472
59635
 
59473
59636
  // src/funcs/pricesQueryPrice.ts
59474
59637
  function pricesQueryPrice(client$, request, options) {
59475
- return new APIPromise($do43(client$, request, options));
59638
+ return new APIPromise($do44(client$, request, options));
59476
59639
  }
59477
- async function $do43(client$, request, options) {
59640
+ async function $do44(client$, request, options) {
59478
59641
  const parsed$ = safeParse4(request, (value$) => PriceFilter$zodSchema.parse(value$), "Input validation failed");
59479
59642
  if (!parsed$.ok) {
59480
59643
  return [parsed$, { status: "invalid" }];
@@ -59544,12 +59707,12 @@ var init_pricesQueryPrice = __esm(() => {
59544
59707
  });
59545
59708
 
59546
59709
  // src/mcp-server/tools/pricesQueryPrice.ts
59547
- var args42, tool$pricesQueryPrice;
59710
+ var args43, tool$pricesQueryPrice;
59548
59711
  var init_pricesQueryPrice2 = __esm(() => {
59549
59712
  init_pricesQueryPrice();
59550
59713
  init_pricefilter();
59551
59714
  init_tools();
59552
- args42 = {
59715
+ args43 = {
59553
59716
  request: PriceFilter$zodSchema
59554
59717
  };
59555
59718
  tool$pricesQueryPrice = {
@@ -59564,9 +59727,9 @@ Use when listing or searching prices (e.g. plan builder or catalog). Returns a p
59564
59727
  openWorldHint: false,
59565
59728
  readOnlyHint: false
59566
59729
  },
59567
- args: args42,
59568
- tool: async (client, args43, ctx) => {
59569
- const [result] = await pricesQueryPrice(client, args43.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59730
+ args: args43,
59731
+ tool: async (client, args44, ctx) => {
59732
+ const [result] = await pricesQueryPrice(client, args44.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59570
59733
  if (!result.ok) {
59571
59734
  return {
59572
59735
  content: [{ type: "text", text: result.error.message }],
@@ -59622,9 +59785,9 @@ var init_updatepriceop = __esm(() => {
59622
59785
 
59623
59786
  // src/funcs/pricesUpdatePrice.ts
59624
59787
  function pricesUpdatePrice(client$, request, options) {
59625
- return new APIPromise($do44(client$, request, options));
59788
+ return new APIPromise($do45(client$, request, options));
59626
59789
  }
59627
- async function $do44(client$, request, options) {
59790
+ async function $do45(client$, request, options) {
59628
59791
  const parsed$ = safeParse4(request, (value$) => UpdatePriceRequest$zodSchema.parse(value$), "Input validation failed");
59629
59792
  if (!parsed$.ok) {
59630
59793
  return [parsed$, { status: "invalid" }];
@@ -59700,12 +59863,12 @@ var init_pricesUpdatePrice = __esm(() => {
59700
59863
  });
59701
59864
 
59702
59865
  // src/mcp-server/tools/pricesUpdatePrice.ts
59703
- var args43, tool$pricesUpdatePrice;
59866
+ var args44, tool$pricesUpdatePrice;
59704
59867
  var init_pricesUpdatePrice2 = __esm(() => {
59705
59868
  init_pricesUpdatePrice();
59706
59869
  init_updatepriceop();
59707
59870
  init_tools();
59708
- args43 = {
59871
+ args44 = {
59709
59872
  request: UpdatePriceRequest$zodSchema
59710
59873
  };
59711
59874
  tool$pricesUpdatePrice = {
@@ -59720,9 +59883,9 @@ Use when changing price configuration (e.g. amount, billing scheme, or metadata)
59720
59883
  openWorldHint: false,
59721
59884
  readOnlyHint: false
59722
59885
  },
59723
- args: args43,
59724
- tool: async (client, args44, ctx) => {
59725
- const [result] = await pricesUpdatePrice(client, args44.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59886
+ args: args44,
59887
+ tool: async (client, args45, ctx) => {
59888
+ const [result] = await pricesUpdatePrice(client, args45.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
59726
59889
  if (!result.ok) {
59727
59890
  return {
59728
59891
  content: [{ type: "text", text: result.error.message }],
@@ -59738,16 +59901,16 @@ Use when changing price configuration (e.g. amount, billing scheme, or metadata)
59738
59901
  function createMCPServer(deps) {
59739
59902
  const server = new McpServer({
59740
59903
  name: "Flexprice",
59741
- version: "2.0.1"
59904
+ version: "2.0.3"
59742
59905
  });
59743
59906
  const getClient = deps.getSDK || (() => new FlexpriceCore({
59744
59907
  security: deps.security,
59745
59908
  serverURL: deps.serverURL,
59746
59909
  serverIdx: deps.serverIdx,
59747
59910
  debugLogger: deps.logger.level === "debug" ? {
59748
- log: (...args44) => console.log(...args44),
59749
- group: (...args44) => console.group(...args44),
59750
- groupEnd: (...args44) => console.groupEnd(...args44)
59911
+ log: (...args45) => console.log(...args45),
59912
+ group: (...args45) => console.group(...args45),
59913
+ groupEnd: (...args45) => console.groupEnd(...args45)
59751
59914
  } : undefined
59752
59915
  }));
59753
59916
  const scopes = new Set(deps.scopes);
@@ -59778,6 +59941,7 @@ function createMCPServer(deps) {
59778
59941
  tool(tool$invoicesAttemptInvoicePayment);
59779
59942
  tool(tool$invoicesGetInvoicePdf);
59780
59943
  tool(tool$invoicesRecalculateInvoice);
59944
+ tool(tool$invoicesRecalculateInvoiceV2);
59781
59945
  tool(tool$invoicesVoidInvoice);
59782
59946
  tool(tool$eventsIngestEvent);
59783
59947
  tool(tool$eventsGetUsageAnalytics);
@@ -59837,6 +60001,7 @@ var init_server2 = __esm(() => {
59837
60001
  init_invoicesGetInvoicePreview2();
59838
60002
  init_invoicesQueryInvoice2();
59839
60003
  init_invoicesRecalculateInvoice2();
60004
+ init_invoicesRecalculateInvoiceV22();
59840
60005
  init_invoicesTriggerInvoiceCommsWebhook2();
59841
60006
  init_invoicesUpdateInvoice2();
59842
60007
  init_invoicesUpdateInvoicePaymentStatus2();
@@ -59983,9 +60148,15 @@ Use when delivering an invoice PDF to the customer (e.g. email attachment or dow
59983
60148
  },
59984
60149
  {
59985
60150
  name: "recalculate-invoice",
59986
- description: `Recalculate invoice
60151
+ description: `Recalculate invoice (voided invoice)
59987
60152
 
59988
- Use when subscription or usage data changed and you need to refresh a draft invoice before finalizing. Optional finalize=true to lock after recalc.`
60153
+ Starts an async workflow that creates a fresh replacement invoice for a voided SUBSCRIPTION invoice (same billing period). Returns workflow_id and run_id; poll workflow status or GET the new invoice via recalculated_invoice_id after completion.`
60154
+ },
60155
+ {
60156
+ name: "recalculate-invoice-v2",
60157
+ description: `Recalculate draft invoice (v2)
60158
+
60159
+ Recalculates a draft SUBSCRIPTION invoice in-place (replaces line items, reapplies credits/coupons/taxes). Use when subscription or usage data changed before finalizing.`
59989
60160
  },
59990
60161
  {
59991
60162
  name: "void-invoice",
@@ -60142,18 +60313,18 @@ function landingPageHTML(origin) {
60142
60313
  "mcp-remote@0.1.25",
60143
60314
  `${o}/sse`,
60144
60315
  "--header",
60145
- "server-url:${SERVER_URL}",
60316
+ "server-index:${SERVER_INDEX}",
60146
60317
  "--header",
60147
60318
  "api-key-auth:${API_KEY_AUTH}"
60148
60319
  ],
60149
60320
  env: {
60150
- SERVER_URL: "YOUR_VALUE_HERE",
60321
+ SERVER_INDEX: "YOUR_VALUE_HERE",
60151
60322
  API_KEY_AUTH: "YOUR_VALUE_HERE"
60152
60323
  }
60153
60324
  };
60154
60325
  const codexConfig = `[mcp_servers.Flexprice]
60155
60326
  url = "${o}/sse"
60156
- http_headers = { "server-url" = "YOUR_SERVER_URL", "api-key-auth" = "YOUR_API_KEY_AUTH" }`;
60327
+ http_headers = { "server-index" = "YOUR_SERVER_INDEX", "api-key-auth" = "YOUR_API_KEY_AUTH" }`;
60157
60328
  return `
60158
60329
  <!DOCTYPE html>
60159
60330
  <html lang="en">
@@ -60790,7 +60961,7 @@ http_headers = { "server-url" = "YOUR_SERVER_URL", "api-key-auth" = "YOUR_API_KE
60790
60961
  </svg>
60791
60962
  </button>
60792
60963
  <div class="popover-menu hidden" id="popover-menu">
60793
- <a class="popover-button install-link" href="cursor://anysphere.cursor-deeplink/mcp/install?name=Flexprice&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyJAZmxleHByaWNlL21jcC1zZXJ2ZXIiLCJzdGFydCIsIi0tc2VydmVyLXVybCIsIiIsIi0tYXBpLWtleS1hdXRoIiwiIl19">
60964
+ <a class="popover-button install-link" href="cursor://anysphere.cursor-deeplink/mcp/install?name=Flexprice&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyJAZmxleHByaWNlL21jcC1zZXJ2ZXIiLCJzdGFydCIsIi0tc2VydmVyLWluZGV4IiwiMCIsIi0tYXBpLWtleS1hdXRoIiwiIl19">
60794
60965
  Cursor
60795
60966
  </a>
60796
60967
  <button class="popover-button" onclick="showModal('claude-code')">
@@ -60799,7 +60970,7 @@ http_headers = { "server-url" = "YOUR_SERVER_URL", "api-key-auth" = "YOUR_API_KE
60799
60970
  <button class="popover-button" onclick="showModal('claude-desktop')">
60800
60971
  Claude Desktop
60801
60972
  </button>
60802
- <a class="popover-button install-link" href="vscode://ms-vscode.vscode-mcp/install?name=Flexprice&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyJAZmxleHByaWNlL21jcC1zZXJ2ZXIiLCJzdGFydCIsIi0tc2VydmVyLXVybCIsIiIsIi0tYXBpLWtleS1hdXRoIiwiIl19">
60973
+ <a class="popover-button install-link" href="vscode://ms-vscode.vscode-mcp/install?name=Flexprice&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyJAZmxleHByaWNlL21jcC1zZXJ2ZXIiLCJzdGFydCIsIi0tc2VydmVyLWluZGV4IiwiMCIsIi0tYXBpLWtleS1hdXRoIiwiIl19">
60803
60974
  VS Code
60804
60975
  </a>
60805
60976
  <button class="popover-button" onclick="showModal('gemini')">
@@ -60822,7 +60993,7 @@ http_headers = { "server-url" = "YOUR_SERVER_URL", "api-key-auth" = "YOUR_API_KE
60822
60993
  </div>
60823
60994
  </header>
60824
60995
  <div class="install-targets">
60825
- <a tabindex="0" class="card install-target install-link" href="cursor://anysphere.cursor-deeplink/mcp/install?name=Flexprice&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyJAZmxleHByaWNlL21jcC1zZXJ2ZXIiLCJzdGFydCIsIi0tc2VydmVyLXVybCIsIiIsIi0tYXBpLWtleS1hdXRoIiwiIl19">
60996
+ <a tabindex="0" class="card install-target install-link" href="cursor://anysphere.cursor-deeplink/mcp/install?name=Flexprice&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyJAZmxleHByaWNlL21jcC1zZXJ2ZXIiLCJzdGFydCIsIi0tc2VydmVyLWluZGV4IiwiMCIsIi0tYXBpLWtleS1hdXRoIiwiIl19">
60826
60997
  <div class="target">
60827
60998
  <img src="https://cursor.com/assets/images/logo.svg" alt="Cursor">
60828
60999
  <span>Cursor</span>
@@ -60844,7 +61015,7 @@ http_headers = { "server-url" = "YOUR_SERVER_URL", "api-key-auth" = "YOUR_API_KE
60844
61015
  <span>Claude Desktop</span>
60845
61016
  </div>
60846
61017
  </div>
60847
- <a tabindex="0" class="card install-target install-link" href="vscode://ms-vscode.vscode-mcp/install?name=Flexprice&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyJAZmxleHByaWNlL21jcC1zZXJ2ZXIiLCJzdGFydCIsIi0tc2VydmVyLXVybCIsIiIsIi0tYXBpLWtleS1hdXRoIiwiIl19">
61018
+ <a tabindex="0" class="card install-target install-link" href="vscode://ms-vscode.vscode-mcp/install?name=Flexprice&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyJAZmxleHByaWNlL21jcC1zZXJ2ZXIiLCJzdGFydCIsIi0tc2VydmVyLWluZGV4IiwiMCIsIi0tYXBpLWtleS1hdXRoIiwiIl19">
60848
61019
  <div class="target">
60849
61020
  <svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
60850
61021
  <mask id="mask0" mask-type="alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="100" height="100">
@@ -61015,7 +61186,7 @@ http_headers = { "server-url" = "YOUR_SERVER_URL", "api-key-auth" = "YOUR_API_KE
61015
61186
  <path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path>
61016
61187
  </svg>
61017
61188
  </button>
61018
- <code class="code-snippet language-json" id="claude-cli-cmd">claude mcp add Flexprice -- npx -y @flexprice/mcp-server start --server-url --api-key-auth </code>
61189
+ <code class="code-snippet language-json" id="claude-cli-cmd">claude mcp add Flexprice -- npx -y @flexprice/mcp-server start --server-index 0 --api-key-auth </code>
61019
61190
  </div>
61020
61191
  </div>
61021
61192
  </div>
@@ -61066,7 +61237,7 @@ http_headers = { "server-url" = "YOUR_SERVER_URL", "api-key-auth" = "YOUR_API_KE
61066
61237
  <path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path>
61067
61238
  </svg>
61068
61239
  </button>
61069
- <code class="code-snippet language-json" id="gemini-config">gemini mcp add Flexprice -- npx -y @flexprice/mcp-server start --server-url --api-key-auth </code>
61240
+ <code class="code-snippet language-json" id="gemini-config">gemini mcp add Flexprice -- npx -y @flexprice/mcp-server start --server-index 0 --api-key-auth </code>
61070
61241
  </div>
61071
61242
  </div>
61072
61243
  </div>
@@ -63484,7 +63655,7 @@ var serveCommand = buildCommand({
63484
63655
  "server-url": {
63485
63656
  kind: "parsed",
63486
63657
  brief: "Overrides the default server URL used by the SDK",
63487
- optional: false,
63658
+ optional: true,
63488
63659
  parse: (value) => new URL(value).toString()
63489
63660
  },
63490
63661
  "server-index": {
@@ -63576,7 +63747,7 @@ var startCommand = buildCommand({
63576
63747
  "server-url": {
63577
63748
  kind: "parsed",
63578
63749
  brief: "Overrides the default server URL used by the SDK",
63579
- optional: false,
63750
+ optional: true,
63580
63751
  parse: (value) => new URL(value).toString()
63581
63752
  },
63582
63753
  "server-index": {
@@ -63633,7 +63804,7 @@ var routes = buildRouteMap({
63633
63804
  var app = buildApplication(routes, {
63634
63805
  name: "mcp",
63635
63806
  versionInfo: {
63636
- currentVersion: "2.0.1"
63807
+ currentVersion: "2.0.3"
63637
63808
  }
63638
63809
  });
63639
63810
  run(app, process4.argv.slice(2), buildContext(process4));
@@ -63641,5 +63812,5 @@ export {
63641
63812
  app
63642
63813
  };
63643
63814
 
63644
- //# debugId=7FE099CBDBA4198164756E2164756E21
63815
+ //# debugId=674E2BD63E511D5D64756E2164756E21
63645
63816
  //# sourceMappingURL=mcp-server.js.map