ebay-mcp 1.13.2 → 1.14.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 (169) hide show
  1. package/README.de.md +3 -3
  2. package/README.es.md +3 -3
  3. package/README.fr.md +3 -3
  4. package/README.ja.md +3 -3
  5. package/README.ko.md +3 -3
  6. package/README.md +163 -41
  7. package/README.pt-BR.md +3 -3
  8. package/README.ru.md +3 -3
  9. package/README.zh-CN.md +3 -3
  10. package/build/api/account-management/account.js +633 -297
  11. package/build/api/analytics-and-report/analytics.js +111 -65
  12. package/build/api/client.js +199 -140
  13. package/build/api/clientRequestError.js +23 -0
  14. package/build/api/clientTrading.js +213 -0
  15. package/build/api/clientTradingError.js +4 -0
  16. package/build/api/communication/feedback.js +147 -59
  17. package/build/api/communication/message.js +134 -81
  18. package/build/api/communication/negotiation.js +65 -53
  19. package/build/api/communication/notification.js +458 -164
  20. package/build/api/developer/developer.js +99 -45
  21. package/build/api/index.js +23 -8
  22. package/build/api/listing-management/inventory.js +884 -338
  23. package/build/api/listing-metadata/metadata.js +416 -170
  24. package/build/api/listing-metadata/taxonomy.js +187 -42
  25. package/build/api/marketing-and-promotions/marketing.js +1392 -598
  26. package/build/api/marketing-and-promotions/recommendation.js +49 -24
  27. package/build/api/order-management/dispute.js +226 -45
  28. package/build/api/order-management/fulfillment.js +144 -71
  29. package/build/api/order-management/orderIssueHelpers.js +61 -0
  30. package/build/api/other/compliance.js +50 -38
  31. package/build/api/other/edelivery.js +603 -159
  32. package/build/api/other/finding.js +280 -0
  33. package/build/api/other/identity.js +30 -15
  34. package/build/api/other/translation.js +29 -14
  35. package/build/api/other/vero.js +113 -27
  36. package/build/api/rateLimitTracker.js +55 -0
  37. package/build/api/shared/request.js +189 -98
  38. package/build/api/trading/trading.js +154 -87
  39. package/build/auth/credentialSession.js +250 -0
  40. package/build/auth/oauth.js +298 -171
  41. package/build/auth/{oauth-metadata.js → oauthMetadata.js} +22 -6
  42. package/build/auth/oauthMiddleware.js +104 -0
  43. package/build/auth/{scope-utils.js → scopeUtils.js} +101 -28
  44. package/build/auth/tokenVerifier.js +243 -0
  45. package/build/auth/tokenVerifierError.js +21 -0
  46. package/build/config/environment.js +148 -113
  47. package/build/config/{tool-families.js → toolFamilies.js} +30 -14
  48. package/build/index.js +25 -19
  49. package/build/mcp/{http-transport.js → httpTransport.js} +102 -52
  50. package/build/mcp/readOnlyFilter.js +67 -0
  51. package/build/mcp/runtime.js +31 -13
  52. package/build/mcp/{tool-gating.js → toolGating.js} +77 -49
  53. package/build/mcp/{ui-bridge.js → uiBridge.js} +80 -23
  54. package/build/schemas/account-management/account.js +144 -6
  55. package/build/schemas/analytics/analytics.js +33 -19
  56. package/build/schemas/communication/messages.js +12 -42
  57. package/build/schemas/developer/developer.js +135 -0
  58. package/build/schemas/fulfillment/orders.js +183 -21
  59. package/build/schemas/index.js +27 -19
  60. package/build/schemas/inventory-management/inventory.js +17 -9
  61. package/build/schemas/marketing/marketing.js +480 -25
  62. package/build/schemas/metadata/metadata.js +11 -6
  63. package/build/schemas/other/finding.js +27 -0
  64. package/build/schemas/other/otherApis.js +424 -0
  65. package/build/schemas/taxonomy/taxonomy.js +11 -5
  66. package/build/scripts/{auto-setup.js → autoSetup.js} +87 -74
  67. package/build/scripts/{build-ui.js → buildUi.js} +6 -1
  68. package/build/scripts/{dev-sync.js → devSync.js} +169 -110
  69. package/build/scripts/diagnostics.js +52 -44
  70. package/build/scripts/{download-specs.js → downloadSpecs.js} +29 -21
  71. package/build/scripts/{interactive-setup.js → interactiveSetup.js} +84 -78
  72. package/build/scripts/setup.js +241 -178
  73. package/build/scripts/{setup-shared.js → setupShared.js} +29 -7
  74. package/build/scripts/skills.js +35 -27
  75. package/build/scripts/updateApiStatusDoc.js +71 -0
  76. package/build/serverHttp.js +90 -0
  77. package/build/skills/content.js +124 -118
  78. package/build/skills/index.js +22 -10
  79. package/build/skills/install.js +21 -10
  80. package/build/skills/markers.js +50 -15
  81. package/build/skills/{registry-snapshot.js → registrySnapshot.js} +8 -2
  82. package/build/skills/render.js +41 -14
  83. package/build/skills/targets.js +49 -17
  84. package/build/tools/categories/account.js +166 -264
  85. package/build/tools/categories/analytics.js +11 -22
  86. package/build/tools/categories/browse.js +17 -0
  87. package/build/tools/categories/communication.js +124 -399
  88. package/build/tools/categories/connector.js +23 -20
  89. package/build/tools/categories/developer.js +46 -159
  90. package/build/tools/categories/fulfillment.js +84 -215
  91. package/build/tools/categories/index.js +6 -14
  92. package/build/tools/categories/inventory.js +238 -293
  93. package/build/tools/categories/marketing.js +677 -39
  94. package/build/tools/categories/metadata.js +190 -117
  95. package/build/tools/categories/other.js +81 -208
  96. package/build/tools/categories/taxonomy.js +29 -20
  97. package/build/tools/categories/{token-management.js → tokenManagement.js} +187 -192
  98. package/build/tools/categories/trading.js +16 -47
  99. package/build/tools/contracts.js +34 -24
  100. package/build/tools/{define-tool.js → defineTool.js} +44 -29
  101. package/build/tools/registry.js +87 -29
  102. package/build/tools/schemas.js +3 -57
  103. package/build/tools/ui/archetypes.js +1 -0
  104. package/build/tools/ui/{map-helpers.js → mapHelpers.js} +69 -19
  105. package/build/tools/ui/maps.js +294 -80
  106. package/build/types/index.js +1 -1
  107. package/build/ui/card.html +14 -14
  108. package/build/ui/chart.html +14 -14
  109. package/build/ui/stat.html +87 -0
  110. package/build/ui/table.html +14 -14
  111. package/build/utils/apiStatusFeed.js +95 -0
  112. package/build/utils/cliOutput.js +15 -0
  113. package/build/utils/cliUi.js +108 -0
  114. package/build/utils/communication/feedback.js +57 -77
  115. package/build/utils/communication/message.js +69 -98
  116. package/build/utils/communication/negotiation.js +30 -57
  117. package/build/utils/communication/notification.js +112 -252
  118. package/build/utils/{date-converter.js → dateConverter.js} +62 -30
  119. package/build/utils/effectSchema.js +203 -0
  120. package/build/utils/effectSchemaAdapter.js +121 -0
  121. package/build/utils/effectSchemaChainMethods.js +146 -0
  122. package/build/utils/effectSchemaRefinements.js +104 -0
  123. package/build/utils/effectSchemaStringMethods.js +63 -0
  124. package/build/utils/effectSchemaTypes.js +47 -0
  125. package/build/utils/{env-parser.js → envParser.js} +10 -2
  126. package/build/utils/errors.js +7 -3
  127. package/build/utils/http.js +148 -89
  128. package/build/utils/{llm-client-detector.js → llmClientDetector.js} +295 -274
  129. package/build/utils/logger.js +127 -51
  130. package/build/utils/{oauth-helper.js → oauthHelper.js} +127 -90
  131. package/build/utils/other/compliance.js +18 -38
  132. package/build/utils/other/identity.js +2 -2
  133. package/build/utils/other/translation.js +4 -4
  134. package/build/utils/other/vero.js +36 -20
  135. package/build/utils/schemaHelpers.js +22 -0
  136. package/build/utils/scopeHelper.js +270 -0
  137. package/build/utils/securityChecker.js +316 -0
  138. package/build/utils/{setup-validator.js → setupValidator.js} +113 -94
  139. package/build/utils/{setup-wizard.js → setupWizard.js} +57 -46
  140. package/build/utils/{token-utils.js → tokenUtils.js} +2 -2
  141. package/build/utils/trading/trading.js +35 -0
  142. package/build/utils/typeGuards.js +12 -0
  143. package/build/utils/version.js +65 -29
  144. package/package.json +10 -8
  145. package/build/api/client-trading.js +0 -124
  146. package/build/api/communication/shared.js +0 -59
  147. package/build/api/shared/query-params.js +0 -16
  148. package/build/auth/credential-session.js +0 -166
  149. package/build/auth/oauth-middleware.js +0 -100
  150. package/build/auth/token-verifier.js +0 -186
  151. package/build/schemas/other/other-apis.js +0 -390
  152. package/build/scripts/update-api-status-doc.js +0 -44
  153. package/build/server-http.js +0 -85
  154. package/build/tools/definitions/marketing.js +0 -1381
  155. package/build/tools/tool-handlers/marketing.js +0 -312
  156. package/build/utils/account-management/account.js +0 -818
  157. package/build/utils/api-status-feed.js +0 -84
  158. package/build/utils/cli-ui.js +0 -47
  159. package/build/utils/order-management/dispute.js +0 -369
  160. package/build/utils/order-management/fulfillment.js +0 -205
  161. package/build/utils/other/edelivery.js +0 -235
  162. package/build/utils/schema-helpers.js +0 -13
  163. package/build/utils/scope-helper.js +0 -207
  164. package/build/utils/security-checker.js +0 -248
  165. package/build/utils/type-guards.js +0 -6
  166. /package/build/auth/{oauth-types.js → oauthTypes.js} +0 -0
  167. /package/build/{server-http.d.ts → serverHttp.d.ts} +0 -0
  168. /package/build/tools/ui/{view-models.js → viewModels.js} +0 -0
  169. /package/build/types/{ebay-enums.js → ebayEnums.js} +0 -0
@@ -0,0 +1,424 @@
1
+ import { z } from '../../utils/effectSchema.js';
2
+ import { zodToJsonSchema } from 'zod-to-json-schema';
3
+ /**
4
+ * Other eBay APIs Schemas
5
+ *
6
+ * This file contains Effect-backed schemas for various eBay APIs including:
7
+ * - Commerce Identity API
8
+ * - Sell Compliance API
9
+ * - Commerce Translation API
10
+ * - Commerce VERO API
11
+ * - Sell eDelivery International Shipping API
12
+ */
13
+ // ============================================================================
14
+ // Common Schemas
15
+ // ============================================================================
16
+ const errorParameterSchema = z.object({
17
+ name: z.string().optional(),
18
+ value: z.string().optional(),
19
+ });
20
+ const errorSchema = z.object({
21
+ category: z.string().optional(),
22
+ domain: z.string().optional(),
23
+ errorId: z.number().int().optional(),
24
+ inputRefIds: z.array(z.string()).optional(),
25
+ longMessage: z.string().optional(),
26
+ message: z.string().optional(),
27
+ outputRefIds: z.array(z.string()).optional(),
28
+ parameters: z.array(errorParameterSchema).optional(),
29
+ subdomain: z.string().optional(),
30
+ });
31
+ // ============================================================================
32
+ // Commerce Identity API Schemas
33
+ // ============================================================================
34
+ const userConsentSchema = z.object({
35
+ consentState: z.string().optional(),
36
+ consentType: z.string().optional(),
37
+ });
38
+ const getUserConsentResponseSchema = z.object({
39
+ consents: z.array(userConsentSchema).optional(),
40
+ });
41
+ // ============================================================================
42
+ // Sell Compliance API Schemas
43
+ // ============================================================================
44
+ const nameValueListSchema = z.object({
45
+ name: z.string().optional(),
46
+ value: z.string().optional(),
47
+ });
48
+ const correctiveRecommendationsSchema = z.object({
49
+ complianceDetail: z.string().optional(),
50
+ complianceDetailDescription: z.string().optional(),
51
+ correctiveActionDetails: z.string().optional(),
52
+ productRecommendation: z
53
+ .object({
54
+ epid: z.string().optional(),
55
+ })
56
+ .optional(),
57
+ });
58
+ const variationDetailsSchema = z.object({
59
+ sku: z.string().optional(),
60
+ variationAspects: z.array(nameValueListSchema).optional(),
61
+ });
62
+ const complianceDetailSchema = z.object({
63
+ complianceState: z.string().optional(),
64
+ complianceType: z.string().optional(),
65
+ message: z.string().optional(),
66
+ reasons: z
67
+ .array(z.object({
68
+ complianceDetailType: z.string().optional(),
69
+ message: z.string().optional(),
70
+ variation: variationDetailsSchema.optional(),
71
+ violationData: z.array(nameValueListSchema).optional(),
72
+ }))
73
+ .optional(),
74
+ correctiveRecommendations: correctiveRecommendationsSchema.optional(),
75
+ });
76
+ const complianceSummaryInfoSchema = z.object({
77
+ complianceSummary: z
78
+ .object({
79
+ violationSummaries: z
80
+ .array(z.object({
81
+ complianceType: z.string().optional(),
82
+ listingCount: z.number().int().optional(),
83
+ }))
84
+ .optional(),
85
+ })
86
+ .optional(),
87
+ });
88
+ const complianceViolationSchema = z.object({
89
+ listingId: z.string().optional(),
90
+ offerId: z.string().optional(),
91
+ sku: z.string().optional(),
92
+ complianceType: z.string().optional(),
93
+ complianceDetails: z.array(complianceDetailSchema).optional(),
94
+ });
95
+ const pageMetadataSchema = z.object({
96
+ href: z.string().optional(),
97
+ limit: z.number().int().optional(),
98
+ next: z.string().optional(),
99
+ offset: z.number().int().optional(),
100
+ prev: z.string().optional(),
101
+ total: z.number().int().optional(),
102
+ });
103
+ const listingViolationSummaryResponseSchema = z.object({
104
+ href: z.string().optional(),
105
+ limit: z.number().int().optional(),
106
+ listingViolations: z.array(complianceViolationSchema).optional(),
107
+ next: z.string().optional(),
108
+ offset: z.number().int().optional(),
109
+ prev: z.string().optional(),
110
+ total: z.number().int().optional(),
111
+ });
112
+ // ============================================================================
113
+ // Commerce Translation API Schemas
114
+ // ============================================================================
115
+ const translationSchema = z.object({
116
+ from: z.string().optional(),
117
+ to: z.string().optional(),
118
+ translatedText: z.string().optional(),
119
+ });
120
+ /** Input schema for Commerce Translation API translate. */
121
+ export const translateInputSchema = z.object({
122
+ from: z.string().optional(),
123
+ to: z.string(),
124
+ text: z.array(z.string()),
125
+ translationContext: z.string().optional(),
126
+ });
127
+ const translateResponseSchema = z.object({
128
+ translations: z.array(translationSchema).optional(),
129
+ });
130
+ // ============================================================================
131
+ // Commerce VERO API Schemas
132
+ // ============================================================================
133
+ const amountSchema = z.object({
134
+ currency: z.string().optional(),
135
+ value: z.string().optional(),
136
+ });
137
+ const reportItemDetailsSchema = z.object({
138
+ brand: z.string().optional(),
139
+ copyEmailToRightsOwner: z.boolean().optional(),
140
+ countries: z.array(z.string()).optional(),
141
+ detailedMessage: z.string().optional(),
142
+ itemId: z.string().optional(),
143
+ messageToSeller: z.string().optional(),
144
+ patent: z.string().optional(),
145
+ regions: z.array(z.string()).optional(),
146
+ veroReasonCodeId: z.string().optional(),
147
+ });
148
+ /** Request schema for Commerce VeRO API createVeroReport report items. */
149
+ export const veroReportItemsRequestSchema = z.object({
150
+ reportItems: z.array(reportItemDetailsSchema).optional(),
151
+ });
152
+ /** Response schema for Commerce VeRO API createVeroReport. */
153
+ export const veroReportItemsResponseSchema = z.object({
154
+ veroReportId: z.string().optional(),
155
+ veroReportStatus: z.string().optional(),
156
+ });
157
+ const reportedItemSchema = z.object({
158
+ itemId: z.string().optional(),
159
+ reasonForFailure: z.string().optional(),
160
+ status: z.string().optional(),
161
+ });
162
+ const veroReportStatusResponseSchema = z.object({
163
+ reportedItemDetails: z.array(reportedItemSchema).optional(),
164
+ veroReportId: z.string().optional(),
165
+ veroReportStatus: z.string().optional(),
166
+ });
167
+ /** Paginated response schema for Commerce VeRO API getVeroReportItems. */
168
+ export const veroReportItemsStatusResponseSchema = z.object({
169
+ href: z.string().optional(),
170
+ limit: z.number().int().optional(),
171
+ next: z.string().optional(),
172
+ offset: z.number().int().optional(),
173
+ prev: z.string().optional(),
174
+ reportedItemDetails: z.array(reportedItemSchema).optional(),
175
+ total: z.number().int().optional(),
176
+ });
177
+ const reasonCodeDetailTypeSchema = z.object({
178
+ description: z.string().optional(),
179
+ detailedDescription: z.string().optional(),
180
+ veroReasonCodeId: z.string().optional(),
181
+ });
182
+ const veroReasonCodeSchema = z.object({
183
+ marketplaceId: z.string().optional(),
184
+ reasonCodeDetails: z.array(reasonCodeDetailTypeSchema).optional(),
185
+ });
186
+ /** Response schema for Commerce VeRO API getVeroReasonCode. */
187
+ export const veroReasonCodeResponseSchema = z.object({
188
+ marketplaceId: z.string().optional(),
189
+ reasonCodeDetails: reasonCodeDetailTypeSchema.optional(),
190
+ });
191
+ /** Response schema for Commerce VeRO API getVeroReasonCodes. */
192
+ export const veroReasonCodesResponseSchema = z.object({
193
+ veroReasonCodes: z.array(veroReasonCodeSchema).optional(),
194
+ });
195
+ // ============================================================================
196
+ // Sell eDelivery International Shipping API Schemas
197
+ // ============================================================================
198
+ const addressSchema = z.object({
199
+ addressLine1: z.string().optional(),
200
+ addressLine2: z.string().optional(),
201
+ city: z.string().optional(),
202
+ stateOrProvince: z.string().optional(),
203
+ postalCode: z.string().optional(),
204
+ countryCode: z.string().optional(),
205
+ });
206
+ const contactSchema = z.object({
207
+ companyName: z.string().optional(),
208
+ contactAddress: addressSchema.optional(),
209
+ email: z.string().optional(),
210
+ fullName: z.string().optional(),
211
+ primaryPhone: z
212
+ .object({
213
+ phoneNumber: z.string().optional(),
214
+ })
215
+ .optional(),
216
+ });
217
+ const dimensionsSchema = z.object({
218
+ height: z.number().optional(),
219
+ length: z.number().optional(),
220
+ width: z.number().optional(),
221
+ unit: z.string().optional(),
222
+ });
223
+ const weightSchema = z.object({
224
+ value: z.number().optional(),
225
+ unit: z.string().optional(),
226
+ });
227
+ const generatedEDeliveryBodySchema = z.object({}).passthrough();
228
+ const generatedEDeliveryResponseSchema = z.object({}).passthrough();
229
+ const emptyResponseSchema = z.object({});
230
+ /** Input schema for eDelivery endpoints that accept a generated request body. */
231
+ export const edeliveryBodyInputSchema = z.object({
232
+ body: generatedEDeliveryBodySchema,
233
+ });
234
+ /** Shared pagination input schema for eDelivery list endpoints. */
235
+ export const edeliveryPaginationInputSchema = z.object({
236
+ limit: z.number().int().optional(),
237
+ offset: z.number().int().optional(),
238
+ });
239
+ /** Input schema for eDelivery getActualCosts. */
240
+ export const getActualCostsInputSchema = z.object({
241
+ trackingNumbers: z.string().optional(),
242
+ transactionBeginTime: z.string().optional(),
243
+ transactionEndTime: z.string().optional(),
244
+ });
245
+ /** Input schema for eDelivery endpoints addressed by bundle ID. */
246
+ export const bundleIdInputSchema = z.object({
247
+ bundleId: z.string(),
248
+ });
249
+ /** Input schema for eDelivery endpoints addressed by package ID. */
250
+ export const packageIdInputSchema = z.object({
251
+ packageId: z.string(),
252
+ });
253
+ /** Input schema for eDelivery getPackagesByLineItemId. */
254
+ export const getPackagesByLineItemIdInputSchema = z.object({
255
+ orderLineItemId: z.string(),
256
+ });
257
+ /** Input schema for eDelivery getLabels. */
258
+ export const getLabelsInputSchema = z.object({
259
+ pageSize: z.string().optional(),
260
+ printPreference: z.string().optional(),
261
+ trackingNumbers: z.string(),
262
+ });
263
+ /** Input schema for eDelivery getHandoverSheet. */
264
+ export const getHandoverSheetInputSchema = z.object({
265
+ trackingNumbers: z.string(),
266
+ });
267
+ /** Input schema for eDelivery getTracking. */
268
+ export const getTrackingInputSchema = z.object({
269
+ trackingNumber: z.string(),
270
+ });
271
+ // ============================================================================
272
+ // Input Schemas for Operations
273
+ // ============================================================================
274
+ /** Empty input schema for Commerce Identity API getUser. */
275
+ export const getUserInputSchema = z.object({});
276
+ /** Input schema for Sell Compliance API getListingViolations. */
277
+ export const getListingViolationsInputSchema = z.object({
278
+ complianceType: z.string().optional(),
279
+ offset: z.number().int().optional(),
280
+ limit: z.number().int().optional(),
281
+ filter: z.string().optional(),
282
+ });
283
+ /** Input schema for Sell Compliance API getListingViolationsSummary. */
284
+ export const getListingViolationsSummaryInputSchema = z.object({
285
+ complianceType: z.string().optional(),
286
+ });
287
+ /** Empty input schema for eDelivery getAddressPreferences. */
288
+ export const getAddressPreferencesInputSchema = z.object({});
289
+ /** Empty input schema for eDelivery getConsignPreferences. */
290
+ export const getConsignPreferencesInputSchema = z.object({});
291
+ /** Input schema for Commerce VeRO API createVeroReport. */
292
+ export const createVeroReportInputSchema = z.object({
293
+ reportData: veroReportItemsRequestSchema.describe('Generated VeroReportItemsRequest body'),
294
+ });
295
+ /** Input schema for Commerce VeRO API getVeroReport. */
296
+ export const getVeroReportInputSchema = z.object({
297
+ veroReportId: z.string().min(1).describe('VeRO report identifier returned by createVeroReport'),
298
+ });
299
+ /** Input schema for Commerce VeRO API getVeroReportItems. */
300
+ export const getVeroReportItemsInputSchema = z.object({
301
+ filter: z.string().optional(),
302
+ limit: z.number().int().optional(),
303
+ offset: z.number().int().optional(),
304
+ });
305
+ /** Input schema for Commerce VeRO API getVeroReasonCode. */
306
+ export const getVeroReasonCodeInputSchema = z.object({
307
+ veroReasonCodeId: z.string().min(1).describe('VeRO reason-code identifier'),
308
+ });
309
+ /** Empty input schema for Commerce VeRO API getVeroReasonCodes. */
310
+ export const getVeroReasonCodesInputSchema = z.object({});
311
+ // ============================================================================
312
+ // JSON Schema Conversion Functions
313
+ // ============================================================================
314
+ /**
315
+ * Converts other eBay API Effect-backed schemas to JSON Schema format for MCP tools.
316
+ *
317
+ * @returns Other API JSON schemas keyed by endpoint or shared model name.
318
+ * @example
319
+ * ```ts
320
+ * const schemas = getOtherApisJsonSchemas();
321
+ * ```
322
+ */
323
+ export const getOtherApisJsonSchemas = () => {
324
+ return {
325
+ // Commerce Identity API
326
+ getUserInput: zodToJsonSchema(getUserInputSchema, 'getUserInput'),
327
+ getUserConsentOutput: zodToJsonSchema(getUserConsentResponseSchema, 'getUserConsentOutput'),
328
+ // Sell Compliance API
329
+ getComplianceSummaryOutput: zodToJsonSchema(complianceSummaryInfoSchema, 'getComplianceSummaryOutput'),
330
+ getListingViolationsInput: zodToJsonSchema(getListingViolationsInputSchema, 'getListingViolationsInput'),
331
+ getListingViolationsOutput: zodToJsonSchema(listingViolationSummaryResponseSchema, 'getListingViolationsOutput'),
332
+ getListingViolationsSummaryInput: zodToJsonSchema(getListingViolationsSummaryInputSchema, 'getListingViolationsSummaryInput'),
333
+ // Commerce Translation API
334
+ translateInput: zodToJsonSchema(translateInputSchema, 'translateInput'),
335
+ translateOutput: zodToJsonSchema(translateResponseSchema, 'translateOutput'),
336
+ // Commerce VERO API
337
+ createVeroReportInput: zodToJsonSchema(createVeroReportInputSchema, 'createVeroReportInput'),
338
+ createVeroReportOutput: zodToJsonSchema(veroReportItemsResponseSchema, 'createVeroReportOutput'),
339
+ getVeroReportInput: zodToJsonSchema(getVeroReportInputSchema, 'getVeroReportInput'),
340
+ getVeroReportOutput: zodToJsonSchema(veroReportStatusResponseSchema, 'getVeroReportOutput'),
341
+ getVeroReportItemsInput: zodToJsonSchema(getVeroReportItemsInputSchema, 'getVeroReportItemsInput'),
342
+ getVeroReportItemsOutput: zodToJsonSchema(veroReportItemsStatusResponseSchema, 'getVeroReportItemsOutput'),
343
+ getVeroReasonCodeInput: zodToJsonSchema(getVeroReasonCodeInputSchema, 'getVeroReasonCodeInput'),
344
+ getVeroReasonCodeOutput: zodToJsonSchema(veroReasonCodeResponseSchema, 'getVeroReasonCodeOutput'),
345
+ getVeroReasonCodesInput: zodToJsonSchema(getVeroReasonCodesInputSchema, 'getVeroReasonCodesInput'),
346
+ getVeroReasonCodesOutput: zodToJsonSchema(veroReasonCodesResponseSchema, 'getVeroReasonCodesOutput'),
347
+ // Sell eDelivery International Shipping API
348
+ getActualCostsInput: zodToJsonSchema(getActualCostsInputSchema, 'getActualCostsInput'),
349
+ getActualCostsOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'getActualCostsOutput'),
350
+ getAddressPreferencesInput: zodToJsonSchema(getAddressPreferencesInputSchema, 'getAddressPreferencesInput'),
351
+ getAddressPreferencesOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'getAddressPreferencesOutput'),
352
+ createAddressPreferenceInput: zodToJsonSchema(edeliveryBodyInputSchema, 'createAddressPreferenceInput'),
353
+ createAddressPreferenceOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'createAddressPreferenceOutput'),
354
+ getConsignPreferencesOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'getConsignPreferencesOutput'),
355
+ getConsignPreferencesInput: zodToJsonSchema(getConsignPreferencesInputSchema, 'getConsignPreferencesInput'),
356
+ createConsignPreferenceInput: zodToJsonSchema(edeliveryBodyInputSchema, 'createConsignPreferenceInput'),
357
+ createConsignPreferenceOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'createConsignPreferenceOutput'),
358
+ getAgentsInput: zodToJsonSchema(edeliveryPaginationInputSchema, 'getAgentsInput'),
359
+ getAgentsOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'getAgentsOutput'),
360
+ getBatteryQualificationsInput: zodToJsonSchema(edeliveryPaginationInputSchema, 'getBatteryQualificationsInput'),
361
+ getBatteryQualificationsOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'getBatteryQualificationsOutput'),
362
+ getDropoffSitesInput: zodToJsonSchema(edeliveryPaginationInputSchema, 'getDropoffSitesInput'),
363
+ getDropoffSitesOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'getDropoffSitesOutput'),
364
+ getServicesInput: zodToJsonSchema(edeliveryPaginationInputSchema, 'getServicesInput'),
365
+ getServicesOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'getServicesOutput'),
366
+ createBundleInput: zodToJsonSchema(edeliveryBodyInputSchema, 'createBundleInput'),
367
+ createBundleOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'createBundleOutput'),
368
+ getBundleInput: zodToJsonSchema(bundleIdInputSchema, 'getBundleInput'),
369
+ getBundleOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'getBundleOutput'),
370
+ cancelBundleInput: zodToJsonSchema(bundleIdInputSchema, 'cancelBundleInput'),
371
+ cancelBundleOutput: zodToJsonSchema(emptyResponseSchema, 'cancelBundleOutput'),
372
+ getBundleLabelInput: zodToJsonSchema(bundleIdInputSchema, 'getBundleLabelInput'),
373
+ getBundleLabelOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'getBundleLabelOutput'),
374
+ createPackageInput: zodToJsonSchema(edeliveryBodyInputSchema, 'createPackageInput'),
375
+ createPackageOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'createPackageOutput'),
376
+ getPackageInput: zodToJsonSchema(packageIdInputSchema, 'getPackageInput'),
377
+ getPackageOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'getPackageOutput'),
378
+ deletePackageInput: zodToJsonSchema(packageIdInputSchema, 'deletePackageInput'),
379
+ deletePackageOutput: zodToJsonSchema(emptyResponseSchema, 'deletePackageOutput'),
380
+ getPackagesByLineItemIdInput: zodToJsonSchema(getPackagesByLineItemIdInputSchema, 'getPackagesByLineItemIdInput'),
381
+ getPackagesByLineItemIdOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'getPackagesByLineItemIdOutput'),
382
+ cancelPackageInput: zodToJsonSchema(packageIdInputSchema, 'cancelPackageInput'),
383
+ cancelPackageOutput: zodToJsonSchema(emptyResponseSchema, 'cancelPackageOutput'),
384
+ clonePackageInput: zodToJsonSchema(packageIdInputSchema, 'clonePackageInput'),
385
+ clonePackageOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'clonePackageOutput'),
386
+ confirmPackageInput: zodToJsonSchema(packageIdInputSchema, 'confirmPackageInput'),
387
+ confirmPackageOutput: zodToJsonSchema(emptyResponseSchema, 'confirmPackageOutput'),
388
+ bulkCancelPackagesInput: zodToJsonSchema(edeliveryBodyInputSchema, 'bulkCancelPackagesInput'),
389
+ bulkCancelPackagesOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'bulkCancelPackagesOutput'),
390
+ bulkConfirmPackagesInput: zodToJsonSchema(edeliveryBodyInputSchema, 'bulkConfirmPackagesInput'),
391
+ bulkConfirmPackagesOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'bulkConfirmPackagesOutput'),
392
+ bulkDeletePackagesInput: zodToJsonSchema(edeliveryBodyInputSchema, 'bulkDeletePackagesInput'),
393
+ bulkDeletePackagesOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'bulkDeletePackagesOutput'),
394
+ getLabelsInput: zodToJsonSchema(getLabelsInputSchema, 'getLabelsInput'),
395
+ getLabelsOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'getLabelsOutput'),
396
+ getHandoverSheetInput: zodToJsonSchema(getHandoverSheetInputSchema, 'getHandoverSheetInput'),
397
+ getHandoverSheetOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'getHandoverSheetOutput'),
398
+ getTrackingInput: zodToJsonSchema(getTrackingInputSchema, 'getTrackingInput'),
399
+ getTrackingOutput: zodToJsonSchema(generatedEDeliveryResponseSchema, 'getTrackingOutput'),
400
+ createComplaintInput: zodToJsonSchema(edeliveryBodyInputSchema, 'createComplaintInput'),
401
+ createComplaintOutput: zodToJsonSchema(emptyResponseSchema, 'createComplaintOutput'),
402
+ // Common Types
403
+ error: zodToJsonSchema(errorSchema, 'error'),
404
+ errorParameter: zodToJsonSchema(errorParameterSchema, 'errorParameter'),
405
+ amount: zodToJsonSchema(amountSchema, 'amount'),
406
+ address: zodToJsonSchema(addressSchema, 'address'),
407
+ contact: zodToJsonSchema(contactSchema, 'contact'),
408
+ dimensions: zodToJsonSchema(dimensionsSchema, 'dimensions'),
409
+ weight: zodToJsonSchema(weightSchema, 'weight'),
410
+ pageMetadata: zodToJsonSchema(pageMetadataSchema, 'pageMetadata'),
411
+ // Compliance Types
412
+ complianceViolation: zodToJsonSchema(complianceViolationSchema, 'complianceViolation'),
413
+ complianceDetail: zodToJsonSchema(complianceDetailSchema, 'complianceDetail'),
414
+ correctiveRecommendations: zodToJsonSchema(correctiveRecommendationsSchema, 'correctiveRecommendations'),
415
+ variationDetails: zodToJsonSchema(variationDetailsSchema, 'variationDetails'),
416
+ nameValueList: zodToJsonSchema(nameValueListSchema, 'nameValueList'),
417
+ // Translation Types
418
+ translation: zodToJsonSchema(translationSchema, 'translation'),
419
+ // VERO Types
420
+ reportedItem: zodToJsonSchema(reportedItemSchema, 'reportedItem'),
421
+ reportItemDetails: zodToJsonSchema(reportItemDetailsSchema, 'reportItemDetails'),
422
+ userConsent: zodToJsonSchema(userConsentSchema, 'userConsent'),
423
+ };
424
+ };
@@ -1,9 +1,9 @@
1
- import { z } from 'zod';
1
+ import { z } from '../../utils/effectSchema.js';
2
2
  import { zodToJsonSchema } from 'zod-to-json-schema';
3
3
  /**
4
4
  * Taxonomy/Metadata API Schemas
5
5
  *
6
- * This file contains Zod schemas for the Sell Metadata API (Taxonomy section).
6
+ * This file contains Effect-backed schemas for the Sell Metadata API (Taxonomy section).
7
7
  * Schemas are organized by policy type and include category-related metadata.
8
8
  */
9
9
  // ============================================================================
@@ -514,9 +514,15 @@ const specificationRequestSchema = z.object({
514
514
  // JSON Schema Conversion Functions
515
515
  // ============================================================================
516
516
  /**
517
- * Convert Zod schemas to JSON Schema format for MCP tools
517
+ * Converts Taxonomy API Effect-backed schemas to JSON Schema format for MCP tools.
518
+ *
519
+ * @returns Taxonomy API JSON schemas keyed by endpoint or shared model name.
520
+ * @example
521
+ * ```ts
522
+ * const schemas = getTaxonomyJsonSchemas();
523
+ * ```
518
524
  */
519
- export function getTaxonomyJsonSchemas() {
525
+ export const getTaxonomyJsonSchemas = () => {
520
526
  return {
521
527
  // Category Policies
522
528
  getCategoryPoliciesOutput: zodToJsonSchema(categoryPolicyResponseSchema, 'getCategoryPoliciesOutput'),
@@ -572,4 +578,4 @@ export function getTaxonomyJsonSchemas() {
572
578
  propertyFilterInner: zodToJsonSchema(propertyFilterInnerSchema, 'propertyFilterInner'),
573
579
  productIdentifier: zodToJsonSchema(productIdentifierSchema, 'productIdentifier'),
574
580
  };
575
- }
581
+ };
@@ -7,14 +7,17 @@
7
7
  * 3. Validates environment tokens configuration
8
8
  * 4. Validates the setup
9
9
  *
10
- * Usage: npm run auto-setup (or runs automatically after npm install)
10
+ * Usage: npm run autoSetup (or runs automatically after npm install)
11
11
  */
12
12
  import { dirname, join } from 'path';
13
13
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';
14
14
  import { homedir, platform } from 'os';
15
15
  import { config } from 'dotenv';
16
+ import { Effect, Either } from 'effect';
16
17
  import { fileURLToPath } from 'url';
17
- import { isRecord } from '../utils/type-guards.js';
18
+ import { getErrorMessage } from '../utils/errors.js';
19
+ import { isRecord } from '../utils/typeGuards.js';
20
+ import process from 'node:process';
18
21
  // Load environment variables silently
19
22
  config({ quiet: true });
20
23
  const __filename = fileURLToPath(import.meta.url);
@@ -70,6 +73,23 @@ function readMcpServerConfigArray(value) {
70
73
  }
71
74
  return value.filter(isMCPServerConfig);
72
75
  }
76
+ function readExistingClientConfig(client) {
77
+ if (!existsSync(client.configPath)) {
78
+ return {};
79
+ }
80
+ const parsed = Effect.runSync(Effect.either(Effect.try({
81
+ try: () => readRecord(JSON.parse(readFileSync(client.configPath, 'utf-8'))),
82
+ catch: (error) => error,
83
+ })));
84
+ if (Either.isRight(parsed)) {
85
+ return parsed.right;
86
+ }
87
+ printWarning(`Invalid JSON in ${client.configPath}, creating backup and new config`);
88
+ const backup = `${client.configPath}.backup.${Date.now()}`;
89
+ writeFileSync(backup, readFileSync(client.configPath));
90
+ printInfo(`Backup saved to: ${backup}`);
91
+ return {};
92
+ }
73
93
  function getAutoSetupConfigPaths() {
74
94
  const home = homedir();
75
95
  const os = platform();
@@ -176,84 +196,77 @@ function generateMCPServerConfig() {
176
196
  return config;
177
197
  }
178
198
  function updateClientConfig(client, serverConfig) {
179
- try {
180
- // Ensure directory exists
181
- const configDir = dirname(client.configPath);
182
- if (!existsSync(configDir)) {
183
- mkdirSync(configDir, { recursive: true });
184
- }
185
- // Read existing config or create new one
186
- let config = {};
187
- if (existsSync(client.configPath)) {
188
- try {
189
- const existing = readFileSync(client.configPath, 'utf-8');
190
- config = readRecord(JSON.parse(existing));
191
- }
192
- catch {
193
- printWarning(`Invalid JSON in ${client.configPath}, creating backup and new config`);
194
- const backup = `${client.configPath}.backup.${Date.now()}`;
195
- writeFileSync(backup, readFileSync(client.configPath));
196
- printInfo(`Backup saved to: ${backup}`);
197
- config = {};
198
- }
199
- }
200
- // Handle different config formats for different clients
201
- switch (client.name) {
202
- case 'zed': {
203
- // Zed uses context_servers with a different structure
204
- if (!config.context_servers || typeof config.context_servers !== 'object') {
205
- config.context_servers = {};
206
- }
207
- const contextServers = readRecord(config.context_servers);
208
- contextServers['ebay-mcp-server'] = {
209
- command: {
210
- path: serverConfig.command,
211
- args: serverConfig.args,
212
- env: serverConfig.env,
213
- },
214
- settings: {},
215
- };
216
- break;
199
+ const updated = Effect.runSync(Effect.either(Effect.try({
200
+ try: () => {
201
+ // Ensure directory exists
202
+ const configDir = dirname(client.configPath);
203
+ if (!existsSync(configDir)) {
204
+ mkdirSync(configDir, { recursive: true });
217
205
  }
218
- case 'continue': {
219
- // Continue.dev uses experimental.modelContextProtocolServers as an array
220
- if (!config.experimental || typeof config.experimental !== 'object') {
221
- config.experimental = {};
206
+ const config = readExistingClientConfig(client);
207
+ // Handle different config formats for different clients
208
+ switch (client.name) {
209
+ case 'zed': {
210
+ // Zed uses context_servers with a different structure
211
+ if (!config.context_servers || typeof config.context_servers !== 'object') {
212
+ config.context_servers = {};
213
+ }
214
+ const contextServers = readRecord(config.context_servers);
215
+ contextServers['ebay-mcp-server'] = {
216
+ command: {
217
+ path: serverConfig.command,
218
+ args: serverConfig.args,
219
+ env: serverConfig.env,
220
+ },
221
+ settings: {},
222
+ };
223
+ config.context_servers = contextServers;
224
+ break;
222
225
  }
223
- const experimental = readRecord(config.experimental);
224
- if (!experimental.modelContextProtocolServers ||
225
- !Array.isArray(experimental.modelContextProtocolServers)) {
226
- experimental.modelContextProtocolServers = [];
226
+ case 'continue': {
227
+ // Continue.dev uses experimental.modelContextProtocolServers as an array
228
+ if (!config.experimental || typeof config.experimental !== 'object') {
229
+ config.experimental = {};
230
+ }
231
+ const experimental = readRecord(config.experimental);
232
+ if (!(experimental.modelContextProtocolServers &&
233
+ Array.isArray(experimental.modelContextProtocolServers))) {
234
+ experimental.modelContextProtocolServers = [];
235
+ }
236
+ const mcpServers = readMcpServerConfigArray(experimental.modelContextProtocolServers);
237
+ // Check if eBay server already exists and update/add
238
+ const existingIndex = mcpServers.findIndex((server) => server.command === 'node' && server.args?.[0]?.includes('ebay-mcp'));
239
+ if (existingIndex >= 0) {
240
+ mcpServers[existingIndex] = serverConfig;
241
+ }
242
+ else {
243
+ mcpServers.push(serverConfig);
244
+ }
245
+ experimental.modelContextProtocolServers = mcpServers;
246
+ config.experimental = experimental;
247
+ break;
227
248
  }
228
- const mcpServers = readMcpServerConfigArray(experimental.modelContextProtocolServers);
229
- // Check if eBay server already exists and update/add
230
- const existingIndex = mcpServers.findIndex((server) => server.command === 'node' && server.args?.[0]?.includes('ebay-mcp'));
231
- if (existingIndex >= 0) {
232
- mcpServers[existingIndex] = serverConfig;
249
+ default: {
250
+ // Standard mcpServers format for Claude Desktop, Cline, Cursor, Windsurf, Roo Code, Claude Code CLI, Amazon Q
251
+ if (!config.mcpServers || typeof config.mcpServers !== 'object') {
252
+ config.mcpServers = {};
253
+ }
254
+ const mcpServers = readRecord(config.mcpServers);
255
+ mcpServers['ebay-mcp-server'] = serverConfig;
256
+ config.mcpServers = mcpServers;
257
+ break;
233
258
  }
234
- else {
235
- mcpServers.push(serverConfig);
236
- }
237
- break;
238
- }
239
- default: {
240
- // Standard mcpServers format for Claude Desktop, Cline, Cursor, Windsurf, Roo Code, Claude Code CLI, Amazon Q
241
- if (!config.mcpServers || typeof config.mcpServers !== 'object') {
242
- config.mcpServers = {};
243
- }
244
- const mcpServers = readRecord(config.mcpServers);
245
- mcpServers['ebay-mcp-server'] = serverConfig;
246
- break;
247
259
  }
248
- }
249
- // Write config
250
- writeFileSync(client.configPath, JSON.stringify(config, null, 2));
251
- return true;
252
- }
253
- catch (error) {
254
- printError(`Failed to update ${client.name} config: ${error}`);
260
+ // Write config
261
+ writeFileSync(client.configPath, JSON.stringify(config, null, 2));
262
+ },
263
+ catch: (error) => error,
264
+ })));
265
+ if (Either.isLeft(updated)) {
266
+ printError(`Failed to update ${client.name} config: ${getErrorMessage(updated.left)}`);
255
267
  return false;
256
268
  }
269
+ return true;
257
270
  }
258
271
  // ═══════════════════════════════════════════════════════════════════════════
259
272
  // Token Validation (Environment-based only)
@@ -375,7 +388,7 @@ function main() {
375
388
  printInfo('No configurations generated (no MCP clients detected)');
376
389
  print('\n📝 To complete setup:', 'cyan');
377
390
  print(' 1. Install an MCP client (Claude Desktop, Cline, Cursor, Zed, Windsurf, Continue.dev, Roo Code, Claude Code CLI, or Amazon Q)');
378
- print(' 2. Run: npm run auto-setup');
391
+ print(' 2. Run: npm run autoSetup');
379
392
  }
380
393
  print('\n📚 Documentation: https://github.com/YosefHayim/ebay-mcp#readme\n');
381
394
  }