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,497 +1,222 @@
1
- import { z } from 'zod';
2
- import { rawTool } from '../../tools/define-tool.js';
1
+ import { defineTool } from '../../tools/defineTool.js';
2
+ import { Effect } from 'effect';
3
3
  import { getAwaitingFeedbackSchema, getFeedbackRatingSummarySchema, getFeedbackSchema, leaveFeedbackForBuyerSchema, respondToFeedbackSchema, } from '../../utils/communication/feedback.js';
4
4
  import { bulkUpdateConversationSchema, getConversationSchema, getConversationsSchema, sendMessageSchema, updateConversationSchema, } from '../../utils/communication/message.js';
5
- import { findEligibleItemsSchema, getOffersToBuyersSchema, sendOfferToInterestedBuyersSchema, } from '../../utils/communication/negotiation.js';
6
- import { createDestinationSchema, createSubscriptionFilterSchema, createSubscriptionSchema, deleteDestinationSchema, deleteSubscriptionFilterSchema, deleteSubscriptionSchema, disableSubscriptionSchema, enableSubscriptionSchema, getConfigSchema, getDestinationSchema, getPublicKeySchema, getSubscriptionFilterSchema, getSubscriptionSchema, getSubscriptionsSchema, getTopicSchema, getTopicsSchema, testSubscriptionSchema, updateConfigSchema, updateDestinationSchema, updateSubscriptionSchema, } from '../../utils/communication/notification.js';
5
+ import { findEligibleItemsSchema, sendOfferToInterestedBuyersSchema, } from '../../utils/communication/negotiation.js';
6
+ import { createDestinationSchema, createSubscriptionFilterSchema, createSubscriptionSchema, deleteDestinationSchema, deleteSubscriptionFilterSchema, deleteSubscriptionSchema, disableSubscriptionSchema, enableSubscriptionSchema, getConfigSchema, getDestinationSchema, getDestinationsSchema, getPublicKeySchema, getSubscriptionFilterSchema, getSubscriptionSchema, getSubscriptionsSchema, getTopicSchema, getTopicsSchema, testSubscriptionSchema, updateConfigSchema, updateDestinationSchema, updateSubscriptionSchema, } from '../../utils/communication/notification.js';
7
7
  /**
8
8
  * Communication API tools for member messages, notifications, and seller feedback.
9
9
  *
10
- * These tools use {@link rawTool} rather than `defineTool`: each handler validates
11
- * its arguments against a dedicated `@/utils/communication` schema (the real call
12
- * contract). The advertised input schema is taken from that same schema's `.shape`,
13
- * so MCP clients see exactly the fields the handler accepts — no re-parsing against
14
- * a divergent advertised schema, and no field-name drift between the two.
10
+ * Each tool derives its transport schema from the same Effect-backed object whose inferred
11
+ * args are passed directly to the endpoint method. Handlers stay at the MCP
12
+ * boundary: they run one endpoint Effect and avoid response or input reshaping.
15
13
  */
16
14
  export const communicationEntries = [
17
15
  // Negotiation API
18
- rawTool({
19
- name: 'ebay_get_offers_to_buyers',
20
- description: 'Get offers to buyers (Best Offers) for the seller',
21
- inputSchema: getOffersToBuyersSchema.shape,
22
- handler: (api, args) => {
23
- const validated = getOffersToBuyersSchema.parse(args);
24
- return api.negotiation.getOffersToBuyers(validated.filter, validated.limit ? Number(validated.limit) : undefined, validated.offset ? Number(validated.offset) : undefined);
25
- },
26
- }),
27
- rawTool({
16
+ defineTool({
17
+ name: 'ebay_find_eligible_items',
18
+ description: 'Find items eligible for Send Offer to Buyers',
19
+ inputSchema: findEligibleItemsSchema.shape,
20
+ handler: (api, args) => Effect.runPromise(api.negotiation.findEligibleItems(args)),
21
+ }),
22
+ defineTool({
28
23
  name: 'ebay_send_offer_to_interested_buyers',
29
24
  description: 'Send offer to interested buyers',
30
25
  inputSchema: sendOfferToInterestedBuyersSchema.shape,
31
- handler: (api, args) => {
32
- const validated = sendOfferToInterestedBuyersSchema.parse(args);
33
- return api.negotiation.sendOfferToInterestedBuyers(validated);
34
- },
35
- }),
36
- // Message API
37
- rawTool({
38
- name: 'ebay_search_messages',
39
- description: 'Search for buyer-seller messages',
40
- inputSchema: getConversationsSchema.shape,
41
- handler: (api, args) => {
42
- const validated = getConversationsSchema.parse(args);
43
- return api.message.searchMessages(undefined, validated.limit ? Number(validated.limit) : undefined, validated.offset ? Number(validated.offset) : undefined);
44
- },
45
- }),
46
- rawTool({
47
- name: 'ebay_get_message',
48
- description: 'Get a specific message by ID',
49
- inputSchema: getConversationSchema.shape,
50
- handler: (api, args) => {
51
- const validated = getConversationSchema.parse(args);
52
- return api.message.getMessage(validated.conversation_id);
53
- },
54
- }),
55
- rawTool({
56
- name: 'ebay_send_message',
57
- description: 'Send a direct message to a buyer regarding a specific transaction or inquiry. Use this to communicate about orders, answer questions, resolve issues, or provide updates. Provide message_text plus either conversation_id (to reply) or other_party_username (to start a new thread).',
58
- inputSchema: sendMessageSchema.shape,
59
- handler: (api, args) => {
60
- const validated = sendMessageSchema.parse(args);
61
- return api.message.sendMessage(validated);
62
- },
63
- }),
64
- rawTool({
65
- name: 'ebay_reply_to_message',
66
- description: 'Reply to a buyer message in an existing conversation thread',
67
- inputSchema: {
68
- messageId: z.string().describe('The conversation/message ID to reply to'),
69
- messageContent: z.string().describe('The reply message content'),
70
- },
71
- handler: (api, args) => {
72
- if (!args.messageId || !args.messageContent) {
73
- throw new Error('messageId and messageContent are required');
74
- }
75
- return api.message.replyToMessage(args.messageId, args.messageContent);
76
- },
26
+ handler: (api, args) => Effect.runPromise(api.negotiation.sendOfferToInterestedBuyers(args)),
77
27
  }),
78
28
  // Notification API
79
- rawTool({
29
+ defineTool({
80
30
  name: 'ebay_get_notification_config',
81
31
  description: 'Get notification configuration',
82
- inputSchema: {},
83
- handler: (api, args) => {
84
- getConfigSchema.parse(args);
85
- return api.notification.getConfig();
86
- },
32
+ inputSchema: getConfigSchema.shape,
33
+ handler: (api, args) => Effect.runPromise(api.notification.getConfig(args)),
87
34
  }),
88
- rawTool({
35
+ defineTool({
89
36
  name: 'ebay_update_notification_config',
90
37
  description: 'Update notification configuration',
91
38
  inputSchema: updateConfigSchema.shape,
92
- handler: (api, args) => {
93
- const validated = updateConfigSchema.parse(args);
94
- return api.notification.updateConfig(validated);
95
- },
39
+ handler: (api, args) => Effect.runPromise(api.notification.updateConfig(args)),
96
40
  }),
97
- rawTool({
41
+ defineTool({
98
42
  name: 'ebay_get_notification_destinations',
99
43
  description: 'Get all notification destinations (paginated)',
100
- inputSchema: {
101
- limit: z
102
- .number()
103
- .optional()
104
- .describe('Maximum number of destinations to return (10-100, default: 20)'),
105
- continuationToken: z.string().optional().describe('Token to retrieve next page of results'),
106
- },
107
- handler: (api, args) => api.notification.getDestinations(args.limit, args.continuationToken),
108
- }),
109
- rawTool({
44
+ inputSchema: getDestinationsSchema.shape,
45
+ handler: (api, args) => Effect.runPromise(api.notification.getDestinations(args)),
46
+ }),
47
+ defineTool({
110
48
  name: 'ebay_create_notification_destination',
111
49
  description: 'Create a notification destination',
112
50
  inputSchema: createDestinationSchema.shape,
113
- handler: (api, args) => {
114
- const validated = createDestinationSchema.parse(args);
115
- return api.notification.createDestination(validated);
116
- },
51
+ handler: (api, args) => Effect.runPromise(api.notification.createDestination(args)),
117
52
  }),
118
53
  // Notification API - Destination CRUD
119
- rawTool({
54
+ defineTool({
120
55
  name: 'ebay_get_notification_destination',
121
56
  description: 'Get a specific notification destination by ID',
122
- inputSchema: {
123
- destination_id: z.string().describe('The unique identifier for the destination'),
124
- },
125
- handler: (api, args) => {
126
- const validated = getDestinationSchema.parse(args);
127
- return api.notification.getDestination(validated.destination_id);
128
- },
129
- }),
130
- rawTool({
57
+ inputSchema: getDestinationSchema.shape,
58
+ handler: (api, args) => Effect.runPromise(api.notification.getDestination(args)),
59
+ }),
60
+ defineTool({
131
61
  name: 'ebay_update_notification_destination',
132
62
  description: 'Update a notification destination',
133
- inputSchema: {
134
- destination_id: z.string().describe('The unique identifier for the destination'),
135
- delivery_config: z
136
- .object({
137
- endpoint: z.string().optional().describe('HTTPS endpoint URL'),
138
- verification_token: z
139
- .string()
140
- .optional()
141
- .describe('Verification token (32-80 characters)'),
142
- })
143
- .optional()
144
- .describe('Delivery configuration'),
145
- name: z.string().optional().describe('Destination name'),
146
- status: z.string().optional().describe('Status: ENABLED or DISABLED'),
147
- },
148
- handler: (api, args) => {
149
- const validated = updateDestinationSchema.parse(args);
150
- return api.notification.updateDestination(validated.destination_id, validated);
151
- },
152
- }),
153
- rawTool({
63
+ inputSchema: updateDestinationSchema.shape,
64
+ handler: (api, args) => Effect.runPromise(api.notification.updateDestination(args)),
65
+ }),
66
+ defineTool({
154
67
  name: 'ebay_delete_notification_destination',
155
68
  description: 'Delete a notification destination',
156
- inputSchema: {
157
- destination_id: z.string().describe('The unique identifier for the destination'),
158
- },
159
- handler: (api, args) => {
160
- const validated = deleteDestinationSchema.parse(args);
161
- return api.notification.deleteDestination(validated.destination_id);
162
- },
69
+ inputSchema: deleteDestinationSchema.shape,
70
+ handler: (api, args) => Effect.runPromise(api.notification.deleteDestination(args)),
163
71
  }),
164
72
  // Notification API - Subscription CRUD
165
- rawTool({
73
+ defineTool({
166
74
  name: 'ebay_get_notification_subscriptions',
167
75
  description: 'Get all notification subscriptions (paginated)',
168
- inputSchema: {
169
- limit: z.string().optional().describe('Maximum number of subscriptions to return'),
170
- continuation_token: z.string().optional().describe('Token for pagination'),
171
- },
172
- handler: (api, args) => {
173
- const validated = getSubscriptionsSchema.parse(args);
174
- return api.notification.getSubscriptions(validated.limit ? Number(validated.limit) : undefined, validated.continuation_token);
175
- },
176
- }),
177
- rawTool({
76
+ inputSchema: getSubscriptionsSchema.shape,
77
+ handler: (api, args) => Effect.runPromise(api.notification.getSubscriptions(args)),
78
+ }),
79
+ defineTool({
178
80
  name: 'ebay_create_notification_subscription',
179
81
  description: 'Create a notification subscription',
180
- inputSchema: {
181
- destination_id: z.string().optional().describe('The destination endpoint ID'),
182
- payload: z
183
- .object({
184
- delivery_protocol: z.string().optional().describe('Delivery protocol (HTTPS)'),
185
- format: z.string().optional().describe('Payload format (JSON)'),
186
- schema_version: z.string().optional().describe('Schema version'),
187
- })
188
- .optional()
189
- .describe('Payload configuration'),
190
- status: z.string().optional().describe('Status: ENABLED or DISABLED'),
191
- topic_id: z.string().optional().describe('The notification topic ID'),
192
- },
193
- handler: (api, args) => {
194
- const validated = createSubscriptionSchema.parse(args);
195
- return api.notification.createSubscription(validated);
196
- },
197
- }),
198
- rawTool({
82
+ inputSchema: createSubscriptionSchema.shape,
83
+ handler: (api, args) => Effect.runPromise(api.notification.createSubscription(args)),
84
+ }),
85
+ defineTool({
199
86
  name: 'ebay_get_notification_subscription',
200
87
  description: 'Get a specific notification subscription by ID',
201
- inputSchema: {
202
- subscription_id: z.string().describe('The unique identifier for the subscription'),
203
- },
204
- handler: (api, args) => {
205
- const validated = getSubscriptionSchema.parse(args);
206
- return api.notification.getSubscription(validated.subscription_id);
207
- },
208
- }),
209
- rawTool({
88
+ inputSchema: getSubscriptionSchema.shape,
89
+ handler: (api, args) => Effect.runPromise(api.notification.getSubscription(args)),
90
+ }),
91
+ defineTool({
210
92
  name: 'ebay_update_notification_subscription',
211
93
  description: 'Update a notification subscription',
212
- inputSchema: {
213
- subscription_id: z.string().describe('The unique identifier for the subscription'),
214
- destination_id: z.string().optional().describe('The destination endpoint ID'),
215
- payload: z
216
- .object({
217
- delivery_protocol: z.string().optional().describe('Delivery protocol'),
218
- format: z.string().optional().describe('Payload format'),
219
- schema_version: z.string().optional().describe('Schema version'),
220
- })
221
- .optional()
222
- .describe('Payload configuration'),
223
- status: z.string().optional().describe('Status: ENABLED or DISABLED'),
224
- },
225
- handler: (api, args) => {
226
- const validated = updateSubscriptionSchema.parse(args);
227
- return api.notification.updateSubscription(validated.subscription_id, validated);
228
- },
229
- }),
230
- rawTool({
94
+ inputSchema: updateSubscriptionSchema.shape,
95
+ handler: (api, args) => Effect.runPromise(api.notification.updateSubscription(args)),
96
+ }),
97
+ defineTool({
231
98
  name: 'ebay_delete_notification_subscription',
232
99
  description: 'Delete a notification subscription',
233
- inputSchema: {
234
- subscription_id: z.string().describe('The unique identifier for the subscription'),
235
- },
236
- handler: (api, args) => {
237
- const validated = deleteSubscriptionSchema.parse(args);
238
- return api.notification.deleteSubscription(validated.subscription_id);
239
- },
240
- }),
241
- rawTool({
100
+ inputSchema: deleteSubscriptionSchema.shape,
101
+ handler: (api, args) => Effect.runPromise(api.notification.deleteSubscription(args)),
102
+ }),
103
+ defineTool({
242
104
  name: 'ebay_disable_notification_subscription',
243
105
  description: 'Disable a notification subscription',
244
- inputSchema: {
245
- subscription_id: z.string().describe('The unique identifier for the subscription'),
246
- },
247
- handler: (api, args) => {
248
- const validated = disableSubscriptionSchema.parse(args);
249
- return api.notification.disableSubscription(validated.subscription_id);
250
- },
251
- }),
252
- rawTool({
106
+ inputSchema: disableSubscriptionSchema.shape,
107
+ handler: (api, args) => Effect.runPromise(api.notification.disableSubscription(args)),
108
+ }),
109
+ defineTool({
253
110
  name: 'ebay_enable_notification_subscription',
254
111
  description: 'Enable a notification subscription',
255
- inputSchema: {
256
- subscription_id: z.string().describe('The unique identifier for the subscription'),
257
- },
258
- handler: (api, args) => {
259
- const validated = enableSubscriptionSchema.parse(args);
260
- return api.notification.enableSubscription(validated.subscription_id);
261
- },
262
- }),
263
- rawTool({
112
+ inputSchema: enableSubscriptionSchema.shape,
113
+ handler: (api, args) => Effect.runPromise(api.notification.enableSubscription(args)),
114
+ }),
115
+ defineTool({
264
116
  name: 'ebay_test_notification_subscription',
265
117
  description: 'Test a notification subscription by sending a test message',
266
- inputSchema: {
267
- subscription_id: z.string().describe('The unique identifier for the subscription'),
268
- },
269
- handler: (api, args) => {
270
- const validated = testSubscriptionSchema.parse(args);
271
- return api.notification.testSubscription(validated.subscription_id);
272
- },
118
+ inputSchema: testSubscriptionSchema.shape,
119
+ handler: (api, args) => Effect.runPromise(api.notification.testSubscription(args)),
273
120
  }),
274
121
  // Notification API - Subscription Filters
275
- rawTool({
122
+ defineTool({
276
123
  name: 'ebay_create_notification_subscription_filter',
277
124
  description: 'Create a filter for a notification subscription',
278
- inputSchema: {
279
- subscription_id: z.string().describe('The unique identifier for the subscription'),
280
- filter_schema: z
281
- .record(z.string(), z.unknown())
282
- .optional()
283
- .describe('JSON Schema document to filter notifications'),
284
- },
285
- handler: (api, args) => {
286
- const validated = createSubscriptionFilterSchema.parse(args);
287
- return api.notification.createSubscriptionFilter(validated.subscription_id, validated);
288
- },
289
- }),
290
- rawTool({
125
+ inputSchema: createSubscriptionFilterSchema.shape,
126
+ handler: (api, args) => Effect.runPromise(api.notification.createSubscriptionFilter(args)),
127
+ }),
128
+ defineTool({
291
129
  name: 'ebay_get_notification_subscription_filter',
292
130
  description: 'Get a specific subscription filter',
293
- inputSchema: {
294
- subscription_id: z.string().describe('The unique identifier for the subscription'),
295
- filter_id: z.string().describe('The unique identifier for the filter'),
296
- },
297
- handler: (api, args) => {
298
- const validated = getSubscriptionFilterSchema.parse(args);
299
- return api.notification.getSubscriptionFilter(validated.subscription_id, validated.filter_id);
300
- },
301
- }),
302
- rawTool({
131
+ inputSchema: getSubscriptionFilterSchema.shape,
132
+ handler: (api, args) => Effect.runPromise(api.notification.getSubscriptionFilter(args)),
133
+ }),
134
+ defineTool({
303
135
  name: 'ebay_delete_notification_subscription_filter',
304
136
  description: 'Delete a subscription filter',
305
- inputSchema: {
306
- subscription_id: z.string().describe('The unique identifier for the subscription'),
307
- filter_id: z.string().describe('The unique identifier for the filter'),
308
- },
309
- handler: (api, args) => {
310
- const validated = deleteSubscriptionFilterSchema.parse(args);
311
- return api.notification.deleteSubscriptionFilter(validated.subscription_id, validated.filter_id);
312
- },
137
+ inputSchema: deleteSubscriptionFilterSchema.shape,
138
+ handler: (api, args) => Effect.runPromise(api.notification.deleteSubscriptionFilter(args)),
313
139
  }),
314
140
  // Notification API - Topics
315
- rawTool({
141
+ defineTool({
316
142
  name: 'ebay_get_notification_topic',
317
143
  description: 'Get a specific notification topic by ID',
318
- inputSchema: {
319
- topic_id: z.string().describe('The unique identifier for the topic'),
320
- },
321
- handler: (api, args) => {
322
- const validated = getTopicSchema.parse(args);
323
- return api.notification.getTopic(validated.topic_id);
324
- },
325
- }),
326
- rawTool({
144
+ inputSchema: getTopicSchema.shape,
145
+ handler: (api, args) => Effect.runPromise(api.notification.getTopic(args)),
146
+ }),
147
+ defineTool({
327
148
  name: 'ebay_get_notification_topics',
328
149
  description: 'Get all available notification topics (paginated)',
329
- inputSchema: {
330
- limit: z.string().optional().describe('Maximum number of topics to return'),
331
- continuation_token: z.string().optional().describe('Token for pagination'),
332
- },
333
- handler: (api, args) => {
334
- const validated = getTopicsSchema.parse(args);
335
- return api.notification.getTopics(validated.limit ? Number(validated.limit) : undefined, validated.continuation_token);
336
- },
150
+ inputSchema: getTopicsSchema.shape,
151
+ handler: (api, args) => Effect.runPromise(api.notification.getTopics(args)),
337
152
  }),
338
153
  // Notification API - Public Key
339
- rawTool({
154
+ defineTool({
340
155
  name: 'ebay_get_notification_public_key',
341
156
  description: 'Get a public key for verifying notification signatures',
342
- inputSchema: {
343
- public_key_id: z.string().describe('The unique identifier for the public key'),
344
- },
345
- handler: (api, args) => {
346
- const validated = getPublicKeySchema.parse(args);
347
- return api.notification.getPublicKey(validated.public_key_id);
348
- },
157
+ inputSchema: getPublicKeySchema.shape,
158
+ handler: (api, args) => Effect.runPromise(api.notification.getPublicKey(args)),
349
159
  }),
350
160
  // Message API - Conversations
351
- rawTool({
161
+ defineTool({
352
162
  name: 'ebay_get_conversations',
353
163
  description: 'Get all buyer-seller conversations (paginated)',
354
164
  inputSchema: getConversationsSchema.shape,
355
- handler: (api, args) => {
356
- const validated = getConversationsSchema.parse(args);
357
- return api.message.getConversations(undefined, validated.limit ? Number(validated.limit) : undefined, validated.offset ? Number(validated.offset) : undefined);
358
- },
165
+ handler: (api, args) => Effect.runPromise(api.message.getConversations(args)),
359
166
  }),
360
- rawTool({
167
+ defineTool({
361
168
  name: 'ebay_get_conversation',
362
169
  description: 'Get a specific conversation by ID',
363
170
  inputSchema: getConversationSchema.shape,
364
- handler: (api, args) => {
365
- const validated = getConversationSchema.parse(args);
366
- return api.message.getConversation(validated.conversation_id);
367
- },
171
+ handler: (api, args) => Effect.runPromise(api.message.getConversation(args)),
368
172
  }),
369
- rawTool({
173
+ defineTool({
174
+ name: 'ebay_send_message',
175
+ description: 'Send a direct message to a buyer regarding a specific transaction or inquiry. Use this to communicate about orders, answer questions, resolve issues, or provide updates.',
176
+ inputSchema: sendMessageSchema.shape,
177
+ handler: (api, args) => Effect.runPromise(api.message.sendMessage(args)),
178
+ }),
179
+ defineTool({
370
180
  name: 'ebay_bulk_update_conversation',
371
- description: 'Bulk update multiple conversations. Each entry sets conversation_status (ACTIVE, ARCHIVE, DELETE, READ, UNREAD) for a conversation_id.',
181
+ description: 'Bulk update multiple conversations. Each entry sets conversationStatus (ACTIVE, ARCHIVE, DELETE, READ, UNREAD) for a conversationId.',
372
182
  inputSchema: bulkUpdateConversationSchema.shape,
373
- handler: (api, args) => {
374
- const validated = bulkUpdateConversationSchema.parse(args);
375
- return api.message.bulkUpdateConversation(validated);
376
- },
183
+ handler: (api, args) => Effect.runPromise(api.message.bulkUpdateConversation(args)),
377
184
  }),
378
- rawTool({
185
+ defineTool({
379
186
  name: 'ebay_update_conversation',
380
- description: 'Update a single conversation (conversation_status: ACTIVE, ARCHIVE, DELETE; or read flag).',
187
+ description: 'Update a single conversation (conversationStatus: ACTIVE, ARCHIVE, DELETE; or read flag).',
381
188
  inputSchema: updateConversationSchema.shape,
382
- handler: (api, args) => {
383
- const validated = updateConversationSchema.parse(args);
384
- return api.message.updateConversation(validated);
385
- },
189
+ handler: (api, args) => Effect.runPromise(api.message.updateConversation(args)),
386
190
  }),
387
191
  // Feedback API
388
- rawTool({
192
+ defineTool({
389
193
  name: 'ebay_get_feedback',
390
194
  description: 'Get feedback for a user by type',
391
- inputSchema: {
392
- user_id: z.string().describe('The eBay username of the user'),
393
- feedback_type: z.string().describe('Type: FEEDBACK_RECEIVED or FEEDBACK_SENT'),
394
- feedback_id: z.string().optional().describe('Filter by specific feedback ID'),
395
- filter: z.string().optional().describe('Filter criteria'),
396
- limit: z.string().optional().describe('Maximum number of feedback items to return'),
397
- listing_id: z.string().optional().describe('Filter by listing ID'),
398
- offset: z.string().optional().describe('Number of items to skip'),
399
- order_line_item_id: z.string().optional().describe('Filter by order line item ID'),
400
- sort: z.string().optional().describe('Sort order'),
401
- transaction_id: z.string().optional().describe('Filter by transaction ID'),
402
- },
403
- handler: (api, args) => {
404
- const validated = getFeedbackSchema.parse(args);
405
- return api.feedback.getFeedback(validated.transaction_id ?? '');
406
- },
407
- }),
408
- rawTool({
195
+ inputSchema: getFeedbackSchema.shape,
196
+ handler: (api, args) => Effect.runPromise(api.feedback.getFeedback(args)),
197
+ }),
198
+ defineTool({
409
199
  name: 'ebay_leave_feedback_for_buyer',
410
- description: 'Leave feedback for a buyer. Provide order_line_item_id, comment_type (POSITIVE/NEUTRAL/NEGATIVE), and comment_text.',
200
+ description: 'Leave feedback for a buyer. Provide orderLineItemId, commentType (POSITIVE/NEUTRAL/NEGATIVE), and commentText.',
411
201
  inputSchema: leaveFeedbackForBuyerSchema.shape,
412
- handler: (api, args) => {
413
- const validated = leaveFeedbackForBuyerSchema.parse(args);
414
- return api.feedback.leaveFeedbackForBuyer(validated);
415
- },
416
- }),
417
- rawTool({
418
- name: 'ebay_get_feedback_summary',
419
- description: 'Get feedback summary for the seller',
420
- inputSchema: {},
421
- outputSchema: {
422
- type: 'object',
423
- properties: {},
424
- description: 'Success response',
425
- },
426
- handler: (api) => api.feedback.getFeedbackSummary(),
427
- }),
428
- rawTool({
202
+ handler: (api, args) => Effect.runPromise(api.feedback.leaveFeedbackForBuyer(args)),
203
+ }),
204
+ defineTool({
429
205
  name: 'ebay_get_awaiting_feedback',
430
206
  description: 'Get transactions awaiting feedback from the seller',
431
- inputSchema: {
432
- filter: z.string().optional().describe('Filter criteria'),
433
- limit: z.string().optional().describe('Maximum number of items to return (25-200)'),
434
- offset: z.string().optional().describe('Number of items to skip'),
435
- sort: z.string().optional().describe('Sort order'),
436
- },
437
- handler: (api, args) => {
438
- const validated = getAwaitingFeedbackSchema.parse(args);
439
- return api.feedback.getAwaitingFeedback(validated.filter, validated.limit ? Number(validated.limit) : undefined, validated.offset ? Number(validated.offset) : undefined);
440
- },
441
- }),
442
- rawTool({
207
+ inputSchema: getAwaitingFeedbackSchema.shape,
208
+ handler: (api, args) => Effect.runPromise(api.feedback.getAwaitingFeedback(args)),
209
+ }),
210
+ defineTool({
443
211
  name: 'ebay_respond_to_feedback',
444
212
  description: 'Respond to feedback received from a buyer',
445
- inputSchema: {
446
- feedback_id: z.string().optional().describe('The feedback ID being responded to'),
447
- recipient_user_id: z.string().optional().describe('The user ID of the feedback provider'),
448
- response_text: z
449
- .string()
450
- .optional()
451
- .describe('The response text content (max 500 characters)'),
452
- response_type: z.string().optional().describe('The response type: REPLY or FOLLOW_UP'),
453
- },
454
- handler: (api, args) => {
455
- const validated = respondToFeedbackSchema.parse(args);
456
- return api.feedback.respondToFeedback(validated.feedback_id ?? '', validated.response_text ?? '');
457
- },
458
- }),
459
- rawTool({
213
+ inputSchema: respondToFeedbackSchema.shape,
214
+ handler: (api, args) => Effect.runPromise(api.feedback.respondToFeedback(args)),
215
+ }),
216
+ defineTool({
460
217
  name: 'ebay_get_feedback_rating_summary',
461
218
  description: 'Get feedback rating summary for a user',
462
- inputSchema: {
463
- user_id: z.string().describe('The eBay username of the user'),
464
- filter: z.string().describe('Filter with required ratingType parameter'),
465
- },
466
- handler: (api, args) => {
467
- getFeedbackRatingSummarySchema.parse(args);
468
- return api.feedback.getFeedbackRatingSummary();
469
- },
470
- }),
471
- ];
472
- /**
473
- * Handler-only negotiation tool.
474
- *
475
- * `ebay_find_eligible_items` has a handler but no registered definition (matching
476
- * prior behavior, where it was absent from the definitions catalog). It is exposed
477
- * via `handlerOnlyEntries` so it remains callable through `executeTool` without
478
- * being advertised to MCP clients.
479
- */
480
- export const communicationHandlerOnlyEntries = [
481
- rawTool({
482
- name: 'ebay_find_eligible_items',
483
- description: 'Find items eligible for Send Offer to Buyers',
484
- inputSchema: {
485
- marketplace_id: z
486
- .string()
487
- .optional()
488
- .describe('The eBay marketplace ID (X-EBAY-C-MARKETPLACE-ID header)'),
489
- limit: z.string().optional().describe('Maximum number of items to return (1-200)'),
490
- offset: z.string().optional().describe('Number of items to skip'),
491
- },
492
- handler: (api, args) => {
493
- const validated = findEligibleItemsSchema.parse(args);
494
- return api.negotiation.findEligibleItems(validated.marketplace_id, validated.limit ? Number(validated.limit) : undefined, validated.offset ? Number(validated.offset) : undefined);
495
- },
219
+ inputSchema: getFeedbackRatingSummarySchema.shape,
220
+ handler: (api, args) => Effect.runPromise(api.feedback.getFeedbackRatingSummary(args)),
496
221
  }),
497
222
  ];