@metronome/mcp 3.0.0 → 3.5.0

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 (146) hide show
  1. package/README.md +3 -3
  2. package/auth.d.mts +6 -0
  3. package/auth.d.mts.map +1 -0
  4. package/auth.d.ts +6 -0
  5. package/auth.d.ts.map +1 -0
  6. package/auth.js +37 -0
  7. package/auth.js.map +1 -0
  8. package/{headers.js → auth.mjs} +16 -6
  9. package/auth.mjs.map +1 -0
  10. package/code-tool-paths.cjs +8 -0
  11. package/code-tool-paths.cjs.map +1 -0
  12. package/code-tool-paths.d.cts +2 -0
  13. package/code-tool-paths.d.cts.map +1 -0
  14. package/code-tool-types.d.mts.map +1 -1
  15. package/code-tool-types.d.ts.map +1 -1
  16. package/code-tool-worker.d.mts +5 -0
  17. package/code-tool-worker.d.mts.map +1 -0
  18. package/code-tool-worker.d.ts +5 -0
  19. package/code-tool-worker.d.ts.map +1 -0
  20. package/code-tool-worker.js +383 -0
  21. package/code-tool-worker.js.map +1 -0
  22. package/code-tool-worker.mjs +345 -0
  23. package/code-tool-worker.mjs.map +1 -0
  24. package/code-tool.d.mts +11 -2
  25. package/code-tool.d.mts.map +1 -1
  26. package/code-tool.d.ts +11 -2
  27. package/code-tool.d.ts.map +1 -1
  28. package/code-tool.js +283 -41
  29. package/code-tool.js.map +1 -1
  30. package/code-tool.mjs +251 -42
  31. package/code-tool.mjs.map +1 -1
  32. package/docs-search-tool.d.mts +11 -3
  33. package/docs-search-tool.d.mts.map +1 -1
  34. package/docs-search-tool.d.ts +11 -3
  35. package/docs-search-tool.d.ts.map +1 -1
  36. package/docs-search-tool.js +58 -5
  37. package/docs-search-tool.js.map +1 -1
  38. package/docs-search-tool.mjs +57 -5
  39. package/docs-search-tool.mjs.map +1 -1
  40. package/http.d.mts +6 -3
  41. package/http.d.mts.map +1 -1
  42. package/http.d.ts +6 -3
  43. package/http.d.ts.map +1 -1
  44. package/http.js +130 -28
  45. package/http.js.map +1 -1
  46. package/http.mjs +130 -28
  47. package/http.mjs.map +1 -1
  48. package/index.js +17 -12
  49. package/index.js.map +1 -1
  50. package/index.mjs +17 -12
  51. package/index.mjs.map +1 -1
  52. package/instructions.d.mts +5 -0
  53. package/instructions.d.mts.map +1 -0
  54. package/instructions.d.ts +5 -0
  55. package/instructions.d.ts.map +1 -0
  56. package/instructions.js +61 -0
  57. package/instructions.js.map +1 -0
  58. package/instructions.mjs +55 -0
  59. package/instructions.mjs.map +1 -0
  60. package/local-docs-search.d.mts +28 -0
  61. package/local-docs-search.d.mts.map +1 -0
  62. package/local-docs-search.d.ts +28 -0
  63. package/local-docs-search.d.ts.map +1 -0
  64. package/local-docs-search.js +4780 -0
  65. package/local-docs-search.js.map +1 -0
  66. package/local-docs-search.mjs +4740 -0
  67. package/local-docs-search.mjs.map +1 -0
  68. package/logger.d.mts +7 -0
  69. package/logger.d.mts.map +1 -0
  70. package/logger.d.ts +7 -0
  71. package/logger.d.ts.map +1 -0
  72. package/logger.js +29 -0
  73. package/logger.js.map +1 -0
  74. package/logger.mjs +22 -0
  75. package/logger.mjs.map +1 -0
  76. package/methods.d.mts +10 -0
  77. package/methods.d.mts.map +1 -0
  78. package/methods.d.ts +10 -0
  79. package/methods.d.ts.map +1 -0
  80. package/methods.js +767 -0
  81. package/methods.js.map +1 -0
  82. package/methods.mjs +763 -0
  83. package/methods.mjs.map +1 -0
  84. package/options.d.mts +12 -0
  85. package/options.d.mts.map +1 -1
  86. package/options.d.ts +12 -0
  87. package/options.d.ts.map +1 -1
  88. package/options.js +81 -12
  89. package/options.js.map +1 -1
  90. package/options.mjs +81 -12
  91. package/options.mjs.map +1 -1
  92. package/package.json +89 -15
  93. package/server.d.mts +18 -10
  94. package/server.d.mts.map +1 -1
  95. package/server.d.ts +18 -10
  96. package/server.d.ts.map +1 -1
  97. package/server.js +89 -42
  98. package/server.js.map +1 -1
  99. package/server.mjs +88 -39
  100. package/server.mjs.map +1 -1
  101. package/src/{headers.ts → auth.ts} +18 -1
  102. package/src/code-tool-paths.cts +5 -0
  103. package/src/code-tool-types.ts +1 -0
  104. package/src/code-tool-worker.ts +396 -0
  105. package/src/code-tool.ts +337 -49
  106. package/src/docs-search-tool.ts +86 -7
  107. package/src/http.ts +154 -33
  108. package/src/index.ts +19 -13
  109. package/src/instructions.ts +83 -0
  110. package/src/local-docs-search.ts +5674 -0
  111. package/src/logger.ts +28 -0
  112. package/src/methods.ts +788 -0
  113. package/src/options.ts +105 -12
  114. package/src/server.ts +111 -50
  115. package/src/stdio.ts +9 -4
  116. package/src/types.ts +15 -4
  117. package/src/util.ts +25 -0
  118. package/stdio.d.mts +2 -1
  119. package/stdio.d.mts.map +1 -1
  120. package/stdio.d.ts +2 -1
  121. package/stdio.d.ts.map +1 -1
  122. package/stdio.js +8 -4
  123. package/stdio.js.map +1 -1
  124. package/stdio.mjs +8 -4
  125. package/stdio.mjs.map +1 -1
  126. package/types.d.mts +14 -1
  127. package/types.d.mts.map +1 -1
  128. package/types.d.ts +14 -1
  129. package/types.d.ts.map +1 -1
  130. package/types.js.map +1 -1
  131. package/types.mjs.map +1 -1
  132. package/util.d.mts +4 -0
  133. package/util.d.mts.map +1 -0
  134. package/util.d.ts +4 -0
  135. package/util.d.ts.map +1 -0
  136. package/util.js +30 -0
  137. package/util.js.map +1 -0
  138. package/util.mjs +24 -0
  139. package/util.mjs.map +1 -0
  140. package/headers.d.mts +0 -4
  141. package/headers.d.mts.map +0 -1
  142. package/headers.d.ts +0 -4
  143. package/headers.d.ts.map +0 -1
  144. package/headers.js.map +0 -1
  145. package/headers.mjs +0 -18
  146. package/headers.mjs.map +0 -1
package/src/methods.ts ADDED
@@ -0,0 +1,788 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { McpOptions } from './options';
4
+
5
+ export type SdkMethod = {
6
+ clientCallName: string;
7
+ fullyQualifiedName: string;
8
+ httpMethod?: 'get' | 'post' | 'put' | 'patch' | 'delete' | 'query';
9
+ httpPath?: string;
10
+ };
11
+
12
+ export const sdkMethods: SdkMethod[] = [
13
+ {
14
+ clientCallName: 'client.v2.contracts.retrieve',
15
+ fullyQualifiedName: 'v2.contracts.retrieve',
16
+ httpMethod: 'post',
17
+ httpPath: '/v2/contracts/get',
18
+ },
19
+ {
20
+ clientCallName: 'client.v2.contracts.list',
21
+ fullyQualifiedName: 'v2.contracts.list',
22
+ httpMethod: 'post',
23
+ httpPath: '/v2/contracts/list',
24
+ },
25
+ {
26
+ clientCallName: 'client.v2.contracts.edit',
27
+ fullyQualifiedName: 'v2.contracts.edit',
28
+ httpMethod: 'post',
29
+ httpPath: '/v2/contracts/edit',
30
+ },
31
+ {
32
+ clientCallName: 'client.v2.contracts.editCommit',
33
+ fullyQualifiedName: 'v2.contracts.editCommit',
34
+ httpMethod: 'post',
35
+ httpPath: '/v2/contracts/commits/edit',
36
+ },
37
+ {
38
+ clientCallName: 'client.v2.contracts.editCredit',
39
+ fullyQualifiedName: 'v2.contracts.editCredit',
40
+ httpMethod: 'post',
41
+ httpPath: '/v2/contracts/credits/edit',
42
+ },
43
+ {
44
+ clientCallName: 'client.v2.contracts.getEditHistory',
45
+ fullyQualifiedName: 'v2.contracts.getEditHistory',
46
+ httpMethod: 'post',
47
+ httpPath: '/v2/contracts/getEditHistory',
48
+ },
49
+ {
50
+ clientCallName: 'client.v1.alerts.create',
51
+ fullyQualifiedName: 'v1.alerts.create',
52
+ httpMethod: 'post',
53
+ httpPath: '/v1/alerts/create',
54
+ },
55
+ {
56
+ clientCallName: 'client.v1.alerts.archive',
57
+ fullyQualifiedName: 'v1.alerts.archive',
58
+ httpMethod: 'post',
59
+ httpPath: '/v1/alerts/archive',
60
+ },
61
+ {
62
+ clientCallName: 'client.v1.plans.list',
63
+ fullyQualifiedName: 'v1.plans.list',
64
+ httpMethod: 'get',
65
+ httpPath: '/v1/plans',
66
+ },
67
+ {
68
+ clientCallName: 'client.v1.plans.getDetails',
69
+ fullyQualifiedName: 'v1.plans.getDetails',
70
+ httpMethod: 'get',
71
+ httpPath: '/v1/planDetails/{plan_id}',
72
+ },
73
+ {
74
+ clientCallName: 'client.v1.plans.listCharges',
75
+ fullyQualifiedName: 'v1.plans.listCharges',
76
+ httpMethod: 'get',
77
+ httpPath: '/v1/planDetails/{plan_id}/charges',
78
+ },
79
+ {
80
+ clientCallName: 'client.v1.plans.listCustomers',
81
+ fullyQualifiedName: 'v1.plans.listCustomers',
82
+ httpMethod: 'get',
83
+ httpPath: '/v1/planDetails/{plan_id}/customers',
84
+ },
85
+ {
86
+ clientCallName: 'client.v1.creditGrants.create',
87
+ fullyQualifiedName: 'v1.creditGrants.create',
88
+ httpMethod: 'post',
89
+ httpPath: '/v1/credits/createGrant',
90
+ },
91
+ {
92
+ clientCallName: 'client.v1.creditGrants.list',
93
+ fullyQualifiedName: 'v1.creditGrants.list',
94
+ httpMethod: 'post',
95
+ httpPath: '/v1/credits/listGrants',
96
+ },
97
+ {
98
+ clientCallName: 'client.v1.creditGrants.edit',
99
+ fullyQualifiedName: 'v1.creditGrants.edit',
100
+ httpMethod: 'post',
101
+ httpPath: '/v1/credits/editGrant',
102
+ },
103
+ {
104
+ clientCallName: 'client.v1.creditGrants.listEntries',
105
+ fullyQualifiedName: 'v1.creditGrants.listEntries',
106
+ httpMethod: 'post',
107
+ httpPath: '/v1/credits/listEntries',
108
+ },
109
+ {
110
+ clientCallName: 'client.v1.creditGrants.void',
111
+ fullyQualifiedName: 'v1.creditGrants.void',
112
+ httpMethod: 'post',
113
+ httpPath: '/v1/credits/voidGrant',
114
+ },
115
+ {
116
+ clientCallName: 'client.v1.pricingUnits.list',
117
+ fullyQualifiedName: 'v1.pricingUnits.list',
118
+ httpMethod: 'get',
119
+ httpPath: '/v1/credit-types/list',
120
+ },
121
+ {
122
+ clientCallName: 'client.v1.customers.create',
123
+ fullyQualifiedName: 'v1.customers.create',
124
+ httpMethod: 'post',
125
+ httpPath: '/v1/customers',
126
+ },
127
+ {
128
+ clientCallName: 'client.v1.customers.retrieve',
129
+ fullyQualifiedName: 'v1.customers.retrieve',
130
+ httpMethod: 'get',
131
+ httpPath: '/v1/customers/{customer_id}',
132
+ },
133
+ {
134
+ clientCallName: 'client.v1.customers.list',
135
+ fullyQualifiedName: 'v1.customers.list',
136
+ httpMethod: 'get',
137
+ httpPath: '/v1/customers',
138
+ },
139
+ {
140
+ clientCallName: 'client.v1.customers.archive',
141
+ fullyQualifiedName: 'v1.customers.archive',
142
+ httpMethod: 'post',
143
+ httpPath: '/v1/customers/archive',
144
+ },
145
+ {
146
+ clientCallName: 'client.v1.customers.archiveBillingConfigurations',
147
+ fullyQualifiedName: 'v1.customers.archiveBillingConfigurations',
148
+ httpMethod: 'post',
149
+ httpPath: '/v1/archiveCustomerBillingProviderConfigurations',
150
+ },
151
+ {
152
+ clientCallName: 'client.v1.customers.listBillableMetrics',
153
+ fullyQualifiedName: 'v1.customers.listBillableMetrics',
154
+ httpMethod: 'get',
155
+ httpPath: '/v1/customers/{customer_id}/billable-metrics',
156
+ },
157
+ {
158
+ clientCallName: 'client.v1.customers.listCosts',
159
+ fullyQualifiedName: 'v1.customers.listCosts',
160
+ httpMethod: 'get',
161
+ httpPath: '/v1/customers/{customer_id}/costs',
162
+ },
163
+ {
164
+ clientCallName: 'client.v1.customers.previewEvents',
165
+ fullyQualifiedName: 'v1.customers.previewEvents',
166
+ httpMethod: 'post',
167
+ httpPath: '/v1/customers/{customer_id}/previewEvents',
168
+ },
169
+ {
170
+ clientCallName: 'client.v1.customers.retrieveBillingConfigurations',
171
+ fullyQualifiedName: 'v1.customers.retrieveBillingConfigurations',
172
+ httpMethod: 'post',
173
+ httpPath: '/v1/getCustomerBillingProviderConfigurations',
174
+ },
175
+ {
176
+ clientCallName: 'client.v1.customers.setBillingConfigurations',
177
+ fullyQualifiedName: 'v1.customers.setBillingConfigurations',
178
+ httpMethod: 'post',
179
+ httpPath: '/v1/setCustomerBillingProviderConfigurations',
180
+ },
181
+ {
182
+ clientCallName: 'client.v1.customers.setIngestAliases',
183
+ fullyQualifiedName: 'v1.customers.setIngestAliases',
184
+ httpMethod: 'post',
185
+ httpPath: '/v1/customers/{customer_id}/setIngestAliases',
186
+ },
187
+ {
188
+ clientCallName: 'client.v1.customers.setName',
189
+ fullyQualifiedName: 'v1.customers.setName',
190
+ httpMethod: 'post',
191
+ httpPath: '/v1/customers/{customer_id}/setName',
192
+ },
193
+ {
194
+ clientCallName: 'client.v1.customers.updateConfig',
195
+ fullyQualifiedName: 'v1.customers.updateConfig',
196
+ httpMethod: 'post',
197
+ httpPath: '/v1/customers/{customer_id}/updateConfig',
198
+ },
199
+ {
200
+ clientCallName: 'client.v1.customers.alerts.retrieve',
201
+ fullyQualifiedName: 'v1.customers.alerts.retrieve',
202
+ httpMethod: 'post',
203
+ httpPath: '/v1/customer-alerts/get',
204
+ },
205
+ {
206
+ clientCallName: 'client.v1.customers.alerts.list',
207
+ fullyQualifiedName: 'v1.customers.alerts.list',
208
+ httpMethod: 'post',
209
+ httpPath: '/v1/customer-alerts/list',
210
+ },
211
+ {
212
+ clientCallName: 'client.v1.customers.alerts.reset',
213
+ fullyQualifiedName: 'v1.customers.alerts.reset',
214
+ httpMethod: 'post',
215
+ httpPath: '/v1/customer-alerts/reset',
216
+ },
217
+ {
218
+ clientCallName: 'client.v1.customers.plans.list',
219
+ fullyQualifiedName: 'v1.customers.plans.list',
220
+ httpMethod: 'get',
221
+ httpPath: '/v1/customers/{customer_id}/plans',
222
+ },
223
+ {
224
+ clientCallName: 'client.v1.customers.plans.add',
225
+ fullyQualifiedName: 'v1.customers.plans.add',
226
+ httpMethod: 'post',
227
+ httpPath: '/v1/customers/{customer_id}/plans/add',
228
+ },
229
+ {
230
+ clientCallName: 'client.v1.customers.plans.end',
231
+ fullyQualifiedName: 'v1.customers.plans.end',
232
+ httpMethod: 'post',
233
+ httpPath: '/v1/customers/{customer_id}/plans/{customer_plan_id}/end',
234
+ },
235
+ {
236
+ clientCallName: 'client.v1.customers.plans.listPriceAdjustments',
237
+ fullyQualifiedName: 'v1.customers.plans.listPriceAdjustments',
238
+ httpMethod: 'get',
239
+ httpPath: '/v1/customers/{customer_id}/plans/{customer_plan_id}/priceAdjustments',
240
+ },
241
+ {
242
+ clientCallName: 'client.v1.customers.invoices.retrieve',
243
+ fullyQualifiedName: 'v1.customers.invoices.retrieve',
244
+ httpMethod: 'get',
245
+ httpPath: '/v1/customers/{customer_id}/invoices/{invoice_id}',
246
+ },
247
+ {
248
+ clientCallName: 'client.v1.customers.invoices.list',
249
+ fullyQualifiedName: 'v1.customers.invoices.list',
250
+ httpMethod: 'get',
251
+ httpPath: '/v1/customers/{customer_id}/invoices',
252
+ },
253
+ {
254
+ clientCallName: 'client.v1.customers.invoices.addCharge',
255
+ fullyQualifiedName: 'v1.customers.invoices.addCharge',
256
+ httpMethod: 'post',
257
+ httpPath: '/v1/customers/{customer_id}/addCharge',
258
+ },
259
+ {
260
+ clientCallName: 'client.v1.customers.invoices.listBreakdowns',
261
+ fullyQualifiedName: 'v1.customers.invoices.listBreakdowns',
262
+ httpMethod: 'get',
263
+ httpPath: '/v1/customers/{customer_id}/invoices/breakdowns',
264
+ },
265
+ {
266
+ clientCallName: 'client.v1.customers.invoices.retrievePdf',
267
+ fullyQualifiedName: 'v1.customers.invoices.retrievePdf',
268
+ httpMethod: 'get',
269
+ httpPath: '/v1/customers/{customer_id}/invoices/{invoice_id}/pdf',
270
+ },
271
+ {
272
+ clientCallName: 'client.v1.customers.billingConfig.create',
273
+ fullyQualifiedName: 'v1.customers.billingConfig.create',
274
+ httpMethod: 'post',
275
+ httpPath: '/v1/customers/{customer_id}/billing-config/{billing_provider_type}',
276
+ },
277
+ {
278
+ clientCallName: 'client.v1.customers.billingConfig.retrieve',
279
+ fullyQualifiedName: 'v1.customers.billingConfig.retrieve',
280
+ httpMethod: 'get',
281
+ httpPath: '/v1/customers/{customer_id}/billing-config/{billing_provider_type}',
282
+ },
283
+ {
284
+ clientCallName: 'client.v1.customers.billingConfig.delete',
285
+ fullyQualifiedName: 'v1.customers.billingConfig.delete',
286
+ httpMethod: 'delete',
287
+ httpPath: '/v1/customers/{customer_id}/billing-config/{billing_provider_type}',
288
+ },
289
+ {
290
+ clientCallName: 'client.v1.customers.commits.create',
291
+ fullyQualifiedName: 'v1.customers.commits.create',
292
+ httpMethod: 'post',
293
+ httpPath: '/v1/contracts/customerCommits/create',
294
+ },
295
+ {
296
+ clientCallName: 'client.v1.customers.commits.list',
297
+ fullyQualifiedName: 'v1.customers.commits.list',
298
+ httpMethod: 'post',
299
+ httpPath: '/v1/contracts/customerCommits/list',
300
+ },
301
+ {
302
+ clientCallName: 'client.v1.customers.commits.updateEndDate',
303
+ fullyQualifiedName: 'v1.customers.commits.updateEndDate',
304
+ httpMethod: 'post',
305
+ httpPath: '/v1/contracts/customerCommits/updateEndDate',
306
+ },
307
+ {
308
+ clientCallName: 'client.v1.customers.credits.create',
309
+ fullyQualifiedName: 'v1.customers.credits.create',
310
+ httpMethod: 'post',
311
+ httpPath: '/v1/contracts/customerCredits/create',
312
+ },
313
+ {
314
+ clientCallName: 'client.v1.customers.credits.list',
315
+ fullyQualifiedName: 'v1.customers.credits.list',
316
+ httpMethod: 'post',
317
+ httpPath: '/v1/contracts/customerCredits/list',
318
+ },
319
+ {
320
+ clientCallName: 'client.v1.customers.credits.updateEndDate',
321
+ fullyQualifiedName: 'v1.customers.credits.updateEndDate',
322
+ httpMethod: 'post',
323
+ httpPath: '/v1/contracts/customerCredits/updateEndDate',
324
+ },
325
+ {
326
+ clientCallName: 'client.v1.customers.namedSchedules.retrieve',
327
+ fullyQualifiedName: 'v1.customers.namedSchedules.retrieve',
328
+ httpMethod: 'post',
329
+ httpPath: '/v1/customers/getNamedSchedule',
330
+ },
331
+ {
332
+ clientCallName: 'client.v1.customers.namedSchedules.update',
333
+ fullyQualifiedName: 'v1.customers.namedSchedules.update',
334
+ httpMethod: 'post',
335
+ httpPath: '/v1/customers/updateNamedSchedule',
336
+ },
337
+ {
338
+ clientCallName: 'client.v1.dashboards.getEmbeddableURL',
339
+ fullyQualifiedName: 'v1.dashboards.getEmbeddableURL',
340
+ httpMethod: 'post',
341
+ httpPath: '/v1/dashboards/getEmbeddableUrl',
342
+ },
343
+ {
344
+ clientCallName: 'client.v1.usage.list',
345
+ fullyQualifiedName: 'v1.usage.list',
346
+ httpMethod: 'post',
347
+ httpPath: '/v1/usage',
348
+ },
349
+ {
350
+ clientCallName: 'client.v1.usage.ingest',
351
+ fullyQualifiedName: 'v1.usage.ingest',
352
+ httpMethod: 'post',
353
+ httpPath: '/v1/ingest',
354
+ },
355
+ {
356
+ clientCallName: 'client.v1.usage.listWithGroups',
357
+ fullyQualifiedName: 'v1.usage.listWithGroups',
358
+ httpMethod: 'post',
359
+ httpPath: '/v1/usage/groups',
360
+ },
361
+ {
362
+ clientCallName: 'client.v1.usage.search',
363
+ fullyQualifiedName: 'v1.usage.search',
364
+ httpMethod: 'post',
365
+ httpPath: '/v1/events/search',
366
+ },
367
+ {
368
+ clientCallName: 'client.v1.auditLogs.list',
369
+ fullyQualifiedName: 'v1.auditLogs.list',
370
+ httpMethod: 'get',
371
+ httpPath: '/v1/auditLogs',
372
+ },
373
+ {
374
+ clientCallName: 'client.v1.customFields.addKey',
375
+ fullyQualifiedName: 'v1.customFields.addKey',
376
+ httpMethod: 'post',
377
+ httpPath: '/v1/customFields/addKey',
378
+ },
379
+ {
380
+ clientCallName: 'client.v1.customFields.deleteValues',
381
+ fullyQualifiedName: 'v1.customFields.deleteValues',
382
+ httpMethod: 'post',
383
+ httpPath: '/v1/customFields/deleteValues',
384
+ },
385
+ {
386
+ clientCallName: 'client.v1.customFields.listKeys',
387
+ fullyQualifiedName: 'v1.customFields.listKeys',
388
+ httpMethod: 'post',
389
+ httpPath: '/v1/customFields/listKeys',
390
+ },
391
+ {
392
+ clientCallName: 'client.v1.customFields.removeKey',
393
+ fullyQualifiedName: 'v1.customFields.removeKey',
394
+ httpMethod: 'post',
395
+ httpPath: '/v1/customFields/removeKey',
396
+ },
397
+ {
398
+ clientCallName: 'client.v1.customFields.setValues',
399
+ fullyQualifiedName: 'v1.customFields.setValues',
400
+ httpMethod: 'post',
401
+ httpPath: '/v1/customFields/setValues',
402
+ },
403
+ {
404
+ clientCallName: 'client.v1.billableMetrics.create',
405
+ fullyQualifiedName: 'v1.billableMetrics.create',
406
+ httpMethod: 'post',
407
+ httpPath: '/v1/billable-metrics/create',
408
+ },
409
+ {
410
+ clientCallName: 'client.v1.billableMetrics.retrieve',
411
+ fullyQualifiedName: 'v1.billableMetrics.retrieve',
412
+ httpMethod: 'get',
413
+ httpPath: '/v1/billable-metrics/{billable_metric_id}',
414
+ },
415
+ {
416
+ clientCallName: 'client.v1.billableMetrics.list',
417
+ fullyQualifiedName: 'v1.billableMetrics.list',
418
+ httpMethod: 'get',
419
+ httpPath: '/v1/billable-metrics',
420
+ },
421
+ {
422
+ clientCallName: 'client.v1.billableMetrics.archive',
423
+ fullyQualifiedName: 'v1.billableMetrics.archive',
424
+ httpMethod: 'post',
425
+ httpPath: '/v1/billable-metrics/archive',
426
+ },
427
+ {
428
+ clientCallName: 'client.v1.services.list',
429
+ fullyQualifiedName: 'v1.services.list',
430
+ httpMethod: 'get',
431
+ httpPath: '/v1/services',
432
+ },
433
+ {
434
+ clientCallName: 'client.v1.invoices.regenerate',
435
+ fullyQualifiedName: 'v1.invoices.regenerate',
436
+ httpMethod: 'post',
437
+ httpPath: '/v1/invoices/regenerate',
438
+ },
439
+ {
440
+ clientCallName: 'client.v1.invoices.void',
441
+ fullyQualifiedName: 'v1.invoices.void',
442
+ httpMethod: 'post',
443
+ httpPath: '/v1/invoices/void',
444
+ },
445
+ {
446
+ clientCallName: 'client.v1.contracts.create',
447
+ fullyQualifiedName: 'v1.contracts.create',
448
+ httpMethod: 'post',
449
+ httpPath: '/v1/contracts/create',
450
+ },
451
+ {
452
+ clientCallName: 'client.v1.contracts.retrieve',
453
+ fullyQualifiedName: 'v1.contracts.retrieve',
454
+ httpMethod: 'post',
455
+ httpPath: '/v1/contracts/get',
456
+ },
457
+ {
458
+ clientCallName: 'client.v1.contracts.list',
459
+ fullyQualifiedName: 'v1.contracts.list',
460
+ httpMethod: 'post',
461
+ httpPath: '/v1/contracts/list',
462
+ },
463
+ {
464
+ clientCallName: 'client.v1.contracts.addManualBalanceEntry',
465
+ fullyQualifiedName: 'v1.contracts.addManualBalanceEntry',
466
+ httpMethod: 'post',
467
+ httpPath: '/v1/contracts/addManualBalanceLedgerEntry',
468
+ },
469
+ {
470
+ clientCallName: 'client.v1.contracts.amend',
471
+ fullyQualifiedName: 'v1.contracts.amend',
472
+ httpMethod: 'post',
473
+ httpPath: '/v1/contracts/amend',
474
+ },
475
+ {
476
+ clientCallName: 'client.v1.contracts.archive',
477
+ fullyQualifiedName: 'v1.contracts.archive',
478
+ httpMethod: 'post',
479
+ httpPath: '/v1/contracts/archive',
480
+ },
481
+ {
482
+ clientCallName: 'client.v1.contracts.createHistoricalInvoices',
483
+ fullyQualifiedName: 'v1.contracts.createHistoricalInvoices',
484
+ httpMethod: 'post',
485
+ httpPath: '/v1/contracts/createHistoricalInvoices',
486
+ },
487
+ {
488
+ clientCallName: 'client.v1.contracts.getNetBalance',
489
+ fullyQualifiedName: 'v1.contracts.getNetBalance',
490
+ httpMethod: 'post',
491
+ httpPath: '/v1/contracts/customerBalances/getNetBalance',
492
+ },
493
+ {
494
+ clientCallName: 'client.v1.contracts.listBalances',
495
+ fullyQualifiedName: 'v1.contracts.listBalances',
496
+ httpMethod: 'post',
497
+ httpPath: '/v1/contracts/customerBalances/list',
498
+ },
499
+ {
500
+ clientCallName: 'client.v1.contracts.retrieveRateSchedule',
501
+ fullyQualifiedName: 'v1.contracts.retrieveRateSchedule',
502
+ httpMethod: 'post',
503
+ httpPath: '/v1/contracts/getContractRateSchedule',
504
+ },
505
+ {
506
+ clientCallName: 'client.v1.contracts.retrieveSubscriptionQuantityHistory',
507
+ fullyQualifiedName: 'v1.contracts.retrieveSubscriptionQuantityHistory',
508
+ httpMethod: 'post',
509
+ httpPath: '/v1/contracts/getSubscriptionQuantityHistory',
510
+ },
511
+ {
512
+ clientCallName: 'client.v1.contracts.scheduleProServicesInvoice',
513
+ fullyQualifiedName: 'v1.contracts.scheduleProServicesInvoice',
514
+ httpMethod: 'post',
515
+ httpPath: '/v1/contracts/scheduleProServicesInvoice',
516
+ },
517
+ {
518
+ clientCallName: 'client.v1.contracts.setUsageFilter',
519
+ fullyQualifiedName: 'v1.contracts.setUsageFilter',
520
+ httpMethod: 'post',
521
+ httpPath: '/v1/contracts/setUsageFilter',
522
+ },
523
+ {
524
+ clientCallName: 'client.v1.contracts.updateEndDate',
525
+ fullyQualifiedName: 'v1.contracts.updateEndDate',
526
+ httpMethod: 'post',
527
+ httpPath: '/v1/contracts/updateEndDate',
528
+ },
529
+ {
530
+ clientCallName: 'client.v1.contracts.products.create',
531
+ fullyQualifiedName: 'v1.contracts.products.create',
532
+ httpMethod: 'post',
533
+ httpPath: '/v1/contract-pricing/products/create',
534
+ },
535
+ {
536
+ clientCallName: 'client.v1.contracts.products.retrieve',
537
+ fullyQualifiedName: 'v1.contracts.products.retrieve',
538
+ httpMethod: 'post',
539
+ httpPath: '/v1/contract-pricing/products/get',
540
+ },
541
+ {
542
+ clientCallName: 'client.v1.contracts.products.update',
543
+ fullyQualifiedName: 'v1.contracts.products.update',
544
+ httpMethod: 'post',
545
+ httpPath: '/v1/contract-pricing/products/update',
546
+ },
547
+ {
548
+ clientCallName: 'client.v1.contracts.products.list',
549
+ fullyQualifiedName: 'v1.contracts.products.list',
550
+ httpMethod: 'post',
551
+ httpPath: '/v1/contract-pricing/products/list',
552
+ },
553
+ {
554
+ clientCallName: 'client.v1.contracts.products.archive',
555
+ fullyQualifiedName: 'v1.contracts.products.archive',
556
+ httpMethod: 'post',
557
+ httpPath: '/v1/contract-pricing/products/archive',
558
+ },
559
+ {
560
+ clientCallName: 'client.v1.contracts.rateCards.create',
561
+ fullyQualifiedName: 'v1.contracts.rateCards.create',
562
+ httpMethod: 'post',
563
+ httpPath: '/v1/contract-pricing/rate-cards/create',
564
+ },
565
+ {
566
+ clientCallName: 'client.v1.contracts.rateCards.retrieve',
567
+ fullyQualifiedName: 'v1.contracts.rateCards.retrieve',
568
+ httpMethod: 'post',
569
+ httpPath: '/v1/contract-pricing/rate-cards/get',
570
+ },
571
+ {
572
+ clientCallName: 'client.v1.contracts.rateCards.update',
573
+ fullyQualifiedName: 'v1.contracts.rateCards.update',
574
+ httpMethod: 'post',
575
+ httpPath: '/v1/contract-pricing/rate-cards/update',
576
+ },
577
+ {
578
+ clientCallName: 'client.v1.contracts.rateCards.list',
579
+ fullyQualifiedName: 'v1.contracts.rateCards.list',
580
+ httpMethod: 'post',
581
+ httpPath: '/v1/contract-pricing/rate-cards/list',
582
+ },
583
+ {
584
+ clientCallName: 'client.v1.contracts.rateCards.archive',
585
+ fullyQualifiedName: 'v1.contracts.rateCards.archive',
586
+ httpMethod: 'post',
587
+ httpPath: '/v1/contract-pricing/rate-cards/archive',
588
+ },
589
+ {
590
+ clientCallName: 'client.v1.contracts.rateCards.retrieveRateSchedule',
591
+ fullyQualifiedName: 'v1.contracts.rateCards.retrieveRateSchedule',
592
+ httpMethod: 'post',
593
+ httpPath: '/v1/contract-pricing/rate-cards/getRateSchedule',
594
+ },
595
+ {
596
+ clientCallName: 'client.v1.contracts.rateCards.productOrders.update',
597
+ fullyQualifiedName: 'v1.contracts.rateCards.productOrders.update',
598
+ httpMethod: 'post',
599
+ httpPath: '/v1/contract-pricing/rate-cards/moveRateCardProducts',
600
+ },
601
+ {
602
+ clientCallName: 'client.v1.contracts.rateCards.productOrders.set',
603
+ fullyQualifiedName: 'v1.contracts.rateCards.productOrders.set',
604
+ httpMethod: 'post',
605
+ httpPath: '/v1/contract-pricing/rate-cards/setRateCardProductsOrder',
606
+ },
607
+ {
608
+ clientCallName: 'client.v1.contracts.rateCards.rates.list',
609
+ fullyQualifiedName: 'v1.contracts.rateCards.rates.list',
610
+ httpMethod: 'post',
611
+ httpPath: '/v1/contract-pricing/rate-cards/getRates',
612
+ },
613
+ {
614
+ clientCallName: 'client.v1.contracts.rateCards.rates.add',
615
+ fullyQualifiedName: 'v1.contracts.rateCards.rates.add',
616
+ httpMethod: 'post',
617
+ httpPath: '/v1/contract-pricing/rate-cards/addRate',
618
+ },
619
+ {
620
+ clientCallName: 'client.v1.contracts.rateCards.rates.addMany',
621
+ fullyQualifiedName: 'v1.contracts.rateCards.rates.addMany',
622
+ httpMethod: 'post',
623
+ httpPath: '/v1/contract-pricing/rate-cards/addRates',
624
+ },
625
+ {
626
+ clientCallName: 'client.v1.contracts.rateCards.namedSchedules.retrieve',
627
+ fullyQualifiedName: 'v1.contracts.rateCards.namedSchedules.retrieve',
628
+ httpMethod: 'post',
629
+ httpPath: '/v1/contracts/getNamedSchedule',
630
+ },
631
+ {
632
+ clientCallName: 'client.v1.contracts.rateCards.namedSchedules.update',
633
+ fullyQualifiedName: 'v1.contracts.rateCards.namedSchedules.update',
634
+ httpMethod: 'post',
635
+ httpPath: '/v1/contracts/updateNamedSchedule',
636
+ },
637
+ {
638
+ clientCallName: 'client.v1.contracts.namedSchedules.retrieve',
639
+ fullyQualifiedName: 'v1.contracts.namedSchedules.retrieve',
640
+ httpMethod: 'post',
641
+ httpPath: '/v1/contract-pricing/rate-cards/getNamedSchedule',
642
+ },
643
+ {
644
+ clientCallName: 'client.v1.contracts.namedSchedules.update',
645
+ fullyQualifiedName: 'v1.contracts.namedSchedules.update',
646
+ httpMethod: 'post',
647
+ httpPath: '/v1/contract-pricing/rate-cards/updateNamedSchedule',
648
+ },
649
+ {
650
+ clientCallName: 'client.v1.packages.create',
651
+ fullyQualifiedName: 'v1.packages.create',
652
+ httpMethod: 'post',
653
+ httpPath: '/v1/packages/create',
654
+ },
655
+ {
656
+ clientCallName: 'client.v1.packages.retrieve',
657
+ fullyQualifiedName: 'v1.packages.retrieve',
658
+ httpMethod: 'post',
659
+ httpPath: '/v1/packages/get',
660
+ },
661
+ {
662
+ clientCallName: 'client.v1.packages.list',
663
+ fullyQualifiedName: 'v1.packages.list',
664
+ httpMethod: 'post',
665
+ httpPath: '/v1/packages/list',
666
+ },
667
+ {
668
+ clientCallName: 'client.v1.packages.archive',
669
+ fullyQualifiedName: 'v1.packages.archive',
670
+ httpMethod: 'post',
671
+ httpPath: '/v1/packages/archive',
672
+ },
673
+ {
674
+ clientCallName: 'client.v1.packages.listContractsOnPackage',
675
+ fullyQualifiedName: 'v1.packages.listContractsOnPackage',
676
+ httpMethod: 'post',
677
+ httpPath: '/v1/packages/listContractsOnPackage',
678
+ },
679
+ {
680
+ clientCallName: 'client.v1.payments.list',
681
+ fullyQualifiedName: 'v1.payments.list',
682
+ httpMethod: 'post',
683
+ httpPath: '/v1/payments/list',
684
+ },
685
+ {
686
+ clientCallName: 'client.v1.payments.attempt',
687
+ fullyQualifiedName: 'v1.payments.attempt',
688
+ httpMethod: 'post',
689
+ httpPath: '/v1/payments/attempt',
690
+ },
691
+ {
692
+ clientCallName: 'client.v1.payments.cancel',
693
+ fullyQualifiedName: 'v1.payments.cancel',
694
+ httpMethod: 'post',
695
+ httpPath: '/v1/payments/cancel',
696
+ },
697
+ {
698
+ clientCallName: 'client.v1.settings.upsertAvalaraCredentials',
699
+ fullyQualifiedName: 'v1.settings.upsertAvalaraCredentials',
700
+ httpMethod: 'post',
701
+ httpPath: '/v1/upsertAvalaraCredentials',
702
+ },
703
+ {
704
+ clientCallName: 'client.v1.settings.billingProviders.create',
705
+ fullyQualifiedName: 'v1.settings.billingProviders.create',
706
+ httpMethod: 'post',
707
+ httpPath: '/v1/setUpBillingProvider',
708
+ },
709
+ {
710
+ clientCallName: 'client.v1.settings.billingProviders.list',
711
+ fullyQualifiedName: 'v1.settings.billingProviders.list',
712
+ httpMethod: 'post',
713
+ httpPath: '/v1/listConfiguredBillingProviders',
714
+ },
715
+ ];
716
+
717
+ function allowedMethodsForCodeTool(options: McpOptions | undefined): SdkMethod[] | undefined {
718
+ if (!options) {
719
+ return undefined;
720
+ }
721
+
722
+ let allowedMethods: SdkMethod[];
723
+
724
+ if (options.codeAllowHttpGets || options.codeAllowedMethods) {
725
+ // Start with nothing allowed and then add into it from options
726
+ let allowedMethodsSet = new Set<SdkMethod>();
727
+
728
+ if (options.codeAllowHttpGets) {
729
+ // Add all methods that map to an HTTP GET
730
+ sdkMethods
731
+ .filter((method) => method.httpMethod === 'get')
732
+ .forEach((method) => allowedMethodsSet.add(method));
733
+ }
734
+
735
+ if (options.codeAllowedMethods) {
736
+ // Add all methods that match any of the allowed regexps
737
+ const allowedRegexps = options.codeAllowedMethods.map((pattern) => {
738
+ try {
739
+ return new RegExp(pattern);
740
+ } catch (e) {
741
+ throw new Error(
742
+ `Invalid regex pattern for allowed method: "${pattern}": ${e instanceof Error ? e.message : e}`,
743
+ );
744
+ }
745
+ });
746
+
747
+ sdkMethods
748
+ .filter((method) => allowedRegexps.some((regexp) => regexp.test(method.fullyQualifiedName)))
749
+ .forEach((method) => allowedMethodsSet.add(method));
750
+ }
751
+
752
+ allowedMethods = Array.from(allowedMethodsSet);
753
+ } else {
754
+ // Start with everything allowed
755
+ allowedMethods = [...sdkMethods];
756
+ }
757
+
758
+ if (options.codeBlockedMethods) {
759
+ // Filter down based on blocked regexps
760
+ const blockedRegexps = options.codeBlockedMethods.map((pattern) => {
761
+ try {
762
+ return new RegExp(pattern);
763
+ } catch (e) {
764
+ throw new Error(
765
+ `Invalid regex pattern for blocked method: "${pattern}": ${e instanceof Error ? e.message : e}`,
766
+ );
767
+ }
768
+ });
769
+
770
+ allowedMethods = allowedMethods.filter(
771
+ (method) => !blockedRegexps.some((regexp) => regexp.test(method.fullyQualifiedName)),
772
+ );
773
+ }
774
+
775
+ return allowedMethods;
776
+ }
777
+
778
+ export function blockedMethodsForCodeTool(options: McpOptions | undefined): SdkMethod[] | undefined {
779
+ const allowedMethods = allowedMethodsForCodeTool(options);
780
+ if (!allowedMethods) {
781
+ return undefined;
782
+ }
783
+
784
+ const allowedSet = new Set(allowedMethods.map((method) => method.fullyQualifiedName));
785
+
786
+ // Return any methods that are not explicitly allowed
787
+ return sdkMethods.filter((method) => !allowedSet.has(method.fullyQualifiedName));
788
+ }