ebay-mcp 1.4.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 (205) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +586 -0
  3. package/build/api/account-management/account.d.ts +216 -0
  4. package/build/api/account-management/account.js +305 -0
  5. package/build/api/analytics-and-report/analytics.d.ts +33 -0
  6. package/build/api/analytics-and-report/analytics.js +102 -0
  7. package/build/api/client.d.ts +89 -0
  8. package/build/api/client.js +343 -0
  9. package/build/api/communication/feedback.d.ts +45 -0
  10. package/build/api/communication/feedback.js +119 -0
  11. package/build/api/communication/message.d.ts +55 -0
  12. package/build/api/communication/message.js +131 -0
  13. package/build/api/communication/negotiation.d.ts +39 -0
  14. package/build/api/communication/negotiation.js +97 -0
  15. package/build/api/communication/notification.d.ts +128 -0
  16. package/build/api/communication/notification.js +373 -0
  17. package/build/api/index.d.ts +96 -0
  18. package/build/api/index.js +121 -0
  19. package/build/api/listing-management/inventory.d.ts +216 -0
  20. package/build/api/listing-management/inventory.js +633 -0
  21. package/build/api/listing-metadata/metadata.d.ts +154 -0
  22. package/build/api/listing-metadata/metadata.js +485 -0
  23. package/build/api/listing-metadata/taxonomy.d.ts +38 -0
  24. package/build/api/listing-metadata/taxonomy.js +58 -0
  25. package/build/api/marketing-and-promotions/marketing.d.ts +395 -0
  26. package/build/api/marketing-and-promotions/marketing.js +565 -0
  27. package/build/api/marketing-and-promotions/recommendation.d.ts +20 -0
  28. package/build/api/marketing-and-promotions/recommendation.js +32 -0
  29. package/build/api/order-management/dispute.d.ts +65 -0
  30. package/build/api/order-management/dispute.js +69 -0
  31. package/build/api/order-management/fulfillment.d.ts +80 -0
  32. package/build/api/order-management/fulfillment.js +89 -0
  33. package/build/api/other/compliance.d.ts +26 -0
  34. package/build/api/other/compliance.js +47 -0
  35. package/build/api/other/edelivery.d.ts +153 -0
  36. package/build/api/other/edelivery.js +219 -0
  37. package/build/api/other/identity.d.ts +17 -0
  38. package/build/api/other/identity.js +24 -0
  39. package/build/api/other/translation.d.ts +14 -0
  40. package/build/api/other/translation.js +22 -0
  41. package/build/api/other/vero.d.ts +30 -0
  42. package/build/api/other/vero.js +48 -0
  43. package/build/auth/oauth-metadata.d.ts +46 -0
  44. package/build/auth/oauth-metadata.js +59 -0
  45. package/build/auth/oauth-middleware.d.ts +35 -0
  46. package/build/auth/oauth-middleware.js +99 -0
  47. package/build/auth/oauth-types.d.ts +66 -0
  48. package/build/auth/oauth-types.js +4 -0
  49. package/build/auth/oauth.d.ts +93 -0
  50. package/build/auth/oauth.js +383 -0
  51. package/build/auth/scope-utils.d.ts +70 -0
  52. package/build/auth/scope-utils.js +304 -0
  53. package/build/auth/token-verifier.d.ts +57 -0
  54. package/build/auth/token-verifier.js +172 -0
  55. package/build/config/environment.d.ts +61 -0
  56. package/build/config/environment.js +260 -0
  57. package/build/index.d.ts +1 -0
  58. package/build/index.js +98 -0
  59. package/build/schemas/account-management/account.d.ts +5324 -0
  60. package/build/schemas/account-management/account.js +366 -0
  61. package/build/schemas/analytics/analytics.d.ts +167 -0
  62. package/build/schemas/analytics/analytics.js +191 -0
  63. package/build/schemas/communication/messages.d.ts +1872 -0
  64. package/build/schemas/communication/messages.js +348 -0
  65. package/build/schemas/fulfillment/orders.d.ts +4655 -0
  66. package/build/schemas/fulfillment/orders.js +317 -0
  67. package/build/schemas/index.d.ts +2100 -0
  68. package/build/schemas/index.js +68 -0
  69. package/build/schemas/inventory-management/inventory.d.ts +6419 -0
  70. package/build/schemas/inventory-management/inventory.js +450 -0
  71. package/build/schemas/marketing/marketing.d.ts +14181 -0
  72. package/build/schemas/marketing/marketing.js +1088 -0
  73. package/build/schemas/metadata/metadata.d.ts +5259 -0
  74. package/build/schemas/metadata/metadata.js +614 -0
  75. package/build/schemas/other/other-apis.d.ts +257 -0
  76. package/build/schemas/other/other-apis.js +372 -0
  77. package/build/schemas/taxonomy/taxonomy.d.ts +215 -0
  78. package/build/schemas/taxonomy/taxonomy.js +571 -0
  79. package/build/scripts/auto-setup.d.ts +12 -0
  80. package/build/scripts/auto-setup.js +277 -0
  81. package/build/scripts/diagnostics.d.ts +8 -0
  82. package/build/scripts/diagnostics.js +299 -0
  83. package/build/scripts/download-specs.d.ts +1 -0
  84. package/build/scripts/download-specs.js +116 -0
  85. package/build/scripts/interactive-setup.d.ts +21 -0
  86. package/build/scripts/interactive-setup.js +723 -0
  87. package/build/server-http.d.ts +11 -0
  88. package/build/server-http.js +361 -0
  89. package/build/tools/definitions/account-with-schemas.d.ts +39 -0
  90. package/build/tools/definitions/account-with-schemas.js +170 -0
  91. package/build/tools/definitions/account.d.ts +12 -0
  92. package/build/tools/definitions/account.js +428 -0
  93. package/build/tools/definitions/analytics.d.ts +25 -0
  94. package/build/tools/definitions/analytics.js +66 -0
  95. package/build/tools/definitions/communication.d.ts +12 -0
  96. package/build/tools/definitions/communication.js +151 -0
  97. package/build/tools/definitions/fulfillment.d.ts +12 -0
  98. package/build/tools/definitions/fulfillment.js +326 -0
  99. package/build/tools/definitions/index.d.ts +25 -0
  100. package/build/tools/definitions/index.js +37 -0
  101. package/build/tools/definitions/inventory.d.ts +12 -0
  102. package/build/tools/definitions/inventory.js +429 -0
  103. package/build/tools/definitions/marketing.d.ts +12 -0
  104. package/build/tools/definitions/marketing.js +1095 -0
  105. package/build/tools/definitions/metadata.d.ts +12 -0
  106. package/build/tools/definitions/metadata.js +188 -0
  107. package/build/tools/definitions/other.d.ts +13 -0
  108. package/build/tools/definitions/other.js +309 -0
  109. package/build/tools/definitions/taxonomy.d.ts +25 -0
  110. package/build/tools/definitions/taxonomy.js +64 -0
  111. package/build/tools/definitions/token-management.d.ts +35 -0
  112. package/build/tools/definitions/token-management.js +103 -0
  113. package/build/tools/index.d.ts +11 -0
  114. package/build/tools/index.js +1003 -0
  115. package/build/tools/schemas.d.ts +14764 -0
  116. package/build/tools/schemas.js +667 -0
  117. package/build/tools/tool-definitions.d.ts +35 -0
  118. package/build/tools/tool-definitions.js +3534 -0
  119. package/build/types/application-settings/developerAnalyticsV1BetaOas3.d.ts +197 -0
  120. package/build/types/application-settings/developerAnalyticsV1BetaOas3.js +5 -0
  121. package/build/types/application-settings/developerClientRegistrationV1Oas3.d.ts +155 -0
  122. package/build/types/application-settings/developerClientRegistrationV1Oas3.js +5 -0
  123. package/build/types/application-settings/developerKeyManagementV1Oas3.d.ts +246 -0
  124. package/build/types/application-settings/developerKeyManagementV1Oas3.js +5 -0
  125. package/build/types/ebay-enums.d.ts +1204 -0
  126. package/build/types/ebay-enums.js +1330 -0
  127. package/build/types/ebay.d.ts +143 -0
  128. package/build/types/ebay.js +123 -0
  129. package/build/types/index.d.ts +6 -0
  130. package/build/types/index.js +10 -0
  131. package/build/types/sell-apps/account-management/sellAccountV1Oas3.d.ts +2579 -0
  132. package/build/types/sell-apps/account-management/sellAccountV1Oas3.js +5 -0
  133. package/build/types/sell-apps/analytics-and-report/sellAnalyticsV1Oas3.d.ts +446 -0
  134. package/build/types/sell-apps/analytics-and-report/sellAnalyticsV1Oas3.js +5 -0
  135. package/build/types/sell-apps/communication/commerceFeedbackV1BetaOas3.d.ts +705 -0
  136. package/build/types/sell-apps/communication/commerceFeedbackV1BetaOas3.js +5 -0
  137. package/build/types/sell-apps/communication/commerceMessageV1Oas3.d.ts +590 -0
  138. package/build/types/sell-apps/communication/commerceMessageV1Oas3.js +5 -0
  139. package/build/types/sell-apps/communication/commerceNotificationV1Oas3.d.ts +1276 -0
  140. package/build/types/sell-apps/communication/commerceNotificationV1Oas3.js +5 -0
  141. package/build/types/sell-apps/communication/sellNegotiationV1Oas3.d.ts +277 -0
  142. package/build/types/sell-apps/communication/sellNegotiationV1Oas3.js +5 -0
  143. package/build/types/sell-apps/listing-management/sellInventoryV1Oas3.d.ts +3133 -0
  144. package/build/types/sell-apps/listing-management/sellInventoryV1Oas3.js +5 -0
  145. package/build/types/sell-apps/listing-metadata/sellMetadataV1Oas3.d.ts +2289 -0
  146. package/build/types/sell-apps/listing-metadata/sellMetadataV1Oas3.js +5 -0
  147. package/build/types/sell-apps/markeitng-and-promotions/sellMarketingV1Oas3.d.ts +6650 -0
  148. package/build/types/sell-apps/markeitng-and-promotions/sellMarketingV1Oas3.js +5 -0
  149. package/build/types/sell-apps/markeitng-and-promotions/sellRecommendationV1Oas3.d.ts +172 -0
  150. package/build/types/sell-apps/markeitng-and-promotions/sellRecommendationV1Oas3.js +5 -0
  151. package/build/types/sell-apps/order-management/sellFulfillmentV1Oas3.d.ts +1869 -0
  152. package/build/types/sell-apps/order-management/sellFulfillmentV1Oas3.js +5 -0
  153. package/build/types/sell-apps/other-apis/commerceIdentityV1Oas3.d.ts +178 -0
  154. package/build/types/sell-apps/other-apis/commerceIdentityV1Oas3.js +5 -0
  155. package/build/types/sell-apps/other-apis/commerceTranslationV1BetaOas3.d.ts +128 -0
  156. package/build/types/sell-apps/other-apis/commerceTranslationV1BetaOas3.js +5 -0
  157. package/build/types/sell-apps/other-apis/commerceVeroV1Oas3.d.ts +417 -0
  158. package/build/types/sell-apps/other-apis/commerceVeroV1Oas3.js +5 -0
  159. package/build/types/sell-apps/other-apis/sellComplianceV1Oas3.d.ts +273 -0
  160. package/build/types/sell-apps/other-apis/sellComplianceV1Oas3.js +5 -0
  161. package/build/types/sell-apps/other-apis/sellEdeliveryInternationalShippingOas3.d.ts +2537 -0
  162. package/build/types/sell-apps/other-apis/sellEdeliveryInternationalShippingOas3.js +5 -0
  163. package/build/types/sell-apps/other-apis/sellMarketingV1Oas3.d.ts +6650 -0
  164. package/build/types/sell-apps/other-apis/sellMarketingV1Oas3.js +5 -0
  165. package/build/types/sell-apps/other-apis/sellRecommendationV1Oas3.d.ts +172 -0
  166. package/build/types/sell-apps/other-apis/sellRecommendationV1Oas3.js +5 -0
  167. package/build/utils/account-management/account.d.ts +1094 -0
  168. package/build/utils/account-management/account.js +831 -0
  169. package/build/utils/communication/feedback.d.ts +152 -0
  170. package/build/utils/communication/feedback.js +216 -0
  171. package/build/utils/communication/message.d.ts +174 -0
  172. package/build/utils/communication/message.js +242 -0
  173. package/build/utils/communication/negotiation.d.ts +123 -0
  174. package/build/utils/communication/negotiation.js +150 -0
  175. package/build/utils/communication/notification.d.ts +370 -0
  176. package/build/utils/communication/notification.js +369 -0
  177. package/build/utils/date-converter.d.ts +59 -0
  178. package/build/utils/date-converter.js +160 -0
  179. package/build/utils/llm-client-detector.d.ts +54 -0
  180. package/build/utils/llm-client-detector.js +318 -0
  181. package/build/utils/oauth-helper.d.ts +37 -0
  182. package/build/utils/oauth-helper.js +315 -0
  183. package/build/utils/order-management/dispute.d.ts +346 -0
  184. package/build/utils/order-management/dispute.js +369 -0
  185. package/build/utils/order-management/fulfillment.d.ts +200 -0
  186. package/build/utils/order-management/fulfillment.js +205 -0
  187. package/build/utils/other/compliance.d.ts +49 -0
  188. package/build/utils/other/compliance.js +76 -0
  189. package/build/utils/other/edelivery.d.ts +310 -0
  190. package/build/utils/other/edelivery.js +241 -0
  191. package/build/utils/other/identity.d.ts +13 -0
  192. package/build/utils/other/identity.js +13 -0
  193. package/build/utils/other/translation.d.ts +28 -0
  194. package/build/utils/other/translation.js +41 -0
  195. package/build/utils/other/vero.d.ts +61 -0
  196. package/build/utils/other/vero.js +90 -0
  197. package/build/utils/scope-helper.d.ts +49 -0
  198. package/build/utils/scope-helper.js +207 -0
  199. package/build/utils/security-checker.d.ts +46 -0
  200. package/build/utils/security-checker.js +248 -0
  201. package/build/utils/setup-validator.d.ts +25 -0
  202. package/build/utils/setup-validator.js +305 -0
  203. package/build/utils/token-utils.d.ts +40 -0
  204. package/build/utils/token-utils.js +40 -0
  205. package/package.json +115 -0
@@ -0,0 +1,450 @@
1
+ import { z } from 'zod';
2
+ import { zodToJsonSchema } from 'zod-to-json-schema';
3
+ import { Condition, LengthUnit, WeightUnit, PricingVisibility, FormatType, LocationType, MerchantLocationStatus, DayOfWeek, MarketplaceId, } from '../../types/ebay-enums.js';
4
+ /**
5
+ * Inventory Management API Schemas
6
+ *
7
+ * This file contains Zod schemas for all Inventory Management endpoints.
8
+ * Schemas are organized by endpoint and include both input and output validation.
9
+ */
10
+ // ============================================================================
11
+ // Common Schemas
12
+ // ============================================================================
13
+ const errorSchema = z.object({
14
+ errorId: z.number().optional(),
15
+ domain: z.string().optional(),
16
+ category: z.string().optional(),
17
+ message: z.string().optional(),
18
+ longMessage: z.string().optional(),
19
+ parameters: z.array(z.object({
20
+ name: z.string().optional(),
21
+ value: z.string().optional(),
22
+ })).optional(),
23
+ });
24
+ const amountSchema = z.object({
25
+ currency: z.string(),
26
+ value: z.string(),
27
+ });
28
+ // ============================================================================
29
+ // Inventory Item Schemas
30
+ // ============================================================================
31
+ const availabilitySchema = z.object({
32
+ shipToLocationAvailability: z.object({
33
+ quantity: z.number().optional(),
34
+ availabilityDistributions: z.array(z.object({
35
+ fulfillmentTime: z.object({
36
+ unit: z.string().optional(),
37
+ value: z.number().optional(),
38
+ }).optional(),
39
+ merchantLocationKey: z.string().optional(),
40
+ quantity: z.number().optional(),
41
+ })).optional(),
42
+ }).optional(),
43
+ });
44
+ const productIdentifierSchema = z.object({
45
+ epid: z.string().optional(),
46
+ gtin: z.string().optional(),
47
+ ktype: z.string().optional(),
48
+ });
49
+ const productSchema = z.object({
50
+ title: z.string().optional(),
51
+ aspects: z.record(z.array(z.string())).optional(),
52
+ brand: z.string().optional(),
53
+ description: z.string().optional(),
54
+ imageUrls: z.array(z.string()).optional(),
55
+ mpn: z.string().optional(),
56
+ ean: z.array(z.string()).optional(),
57
+ isbn: z.array(z.string()).optional(),
58
+ upc: z.array(z.string()).optional(),
59
+ epid: z.string().optional(),
60
+ subtitle: z.string().optional(),
61
+ videoIds: z.array(z.string()).optional(),
62
+ });
63
+ const dimensionsSchema = z.object({
64
+ height: z.number().optional(),
65
+ length: z.number().optional(),
66
+ width: z.number().optional(),
67
+ unit: z.nativeEnum(LengthUnit).optional(),
68
+ });
69
+ const weightSchema = z.object({
70
+ value: z.number().optional(),
71
+ unit: z.nativeEnum(WeightUnit).optional(),
72
+ });
73
+ const packageWeightAndSizeSchema = z.object({
74
+ dimensions: dimensionsSchema.optional(),
75
+ packageType: z.string().optional(),
76
+ weight: weightSchema.optional(),
77
+ });
78
+ export const inventoryItemSchema = z.object({
79
+ availability: availabilitySchema.optional(),
80
+ condition: z.nativeEnum(Condition).optional(),
81
+ conditionDescription: z.string().optional(),
82
+ conditionDescriptors: z.array(z.object({
83
+ name: z.string().optional(),
84
+ values: z.array(z.string()).optional(),
85
+ })).optional(),
86
+ packageWeightAndSize: packageWeightAndSizeSchema.optional(),
87
+ product: productSchema.optional(),
88
+ locale: z.string().optional(),
89
+ });
90
+ export const getInventoryItemsInputSchema = z.object({
91
+ limit: z.number().optional()
92
+ .describe('Number of items to return per page'),
93
+ offset: z.number().optional()
94
+ .describe('Number of items to skip for pagination'),
95
+ });
96
+ export const getInventoryItemsOutputSchema = z.object({
97
+ inventoryItems: z.array(z.object({
98
+ sku: z.string().optional(),
99
+ locale: z.string().optional(),
100
+ availability: availabilitySchema.optional(),
101
+ condition: z.string().optional(),
102
+ conditionDescription: z.string().optional(),
103
+ packageWeightAndSize: packageWeightAndSizeSchema.optional(),
104
+ product: productSchema.optional(),
105
+ })).optional(),
106
+ href: z.string().optional(),
107
+ limit: z.number().optional(),
108
+ next: z.string().optional(),
109
+ offset: z.number().optional(),
110
+ prev: z.string().optional(),
111
+ size: z.number().optional(),
112
+ total: z.number().optional(),
113
+ warnings: z.array(errorSchema).optional(),
114
+ });
115
+ export const getInventoryItemInputSchema = z.object({
116
+ sku: z.string()
117
+ .describe('The seller-defined SKU value for the inventory item'),
118
+ });
119
+ export const getInventoryItemOutputSchema = inventoryItemSchema.extend({
120
+ sku: z.string().optional(),
121
+ warnings: z.array(errorSchema).optional(),
122
+ });
123
+ export const createInventoryItemInputSchema = z.object({
124
+ sku: z.string()
125
+ .describe('The seller-defined SKU value for the inventory item'),
126
+ inventoryItem: inventoryItemSchema,
127
+ });
128
+ export const createInventoryItemOutputSchema = z.object({
129
+ warnings: z.array(errorSchema).optional(),
130
+ });
131
+ // ============================================================================
132
+ // Offer Schemas
133
+ // ============================================================================
134
+ const listingPoliciesSchema = z.object({
135
+ fulfillmentPolicyId: z.string().optional(),
136
+ paymentPolicyId: z.string().optional(),
137
+ returnPolicyId: z.string().optional(),
138
+ productCompliancePolicyIds: z.array(z.string()).optional(),
139
+ takeBackPolicyIds: z.array(z.string()).optional(),
140
+ eBayPlusIfEligible: z.boolean().optional(),
141
+ bestOfferTerms: z.object({
142
+ autoAcceptPrice: amountSchema.optional(),
143
+ autoDeclinePrice: amountSchema.optional(),
144
+ bestOfferEnabled: z.boolean().optional(),
145
+ }).optional(),
146
+ });
147
+ const pricingSchema = z.object({
148
+ price: amountSchema,
149
+ pricingVisibility: z.nativeEnum(PricingVisibility).optional(),
150
+ minimumAdvertisedPrice: amountSchema.optional(),
151
+ originalRetailPrice: amountSchema.optional(),
152
+ });
153
+ const taxSchema = z.object({
154
+ applyTax: z.boolean().optional(),
155
+ thirdPartyTaxCategory: z.string().optional(),
156
+ vatPercentage: z.number().optional(),
157
+ });
158
+ export const offerSchema = z.object({
159
+ sku: z.string(),
160
+ marketplaceId: z.nativeEnum(MarketplaceId),
161
+ format: z.nativeEnum(FormatType),
162
+ availableQuantity: z.number().optional(),
163
+ categoryId: z.string().optional(),
164
+ charity: z.object({
165
+ charityId: z.string().optional(),
166
+ donationPercentage: z.string().optional(),
167
+ }).optional(),
168
+ extendedProducerResponsibility: z.object({
169
+ producerProductId: z.string().optional(),
170
+ productPackageId: z.string().optional(),
171
+ shipmentPackageId: z.string().optional(),
172
+ productDocumentationId: z.string().optional(),
173
+ }).optional(),
174
+ hideBuyerDetails: z.boolean().optional(),
175
+ includeCatalogProductDetails: z.boolean().optional(),
176
+ listingDescription: z.string().optional(),
177
+ listingDuration: z.string().optional(),
178
+ listingPolicies: listingPoliciesSchema.optional(),
179
+ listingStartDate: z.string().optional(),
180
+ lotSize: z.number().optional(),
181
+ merchantLocationKey: z.string().optional(),
182
+ pricingSummary: pricingSchema.optional(),
183
+ quantityLimitPerBuyer: z.number().optional(),
184
+ secondaryCategoryId: z.string().optional(),
185
+ storeCategoryNames: z.array(z.string()).optional(),
186
+ tax: taxSchema.optional(),
187
+ });
188
+ export const offerResponseSchema = offerSchema.extend({
189
+ offerId: z.string().optional(),
190
+ listing: z.object({
191
+ listingId: z.string().optional(),
192
+ listingStatus: z.string().optional(),
193
+ soldQuantity: z.number().optional(),
194
+ }).optional(),
195
+ status: z.string().optional(),
196
+ statusDuration: z.string().optional(),
197
+ warnings: z.array(errorSchema).optional(),
198
+ });
199
+ export const getOffersInputSchema = z.object({
200
+ sku: z.string().optional()
201
+ .describe('Filter offers by SKU'),
202
+ marketplaceId: z.nativeEnum(MarketplaceId).optional()
203
+ .describe('Filter offers by marketplace'),
204
+ limit: z.number().optional()
205
+ .describe('Number of offers to return'),
206
+ });
207
+ export const getOffersOutputSchema = z.object({
208
+ offers: z.array(offerResponseSchema).optional(),
209
+ href: z.string().optional(),
210
+ limit: z.number().optional(),
211
+ next: z.string().optional(),
212
+ offset: z.number().optional(),
213
+ prev: z.string().optional(),
214
+ size: z.number().optional(),
215
+ total: z.number().optional(),
216
+ warnings: z.array(errorSchema).optional(),
217
+ });
218
+ export const createOfferInputSchema = z.object({
219
+ offer: offerSchema,
220
+ });
221
+ export const createOfferOutputSchema = z.object({
222
+ offerId: z.string().optional(),
223
+ warnings: z.array(errorSchema).optional(),
224
+ });
225
+ export const publishOfferInputSchema = z.object({
226
+ offerId: z.string()
227
+ .describe('The unique identifier of the offer to publish'),
228
+ });
229
+ export const publishOfferOutputSchema = z.object({
230
+ listingId: z.string().optional(),
231
+ warnings: z.array(errorSchema).optional(),
232
+ });
233
+ // ============================================================================
234
+ // Inventory Location Schemas
235
+ // ============================================================================
236
+ const operatingHoursSchema = z.object({
237
+ dayOfWeekEnum: z.nativeEnum(DayOfWeek).optional(),
238
+ intervals: z.array(z.object({
239
+ open: z.string().optional(),
240
+ close: z.string().optional(),
241
+ })).optional(),
242
+ });
243
+ const specialHoursSchema = z.object({
244
+ date: z.string().optional(),
245
+ intervals: z.array(z.object({
246
+ open: z.string().optional(),
247
+ close: z.string().optional(),
248
+ })).optional(),
249
+ });
250
+ const geoCoordinatesSchema = z.object({
251
+ latitude: z.number().optional(),
252
+ longitude: z.number().optional(),
253
+ });
254
+ const addressSchema = z.object({
255
+ addressLine1: z.string().optional(),
256
+ addressLine2: z.string().optional(),
257
+ city: z.string().optional(),
258
+ stateOrProvince: z.string().optional(),
259
+ postalCode: z.string().optional(),
260
+ country: z.string().optional(),
261
+ });
262
+ export const locationSchema = z.object({
263
+ location: z.object({
264
+ address: addressSchema.optional(),
265
+ geoCoordinates: geoCoordinatesSchema.optional(),
266
+ }).optional(),
267
+ locationAdditionalInformation: z.string().optional(),
268
+ locationInstructions: z.string().optional(),
269
+ locationTypes: z.array(z.nativeEnum(LocationType)).optional(),
270
+ locationWebUrl: z.string().optional(),
271
+ merchantLocationStatus: z.nativeEnum(MerchantLocationStatus).optional(),
272
+ name: z.string().optional(),
273
+ operatingHours: z.array(operatingHoursSchema).optional(),
274
+ phone: z.string().optional(),
275
+ specialHours: z.array(specialHoursSchema).optional(),
276
+ });
277
+ export const getInventoryLocationsInputSchema = z.object({
278
+ limit: z.number().optional()
279
+ .describe('Number of locations to return'),
280
+ offset: z.number().optional()
281
+ .describe('Number of locations to skip'),
282
+ });
283
+ export const getInventoryLocationsOutputSchema = z.object({
284
+ locations: z.array(locationSchema.extend({
285
+ merchantLocationKey: z.string().optional(),
286
+ })).optional(),
287
+ href: z.string().optional(),
288
+ limit: z.number().optional(),
289
+ next: z.string().optional(),
290
+ offset: z.number().optional(),
291
+ prev: z.string().optional(),
292
+ size: z.number().optional(),
293
+ total: z.number().optional(),
294
+ warnings: z.array(errorSchema).optional(),
295
+ });
296
+ export const createInventoryLocationInputSchema = z.object({
297
+ merchantLocationKey: z.string()
298
+ .describe('Unique merchant-defined key for the location'),
299
+ location: locationSchema,
300
+ });
301
+ export const createInventoryLocationOutputSchema = z.object({
302
+ warnings: z.array(errorSchema).optional(),
303
+ });
304
+ // ============================================================================
305
+ // Product Compatibility Schemas
306
+ // ============================================================================
307
+ const compatibilityPropertySchema = z.object({
308
+ name: z.string(),
309
+ value: z.string(),
310
+ });
311
+ const productFamilyPropertiesSchema = z.object({
312
+ make: z.string().optional(),
313
+ model: z.string().optional(),
314
+ year: z.string().optional(),
315
+ trim: z.string().optional(),
316
+ engine: z.string().optional(),
317
+ });
318
+ const compatibleProductSchema = z.object({
319
+ productIdentifier: productIdentifierSchema.optional(),
320
+ productFamilyProperties: productFamilyPropertiesSchema.optional(),
321
+ notes: z.string().optional(),
322
+ });
323
+ export const productCompatibilitySchema = z.object({
324
+ compatibleProducts: z.array(compatibleProductSchema).optional(),
325
+ });
326
+ export const getProductCompatibilityInputSchema = z.object({
327
+ sku: z.string()
328
+ .describe('The SKU of the inventory item'),
329
+ });
330
+ export const getProductCompatibilityOutputSchema = productCompatibilitySchema.extend({
331
+ warnings: z.array(errorSchema).optional(),
332
+ });
333
+ // ============================================================================
334
+ // Inventory Item Group Schemas
335
+ // ============================================================================
336
+ const specificationSchema = z.object({
337
+ name: z.string(),
338
+ values: z.array(z.string()),
339
+ });
340
+ const variesBySchema = z.object({
341
+ specifications: z.array(specificationSchema).optional(),
342
+ aspectsImageVariesBy: z.array(z.string()).optional(),
343
+ });
344
+ export const inventoryItemGroupSchema = z.object({
345
+ aspects: z.record(z.array(z.string())),
346
+ description: z.string().optional(),
347
+ imageUrls: z.array(z.string()).optional(),
348
+ inventoryItemGroupKey: z.string(),
349
+ subtitle: z.string().optional(),
350
+ title: z.string(),
351
+ variantSKUs: z.array(z.string()).optional(),
352
+ variesBy: variesBySchema.optional(),
353
+ videoIds: z.array(z.string()).optional(),
354
+ });
355
+ export const getInventoryItemGroupInputSchema = z.object({
356
+ inventoryItemGroupKey: z.string()
357
+ .describe('The unique identifier for the inventory item group'),
358
+ });
359
+ export const getInventoryItemGroupOutputSchema = inventoryItemGroupSchema.extend({
360
+ warnings: z.array(errorSchema).optional(),
361
+ });
362
+ // ============================================================================
363
+ // Bulk Operation Schemas
364
+ // ============================================================================
365
+ export const bulkInventoryItemRequestSchema = z.object({
366
+ requests: z.array(z.object({
367
+ sku: z.string(),
368
+ product: productSchema.optional(),
369
+ availability: availabilitySchema.optional(),
370
+ condition: z.nativeEnum(Condition).optional(),
371
+ conditionDescription: z.string().optional(),
372
+ })),
373
+ });
374
+ export const bulkInventoryItemResponseSchema = z.object({
375
+ responses: z.array(z.object({
376
+ sku: z.string().optional(),
377
+ statusCode: z.number().optional(),
378
+ errors: z.array(errorSchema).optional(),
379
+ warnings: z.array(errorSchema).optional(),
380
+ })).optional(),
381
+ });
382
+ export const bulkOfferRequestSchema = z.object({
383
+ requests: z.array(offerSchema),
384
+ });
385
+ export const bulkOfferResponseSchema = z.object({
386
+ responses: z.array(z.object({
387
+ offerId: z.string().optional(),
388
+ statusCode: z.number().optional(),
389
+ errors: z.array(errorSchema).optional(),
390
+ warnings: z.array(errorSchema).optional(),
391
+ })).optional(),
392
+ });
393
+ export const bulkPublishRequestSchema = z.object({
394
+ requests: z.array(z.object({
395
+ offerId: z.string(),
396
+ })),
397
+ });
398
+ export const bulkPublishResponseSchema = z.object({
399
+ responses: z.array(z.object({
400
+ offerId: z.string().optional(),
401
+ listingId: z.string().optional(),
402
+ statusCode: z.number().optional(),
403
+ errors: z.array(errorSchema).optional(),
404
+ warnings: z.array(errorSchema).optional(),
405
+ })).optional(),
406
+ });
407
+ // ============================================================================
408
+ // JSON Schema Conversion Functions
409
+ // ============================================================================
410
+ /**
411
+ * Convert Zod schemas to JSON Schema format for MCP tools
412
+ */
413
+ export function getInventoryManagementJsonSchemas() {
414
+ return {
415
+ // Inventory Items
416
+ getInventoryItemsInput: zodToJsonSchema(getInventoryItemsInputSchema, 'getInventoryItemsInput'),
417
+ getInventoryItemsOutput: zodToJsonSchema(getInventoryItemsOutputSchema, 'getInventoryItemsOutput'),
418
+ getInventoryItemInput: zodToJsonSchema(getInventoryItemInputSchema, 'getInventoryItemInput'),
419
+ getInventoryItemOutput: zodToJsonSchema(getInventoryItemOutputSchema, 'getInventoryItemOutput'),
420
+ createInventoryItemInput: zodToJsonSchema(createInventoryItemInputSchema, 'createInventoryItemInput'),
421
+ createInventoryItemOutput: zodToJsonSchema(createInventoryItemOutputSchema, 'createInventoryItemOutput'),
422
+ // Offers
423
+ getOffersInput: zodToJsonSchema(getOffersInputSchema, 'getOffersInput'),
424
+ getOffersOutput: zodToJsonSchema(getOffersOutputSchema, 'getOffersOutput'),
425
+ createOfferInput: zodToJsonSchema(createOfferInputSchema, 'createOfferInput'),
426
+ createOfferOutput: zodToJsonSchema(createOfferOutputSchema, 'createOfferOutput'),
427
+ publishOfferInput: zodToJsonSchema(publishOfferInputSchema, 'publishOfferInput'),
428
+ publishOfferOutput: zodToJsonSchema(publishOfferOutputSchema, 'publishOfferOutput'),
429
+ offerDetails: zodToJsonSchema(offerResponseSchema, 'offerDetails'),
430
+ // Inventory Locations
431
+ getInventoryLocationsInput: zodToJsonSchema(getInventoryLocationsInputSchema, 'getInventoryLocationsInput'),
432
+ getInventoryLocationsOutput: zodToJsonSchema(getInventoryLocationsOutputSchema, 'getInventoryLocationsOutput'),
433
+ createInventoryLocationInput: zodToJsonSchema(createInventoryLocationInputSchema, 'createInventoryLocationInput'),
434
+ createInventoryLocationOutput: zodToJsonSchema(createInventoryLocationOutputSchema, 'createInventoryLocationOutput'),
435
+ // Product Compatibility
436
+ getProductCompatibilityInput: zodToJsonSchema(getProductCompatibilityInputSchema, 'getProductCompatibilityInput'),
437
+ getProductCompatibilityOutput: zodToJsonSchema(getProductCompatibilityOutputSchema, 'getProductCompatibilityOutput'),
438
+ // Inventory Item Groups
439
+ getInventoryItemGroupInput: zodToJsonSchema(getInventoryItemGroupInputSchema, 'getInventoryItemGroupInput'),
440
+ getInventoryItemGroupOutput: zodToJsonSchema(getInventoryItemGroupOutputSchema, 'getInventoryItemGroupOutput'),
441
+ inventoryItemGroup: zodToJsonSchema(inventoryItemGroupSchema, 'inventoryItemGroup'),
442
+ // Bulk Operations
443
+ bulkInventoryItemRequest: zodToJsonSchema(bulkInventoryItemRequestSchema, 'bulkInventoryItemRequest'),
444
+ bulkInventoryItemResponse: zodToJsonSchema(bulkInventoryItemResponseSchema, 'bulkInventoryItemResponse'),
445
+ bulkOfferRequest: zodToJsonSchema(bulkOfferRequestSchema, 'bulkOfferRequest'),
446
+ bulkOfferResponse: zodToJsonSchema(bulkOfferResponseSchema, 'bulkOfferResponse'),
447
+ bulkPublishRequest: zodToJsonSchema(bulkPublishRequestSchema, 'bulkPublishRequest'),
448
+ bulkPublishResponse: zodToJsonSchema(bulkPublishResponseSchema, 'bulkPublishResponse'),
449
+ };
450
+ }