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
@@ -1,194 +1,150 @@
1
- import { z } from 'zod';
2
1
  import { zodToJsonSchema } from 'zod-to-json-schema';
3
- import { defineTool } from '../../tools/define-tool.js';
2
+ import { defineTool } from '../../tools/defineTool.js';
4
3
  import { mapDisputeSummariesToTable, mapDisputeToCard, mapFulfillmentsToTable, mapOrdersToTable, mapOrderToCard, } from '../../tools/ui/maps.js';
5
- import { shippingFulfillmentSchema } from '../schemas.js';
6
- import { getOrdersOutputSchema, getOrderOutputSchema, createShippingFulfillmentOutputSchema, getShippingFulfillmentsOutputSchema, issueRefundOutputSchema, getPaymentDisputesOutputSchema, } from '../../schemas/fulfillment/orders.js';
7
- /** Fulfillment API tools for orders, shipping fulfillments, refunds, and cancellations. */
4
+ import { filterOrdersWithCancellationRequests, filterRefundedOrders, } from '../../api/order-management/orderIssueHelpers.js';
5
+ import { acceptPaymentDisputeInputSchema, addEvidenceInputSchema, contestPaymentDisputeInputSchema, createShippingFulfillmentInputSchema, getCancellationRequestsInputSchema, getOrdersOutputSchema, getOrdersInputSchema, getOrderOutputSchema, getOrderInputSchema, createShippingFulfillmentOutputSchema, fetchEvidenceContentInputSchema, getActivitiesInputSchema, getRefundedOrdersInputSchema, getShippingFulfillmentsOutputSchema, getShippingFulfillmentsInputSchema, getShippingFulfillmentOutputSchema, getShippingFulfillmentInputSchema, getPaymentDisputeInputSchema, issueRefundOutputSchema, issueRefundInputSchema, getPaymentDisputeSummariesOutputSchema, getPaymentDisputeSummariesInputSchema, uploadEvidenceFileInputSchema, updateEvidenceInputSchema, } from '../../schemas/fulfillment/orders.js';
6
+ import { Effect } from 'effect';
7
+ /** Default number of recent orders scanned by cancellation/refund helpers. */
8
+ const DEFAULT_ORDER_SCAN_LIMIT = 50;
9
+ /** Fulfillment API tools for orders, shipping fulfillments, refunds, and payment disputes. */
8
10
  export const fulfillmentEntries = [
9
11
  defineTool({
10
12
  name: 'ebay_get_orders',
11
13
  description: 'Retrieve orders for the seller.\n\nRequired OAuth Scope: sell.fulfillment.readonly or sell.fulfillment\nMinimum Scope: https://api.ebay.com/oauth/api_scope/sell.fulfillment.readonly',
12
- inputSchema: {
13
- filter: z
14
- .string()
15
- .optional()
16
- .describe('Filter criteria (e.g., orderfulfillmentstatus:{NOT_STARTED})'),
17
- limit: z.number().optional().describe('Number of orders to return'),
18
- offset: z.number().optional().describe('Number of orders to skip'),
19
- },
14
+ inputSchema: getOrdersInputSchema.shape,
20
15
  outputSchema: zodToJsonSchema(getOrdersOutputSchema, {
21
16
  name: 'GetOrdersResponse',
22
17
  $refStrategy: 'none',
23
18
  }),
24
- handler: (api, args) => api.fulfillment.getOrders(args.filter, args.limit, args.offset),
19
+ handler: (api, args) => Effect.runPromise(api.fulfillment.getOrders(args)),
25
20
  ui: { archetype: 'table', map: mapOrdersToTable },
26
21
  }),
27
22
  defineTool({
28
23
  name: 'ebay_get_order',
29
24
  description: 'Get details of a specific order.\n\nRequired OAuth Scope: sell.fulfillment.readonly or sell.fulfillment\nMinimum Scope: https://api.ebay.com/oauth/api_scope/sell.fulfillment.readonly',
30
- inputSchema: {
31
- orderId: z.string().describe('The unique order ID'),
32
- },
25
+ inputSchema: getOrderInputSchema.shape,
33
26
  outputSchema: zodToJsonSchema(getOrderOutputSchema, {
34
27
  name: 'GetOrderResponse',
35
28
  $refStrategy: 'none',
36
29
  }),
37
- handler: (api, args) => api.fulfillment.getOrder(args.orderId),
30
+ handler: (api, args) => Effect.runPromise(api.fulfillment.getOrder(args)),
38
31
  ui: { archetype: 'card', map: mapOrderToCard },
39
32
  }),
40
33
  defineTool({
41
34
  name: 'ebay_create_shipping_fulfillment',
42
35
  description: 'Create a shipping fulfillment for an order.\n\nRequired OAuth Scope: sell.fulfillment\nMinimum Scope: https://api.ebay.com/oauth/api_scope/sell.fulfillment',
43
- inputSchema: {
44
- orderId: z.string().describe('The order ID'),
45
- fulfillment: shippingFulfillmentSchema.describe('Shipping fulfillment details including tracking number'),
46
- },
36
+ inputSchema: createShippingFulfillmentInputSchema.shape,
47
37
  outputSchema: zodToJsonSchema(createShippingFulfillmentOutputSchema, {
48
38
  name: 'CreateShippingFulfillmentResponse',
49
39
  $refStrategy: 'none',
50
40
  }),
51
- handler: (api, args) => api.fulfillment.createShippingFulfillment(args.orderId, args.fulfillment),
41
+ handler: (api, args) => Effect.runPromise(api.fulfillment.createShippingFulfillment(args)),
52
42
  }),
53
43
  defineTool({
54
44
  name: 'ebay_get_shipping_fulfillments',
55
45
  description: 'Get all shipping fulfillments for an order.\n\nRequired OAuth Scope: sell.fulfillment.readonly or sell.fulfillment\nMinimum Scope: https://api.ebay.com/oauth/api_scope/sell.fulfillment.readonly',
56
- inputSchema: {
57
- orderId: z.string().describe('The order ID to get fulfillments for'),
58
- },
46
+ inputSchema: getShippingFulfillmentsInputSchema.shape,
59
47
  outputSchema: zodToJsonSchema(getShippingFulfillmentsOutputSchema, {
60
48
  name: 'GetShippingFulfillmentsResponse',
61
49
  $refStrategy: 'none',
62
50
  }),
63
- handler: (api, args) => api.fulfillment.getShippingFulfillments(args.orderId),
51
+ handler: (api, args) => Effect.runPromise(api.fulfillment.getShippingFulfillments(args)),
64
52
  ui: { archetype: 'table', map: mapFulfillmentsToTable },
65
53
  }),
66
54
  defineTool({
67
55
  name: 'ebay_get_shipping_fulfillment',
68
56
  description: 'Get a specific shipping fulfillment by ID.\n\nRequired OAuth Scope: sell.fulfillment.readonly or sell.fulfillment\nMinimum Scope: https://api.ebay.com/oauth/api_scope/sell.fulfillment.readonly',
69
- inputSchema: {
70
- orderId: z.string().describe('The order ID'),
71
- fulfillmentId: z.string().describe('The fulfillment ID'),
72
- },
73
- outputSchema: zodToJsonSchema(createShippingFulfillmentOutputSchema, {
57
+ inputSchema: getShippingFulfillmentInputSchema.shape,
58
+ outputSchema: zodToJsonSchema(getShippingFulfillmentOutputSchema, {
74
59
  name: 'GetShippingFulfillmentResponse',
75
60
  $refStrategy: 'none',
76
61
  }),
77
- handler: (api, args) => api.fulfillment.getShippingFulfillment(args.orderId, args.fulfillmentId),
62
+ handler: (api, args) => Effect.runPromise(api.fulfillment.getShippingFulfillment(args)),
78
63
  }),
79
64
  defineTool({
80
65
  name: 'ebay_issue_refund',
81
66
  description: 'Issue a full or partial refund for an eBay order. Use this to refund buyers for orders, including specifying the refund amount and reason.\n\nRequired OAuth Scope: sell.fulfillment\nMinimum Scope: https://api.ebay.com/oauth/api_scope/sell.fulfillment',
82
- inputSchema: {
83
- orderId: z.string().describe('The unique eBay order ID to refund'),
84
- refundData: z
85
- .object({
86
- reasonForRefund: z
87
- .string()
88
- .describe('REQUIRED. Reason code: BUYER_CANCEL, OUT_OF_STOCK, FOUND_CHEAPER_PRICE, INCORRECT_PRICE, ITEM_DAMAGED, ITEM_DEFECTIVE, LOST_IN_TRANSIT, MUTUALLY_AGREED, SELLER_CANCEL'),
89
- comment: z
90
- .string()
91
- .optional()
92
- .describe('Optional comment to buyer about the refund (max 100 characters)'),
93
- refundItems: z
94
- .array(z.object({
95
- lineItemId: z
96
- .string()
97
- .describe('The unique identifier of the order line item to refund'),
98
- refundAmount: z
99
- .object({
100
- value: z.string().describe('The monetary amount (e.g., "25.99")'),
101
- currency: z
102
- .string()
103
- .describe('Three-letter ISO 4217 currency code (e.g., "USD")'),
104
- })
105
- .optional()
106
- .describe('The amount to refund for this line item'),
107
- legacyReference: z
108
- .object({
109
- legacyItemId: z.string().optional(),
110
- legacyTransactionId: z.string().optional(),
111
- })
112
- .optional()
113
- .describe('Optional legacy item ID/transaction ID pair for identifying the line item'),
114
- }))
115
- .optional()
116
- .describe('Array of individual line items to refund. Use this for partial refunds of specific items. Each item requires lineItemId and refundAmount.'),
117
- orderLevelRefundAmount: z
118
- .object({
119
- value: z.string().describe('The monetary amount (e.g., "99.99")'),
120
- currency: z.string().describe('Three-letter ISO 4217 currency code (e.g., "USD")'),
121
- })
122
- .optional()
123
- .describe('Use this to refund the entire order amount. Alternative to refundItems. Include value and currency.'),
124
- })
125
- .describe('Refund details including amount, reason, and optional comment. Must include reasonForRefund (required), and either refundItems (for line item refunds) OR orderLevelRefundAmount (for full order refunds).'),
126
- },
67
+ inputSchema: issueRefundInputSchema.shape,
127
68
  outputSchema: zodToJsonSchema(issueRefundOutputSchema, {
128
69
  name: 'IssueRefundResponse',
129
70
  $refStrategy: 'none',
130
71
  }),
131
- handler: (api, args) => api.fulfillment.issueRefund(args.orderId, args.refundData),
72
+ handler: (api, args) => Effect.runPromise(api.fulfillment.issueRefund(args)),
73
+ }),
74
+ defineTool({
75
+ name: 'ebay_get_cancellation_requests',
76
+ description: 'Scan recent seller orders for cancellation requests. Calls Fulfillment API getOrders and returns orders whose cancelState is not NONE_REQUESTED (or that list cancel requests). Read-only helper — does not use the deprecated Post-Order API.\n\nRequired OAuth Scope: sell.fulfillment.readonly or sell.fulfillment\nMinimum Scope: https://api.ebay.com/oauth/api_scope/sell.fulfillment.readonly',
77
+ inputSchema: getCancellationRequestsInputSchema.shape,
78
+ annotations: { readOnlyHint: true },
79
+ handler: (api, args) => Effect.runPromise(api.fulfillment
80
+ .getOrders({
81
+ filter: args.filter,
82
+ limit: args.maxResults ?? DEFAULT_ORDER_SCAN_LIMIT,
83
+ })
84
+ .pipe(Effect.map((result) => {
85
+ const orders = result.orders ?? [];
86
+ const matches = filterOrdersWithCancellationRequests(orders);
87
+ return {
88
+ totalScanned: orders.length,
89
+ totalMatched: matches.length,
90
+ orders: matches,
91
+ };
92
+ }))),
93
+ }),
94
+ defineTool({
95
+ name: 'ebay_get_refunded_orders',
96
+ description: 'Scan recent seller orders for refunds. Calls Fulfillment API getOrders and returns orders with a non-empty paymentSummary.refunds array. Read-only helper — does not issue refunds or call the Post-Order API.\n\nRequired OAuth Scope: sell.fulfillment.readonly or sell.fulfillment\nMinimum Scope: https://api.ebay.com/oauth/api_scope/sell.fulfillment.readonly',
97
+ inputSchema: getRefundedOrdersInputSchema.shape,
98
+ annotations: { readOnlyHint: true },
99
+ handler: (api, args) => Effect.runPromise(api.fulfillment
100
+ .getOrders({
101
+ filter: args.filter,
102
+ limit: args.maxResults ?? DEFAULT_ORDER_SCAN_LIMIT,
103
+ })
104
+ .pipe(Effect.map((result) => {
105
+ const orders = result.orders ?? [];
106
+ const matches = filterRefundedOrders(orders);
107
+ return {
108
+ totalScanned: orders.length,
109
+ totalMatched: matches.length,
110
+ orders: matches,
111
+ };
112
+ }))),
132
113
  }),
133
114
  // Payment Dispute Tools
134
115
  defineTool({
135
116
  name: 'ebay_get_payment_dispute_summaries',
136
117
  description: 'Get summaries of all payment disputes. Use filters to narrow results by dispute status, buyer username, or order ID.\n\nRequired OAuth Scope: sell.fulfillment\nMinimum Scope: https://api.ebay.com/oauth/api_scope/sell.fulfillment',
137
- inputSchema: {
138
- orderFilter: z
139
- .string()
140
- .optional()
141
- .describe('Filter by order ID (e.g., orderid:170123456789)'),
142
- buyerFilter: z
143
- .string()
144
- .optional()
145
- .describe('Filter by buyer username (e.g., buyer_username:testbuyer)'),
146
- openFilter: z
147
- .boolean()
148
- .optional()
149
- .describe('If true, only return open disputes. If false, only return closed disputes'),
150
- limit: z.number().optional().describe('Maximum number of disputes to return (default: 200)'),
151
- offset: z.number().optional().describe('Number of disputes to skip for pagination'),
152
- },
153
- outputSchema: zodToJsonSchema(getPaymentDisputesOutputSchema, {
118
+ inputSchema: getPaymentDisputeSummariesInputSchema.shape,
119
+ outputSchema: zodToJsonSchema(getPaymentDisputeSummariesOutputSchema, {
154
120
  name: 'GetPaymentDisputeSummariesResponse',
155
121
  $refStrategy: 'none',
156
122
  }),
157
- handler: (api, args) => api.dispute.getPaymentDisputeSummaries({
158
- order_id: args.orderFilter,
159
- buyer_username: args.buyerFilter,
160
- payment_dispute_status: args.openFilter ? 'OPEN' : undefined,
161
- limit: args.limit,
162
- offset: args.offset,
163
- }),
123
+ handler: (api, args) => Effect.runPromise(api.dispute.getPaymentDisputeSummaries(args)),
164
124
  ui: { archetype: 'table', map: mapDisputeSummariesToTable },
165
125
  }),
166
126
  defineTool({
167
127
  name: 'ebay_get_payment_dispute',
168
128
  description: 'Get detailed information about a specific payment dispute.\n\nRequired OAuth Scope: sell.fulfillment\nMinimum Scope: https://api.ebay.com/oauth/api_scope/sell.fulfillment',
169
- inputSchema: {
170
- paymentDisputeId: z.string().describe('The unique payment dispute ID'),
171
- },
129
+ inputSchema: getPaymentDisputeInputSchema.shape,
172
130
  outputSchema: {
173
131
  type: 'object',
174
132
  properties: {
175
133
  paymentDisputeId: { type: 'string' },
176
134
  orderId: { type: 'string' },
177
- status: { type: 'string' },
135
+ paymentDisputeStatus: { type: 'string' },
178
136
  reason: { type: 'string' },
179
137
  amount: { type: 'object' },
180
138
  },
181
139
  description: 'Payment dispute details',
182
140
  },
183
- handler: (api, args) => api.dispute.getPaymentDispute(args.paymentDisputeId),
141
+ handler: (api, args) => Effect.runPromise(api.dispute.getPaymentDispute(args)),
184
142
  ui: { archetype: 'card', map: mapDisputeToCard },
185
143
  }),
186
144
  defineTool({
187
145
  name: 'ebay_get_payment_dispute_activities',
188
146
  description: 'Get activity history for a payment dispute, including all actions taken by buyer, seller, and eBay.\n\nRequired OAuth Scope: sell.fulfillment\nMinimum Scope: https://api.ebay.com/oauth/api_scope/sell.fulfillment',
189
- inputSchema: {
190
- paymentDisputeId: z.string().describe('The payment dispute ID'),
191
- },
147
+ inputSchema: getActivitiesInputSchema.shape,
192
148
  outputSchema: {
193
149
  type: 'object',
194
150
  properties: {
@@ -196,141 +152,58 @@ export const fulfillmentEntries = [
196
152
  },
197
153
  description: 'Payment dispute activity history',
198
154
  },
199
- handler: (api, args) => api.dispute.getActivities(args.paymentDisputeId),
155
+ handler: (api, args) => Effect.runPromise(api.dispute.getActivities(args)),
200
156
  }),
201
157
  defineTool({
202
158
  name: 'ebay_accept_payment_dispute',
203
159
  description: 'Accept a payment dispute and allow eBay to refund the buyer. Use this when you agree with the buyer claim.\n\nRequired OAuth Scope: sell.fulfillment\nMinimum Scope: https://api.ebay.com/oauth/api_scope/sell.fulfillment',
204
- inputSchema: {
205
- paymentDisputeId: z.string().describe('The payment dispute ID to accept'),
206
- returnAddress: z
207
- .object({
208
- addressLine1: z.string().optional().describe('Street address line 1'),
209
- addressLine2: z.string().optional().describe('Street address line 2'),
210
- city: z.string().optional().describe('City name'),
211
- stateOrProvince: z.string().optional().describe('State or province'),
212
- postalCode: z.string().optional().describe('Postal/ZIP code'),
213
- countryCode: z.string().describe('Two-letter ISO 3166-1 country code (e.g., "US")'),
214
- })
215
- .optional()
216
- .describe('Return address for buyer to send item back (required for ITEM_NOT_RECEIVED disputes)'),
217
- revisionNumber: z
218
- .number()
219
- .optional()
220
- .describe('Dispute revision number for optimistic locking'),
221
- },
160
+ inputSchema: acceptPaymentDisputeInputSchema.shape,
222
161
  outputSchema: {
223
162
  type: 'object',
224
163
  properties: {},
225
164
  description: 'Empty response on successful acceptance (HTTP 204)',
226
165
  },
227
- handler: (api, args) => api.dispute.acceptPaymentDispute(args.paymentDisputeId, {
228
- returnAddress: args.returnAddress,
229
- revision: args.revisionNumber,
230
- }),
166
+ handler: (api, args) => Effect.runPromise(api.dispute.acceptPaymentDispute(args)),
231
167
  }),
232
168
  defineTool({
233
169
  name: 'ebay_contest_payment_dispute',
234
170
  description: 'Contest a payment dispute by providing evidence. Use this when you disagree with the buyer claim and want to provide proof.\n\nRequired OAuth Scope: sell.fulfillment\nMinimum Scope: https://api.ebay.com/oauth/api_scope/sell.fulfillment',
235
- inputSchema: {
236
- paymentDisputeId: z.string().describe('The payment dispute ID to contest'),
237
- returnAddress: z
238
- .object({
239
- addressLine1: z.string().optional(),
240
- addressLine2: z.string().optional(),
241
- city: z.string().optional(),
242
- stateOrProvince: z.string().optional(),
243
- postalCode: z.string().optional(),
244
- countryCode: z.string().describe('Two-letter ISO 3166-1 country code'),
245
- })
246
- .optional()
247
- .describe('Return address for item returns (if applicable)'),
248
- revisionNumber: z.number().optional().describe('Dispute revision number'),
249
- },
171
+ inputSchema: contestPaymentDisputeInputSchema.shape,
250
172
  outputSchema: {
251
173
  type: 'object',
252
174
  properties: {},
253
175
  description: 'Empty response on successful contest (HTTP 204)',
254
176
  },
255
- handler: (api, args) => api.dispute.contestPaymentDispute(args.paymentDisputeId, {
256
- returnAddress: args.returnAddress,
257
- revision: args.revisionNumber,
258
- }),
177
+ handler: (api, args) => Effect.runPromise(api.dispute.contestPaymentDispute(args)),
259
178
  }),
260
179
  defineTool({
261
180
  name: 'ebay_add_payment_dispute_evidence',
262
181
  description: 'Add evidence to support your case in a payment dispute. Provide evidence files and supporting information.\n\nRequired OAuth Scope: sell.fulfillment\nMinimum Scope: https://api.ebay.com/oauth/api_scope/sell.fulfillment',
263
- inputSchema: {
264
- paymentDisputeId: z.string().describe('The payment dispute ID'),
265
- evidenceId: z
266
- .string()
267
- .optional()
268
- .describe('Optional evidence ID to update existing evidence'),
269
- evidenceType: z
270
- .string()
271
- .optional()
272
- .describe('Type of evidence (e.g., PROOF_OF_DELIVERY, PROOF_OF_AUTHENTICITY)'),
273
- files: z
274
- .array(z.object({
275
- fileId: z.string().describe('File ID from uploadEvidenceFile'),
276
- }))
277
- .optional()
278
- .describe('Array of file IDs to attach as evidence'),
279
- lineItems: z
280
- .array(z.object({
281
- itemId: z.string().optional().describe('eBay item ID'),
282
- lineItemId: z.string().optional().describe('Order line item ID'),
283
- }))
284
- .optional()
285
- .describe('Line items this evidence applies to'),
286
- },
182
+ inputSchema: addEvidenceInputSchema.shape,
287
183
  outputSchema: {
288
184
  type: 'object',
289
- properties: {},
290
- description: 'Empty response on successful evidence addition (HTTP 204)',
185
+ properties: {
186
+ evidenceId: { type: 'string' },
187
+ },
188
+ description: 'Evidence set response returned after adding payment dispute evidence',
291
189
  },
292
- handler: (api, args) => api.dispute.addEvidence(args.paymentDisputeId, args),
190
+ handler: (api, args) => Effect.runPromise(api.dispute.addEvidence(args)),
293
191
  }),
294
192
  defineTool({
295
193
  name: 'ebay_update_payment_dispute_evidence',
296
194
  description: 'Update existing evidence in a payment dispute.\n\nRequired OAuth Scope: sell.fulfillment\nMinimum Scope: https://api.ebay.com/oauth/api_scope/sell.fulfillment',
297
- inputSchema: {
298
- paymentDisputeId: z.string().describe('The payment dispute ID'),
299
- evidenceId: z.string().describe('The evidence ID to update'),
300
- evidenceType: z.string().optional().describe('Updated evidence type'),
301
- files: z
302
- .array(z.object({
303
- fileId: z.string(),
304
- }))
305
- .optional()
306
- .describe('Updated file IDs'),
307
- lineItems: z
308
- .array(z.object({
309
- itemId: z.string().optional(),
310
- lineItemId: z.string().optional(),
311
- }))
312
- .optional()
313
- .describe('Updated line items'),
314
- },
195
+ inputSchema: updateEvidenceInputSchema.shape,
315
196
  outputSchema: {
316
197
  type: 'object',
317
198
  properties: {},
318
199
  description: 'Empty response on successful evidence update (HTTP 204)',
319
200
  },
320
- handler: (api, args) => api.dispute.updateEvidence(args.paymentDisputeId, args),
201
+ handler: (api, args) => Effect.runPromise(api.dispute.updateEvidence(args)),
321
202
  }),
322
203
  defineTool({
323
204
  name: 'ebay_upload_payment_dispute_evidence_file',
324
205
  description: 'Upload a file as evidence for a payment dispute (e.g., shipping receipt, photos). Returns a file ID to use with add_evidence.\n\nRequired OAuth Scope: sell.fulfillment\nMinimum Scope: https://api.ebay.com/oauth/api_scope/sell.fulfillment',
325
- inputSchema: {
326
- paymentDisputeId: z.string().describe('The payment dispute ID'),
327
- file: z
328
- .object({
329
- data: z.string().describe('Base64-encoded file data'),
330
- filename: z.string().describe('File name with extension'),
331
- })
332
- .describe('File to upload'),
333
- },
206
+ inputSchema: uploadEvidenceFileInputSchema.shape,
334
207
  outputSchema: {
335
208
  type: 'object',
336
209
  properties: {
@@ -338,16 +211,12 @@ export const fulfillmentEntries = [
338
211
  },
339
212
  description: 'File upload response with file ID',
340
213
  },
341
- handler: (api, args) => api.dispute.uploadEvidenceFile(args.paymentDisputeId, args.file),
214
+ handler: (api, args) => Effect.runPromise(api.dispute.uploadEvidenceFile(args)),
342
215
  }),
343
216
  defineTool({
344
217
  name: 'ebay_fetch_payment_dispute_evidence_content',
345
218
  description: 'Download evidence file content from a payment dispute.\n\nRequired OAuth Scope: sell.fulfillment\nMinimum Scope: https://api.ebay.com/oauth/api_scope/sell.fulfillment',
346
- inputSchema: {
347
- paymentDisputeId: z.string().describe('The payment dispute ID'),
348
- evidenceId: z.string().describe('The evidence ID'),
349
- fileId: z.string().describe('The file ID to download'),
350
- },
219
+ inputSchema: fetchEvidenceContentInputSchema.shape,
351
220
  outputSchema: {
352
221
  type: 'object',
353
222
  properties: {
@@ -356,6 +225,6 @@ export const fulfillmentEntries = [
356
225
  },
357
226
  description: 'File content and content type',
358
227
  },
359
- handler: (api, args) => api.dispute.fetchEvidenceContent(args.paymentDisputeId, args.evidenceId, args.fileId),
228
+ handler: (api, args) => Effect.runPromise(api.dispute.fetchEvidenceContent(args)),
360
229
  }),
361
230
  ];
@@ -1,14 +1,15 @@
1
1
  import { connectorEntries } from './connector.js';
2
- import { tokenManagementEntries } from './token-management.js';
2
+ import { tokenManagementEntries } from './tokenManagement.js';
3
3
  import { accountEntries } from './account.js';
4
4
  import { inventoryEntries } from './inventory.js';
5
5
  import { fulfillmentEntries } from './fulfillment.js';
6
- import { marketingEntries, marketingHandlerOnlyEntries } from './marketing.js';
6
+ import { marketingEntries } from './marketing.js';
7
7
  import { analyticsEntries } from './analytics.js';
8
8
  import { metadataEntries } from './metadata.js';
9
9
  import { taxonomyEntries } from './taxonomy.js';
10
- import { communicationEntries, communicationHandlerOnlyEntries } from './communication.js';
11
- import { otherEntries, claudeEntries } from './other.js';
10
+ import { communicationEntries } from './communication.js';
11
+ import { browseEntries } from './browse.js';
12
+ import { otherEntries } from './other.js';
12
13
  import { developerEntries } from './developer.js';
13
14
  import { tradingEntries } from './trading.js';
14
15
  /**
@@ -28,6 +29,7 @@ export const toolCategories = [
28
29
  { key: 'metadata', title: 'Metadata', entries: metadataEntries },
29
30
  { key: 'taxonomy', title: 'Taxonomy', entries: taxonomyEntries },
30
31
  { key: 'communication', title: 'Communication', entries: communicationEntries },
32
+ { key: 'browse', title: 'Browse', entries: browseEntries },
31
33
  { key: 'other', title: 'Other', entries: otherEntries },
32
34
  { key: 'developer', title: 'Developer', entries: developerEntries },
33
35
  { key: 'trading', title: 'Trading', entries: tradingEntries },
@@ -37,13 +39,3 @@ export const toolCategories = [
37
39
  * {@link toolCategories}.
38
40
  */
39
41
  export const registeredEntries = toolCategories.flatMap((category) => category.entries);
40
- /**
41
- * Handler-only entries: callable via `executeTool`/`getToolHandler` but intentionally
42
- * not advertised to MCP clients (no registered definition). Preserves prior behavior
43
- * for handlers that existed without a corresponding definition.
44
- */
45
- export const handlerOnlyEntries = [
46
- ...claudeEntries,
47
- ...communicationHandlerOnlyEntries,
48
- ...marketingHandlerOnlyEntries,
49
- ];