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.
- package/LICENSE +201 -0
- package/README.md +586 -0
- package/build/api/account-management/account.d.ts +216 -0
- package/build/api/account-management/account.js +305 -0
- package/build/api/analytics-and-report/analytics.d.ts +33 -0
- package/build/api/analytics-and-report/analytics.js +102 -0
- package/build/api/client.d.ts +89 -0
- package/build/api/client.js +343 -0
- package/build/api/communication/feedback.d.ts +45 -0
- package/build/api/communication/feedback.js +119 -0
- package/build/api/communication/message.d.ts +55 -0
- package/build/api/communication/message.js +131 -0
- package/build/api/communication/negotiation.d.ts +39 -0
- package/build/api/communication/negotiation.js +97 -0
- package/build/api/communication/notification.d.ts +128 -0
- package/build/api/communication/notification.js +373 -0
- package/build/api/index.d.ts +96 -0
- package/build/api/index.js +121 -0
- package/build/api/listing-management/inventory.d.ts +216 -0
- package/build/api/listing-management/inventory.js +633 -0
- package/build/api/listing-metadata/metadata.d.ts +154 -0
- package/build/api/listing-metadata/metadata.js +485 -0
- package/build/api/listing-metadata/taxonomy.d.ts +38 -0
- package/build/api/listing-metadata/taxonomy.js +58 -0
- package/build/api/marketing-and-promotions/marketing.d.ts +395 -0
- package/build/api/marketing-and-promotions/marketing.js +565 -0
- package/build/api/marketing-and-promotions/recommendation.d.ts +20 -0
- package/build/api/marketing-and-promotions/recommendation.js +32 -0
- package/build/api/order-management/dispute.d.ts +65 -0
- package/build/api/order-management/dispute.js +69 -0
- package/build/api/order-management/fulfillment.d.ts +80 -0
- package/build/api/order-management/fulfillment.js +89 -0
- package/build/api/other/compliance.d.ts +26 -0
- package/build/api/other/compliance.js +47 -0
- package/build/api/other/edelivery.d.ts +153 -0
- package/build/api/other/edelivery.js +219 -0
- package/build/api/other/identity.d.ts +17 -0
- package/build/api/other/identity.js +24 -0
- package/build/api/other/translation.d.ts +14 -0
- package/build/api/other/translation.js +22 -0
- package/build/api/other/vero.d.ts +30 -0
- package/build/api/other/vero.js +48 -0
- package/build/auth/oauth-metadata.d.ts +46 -0
- package/build/auth/oauth-metadata.js +59 -0
- package/build/auth/oauth-middleware.d.ts +35 -0
- package/build/auth/oauth-middleware.js +99 -0
- package/build/auth/oauth-types.d.ts +66 -0
- package/build/auth/oauth-types.js +4 -0
- package/build/auth/oauth.d.ts +93 -0
- package/build/auth/oauth.js +383 -0
- package/build/auth/scope-utils.d.ts +70 -0
- package/build/auth/scope-utils.js +304 -0
- package/build/auth/token-verifier.d.ts +57 -0
- package/build/auth/token-verifier.js +172 -0
- package/build/config/environment.d.ts +61 -0
- package/build/config/environment.js +260 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +98 -0
- package/build/schemas/account-management/account.d.ts +5324 -0
- package/build/schemas/account-management/account.js +366 -0
- package/build/schemas/analytics/analytics.d.ts +167 -0
- package/build/schemas/analytics/analytics.js +191 -0
- package/build/schemas/communication/messages.d.ts +1872 -0
- package/build/schemas/communication/messages.js +348 -0
- package/build/schemas/fulfillment/orders.d.ts +4655 -0
- package/build/schemas/fulfillment/orders.js +317 -0
- package/build/schemas/index.d.ts +2100 -0
- package/build/schemas/index.js +68 -0
- package/build/schemas/inventory-management/inventory.d.ts +6419 -0
- package/build/schemas/inventory-management/inventory.js +450 -0
- package/build/schemas/marketing/marketing.d.ts +14181 -0
- package/build/schemas/marketing/marketing.js +1088 -0
- package/build/schemas/metadata/metadata.d.ts +5259 -0
- package/build/schemas/metadata/metadata.js +614 -0
- package/build/schemas/other/other-apis.d.ts +257 -0
- package/build/schemas/other/other-apis.js +372 -0
- package/build/schemas/taxonomy/taxonomy.d.ts +215 -0
- package/build/schemas/taxonomy/taxonomy.js +571 -0
- package/build/scripts/auto-setup.d.ts +12 -0
- package/build/scripts/auto-setup.js +277 -0
- package/build/scripts/diagnostics.d.ts +8 -0
- package/build/scripts/diagnostics.js +299 -0
- package/build/scripts/download-specs.d.ts +1 -0
- package/build/scripts/download-specs.js +116 -0
- package/build/scripts/interactive-setup.d.ts +21 -0
- package/build/scripts/interactive-setup.js +723 -0
- package/build/server-http.d.ts +11 -0
- package/build/server-http.js +361 -0
- package/build/tools/definitions/account-with-schemas.d.ts +39 -0
- package/build/tools/definitions/account-with-schemas.js +170 -0
- package/build/tools/definitions/account.d.ts +12 -0
- package/build/tools/definitions/account.js +428 -0
- package/build/tools/definitions/analytics.d.ts +25 -0
- package/build/tools/definitions/analytics.js +66 -0
- package/build/tools/definitions/communication.d.ts +12 -0
- package/build/tools/definitions/communication.js +151 -0
- package/build/tools/definitions/fulfillment.d.ts +12 -0
- package/build/tools/definitions/fulfillment.js +326 -0
- package/build/tools/definitions/index.d.ts +25 -0
- package/build/tools/definitions/index.js +37 -0
- package/build/tools/definitions/inventory.d.ts +12 -0
- package/build/tools/definitions/inventory.js +429 -0
- package/build/tools/definitions/marketing.d.ts +12 -0
- package/build/tools/definitions/marketing.js +1095 -0
- package/build/tools/definitions/metadata.d.ts +12 -0
- package/build/tools/definitions/metadata.js +188 -0
- package/build/tools/definitions/other.d.ts +13 -0
- package/build/tools/definitions/other.js +309 -0
- package/build/tools/definitions/taxonomy.d.ts +25 -0
- package/build/tools/definitions/taxonomy.js +64 -0
- package/build/tools/definitions/token-management.d.ts +35 -0
- package/build/tools/definitions/token-management.js +103 -0
- package/build/tools/index.d.ts +11 -0
- package/build/tools/index.js +1003 -0
- package/build/tools/schemas.d.ts +14764 -0
- package/build/tools/schemas.js +667 -0
- package/build/tools/tool-definitions.d.ts +35 -0
- package/build/tools/tool-definitions.js +3534 -0
- package/build/types/application-settings/developerAnalyticsV1BetaOas3.d.ts +197 -0
- package/build/types/application-settings/developerAnalyticsV1BetaOas3.js +5 -0
- package/build/types/application-settings/developerClientRegistrationV1Oas3.d.ts +155 -0
- package/build/types/application-settings/developerClientRegistrationV1Oas3.js +5 -0
- package/build/types/application-settings/developerKeyManagementV1Oas3.d.ts +246 -0
- package/build/types/application-settings/developerKeyManagementV1Oas3.js +5 -0
- package/build/types/ebay-enums.d.ts +1204 -0
- package/build/types/ebay-enums.js +1330 -0
- package/build/types/ebay.d.ts +143 -0
- package/build/types/ebay.js +123 -0
- package/build/types/index.d.ts +6 -0
- package/build/types/index.js +10 -0
- package/build/types/sell-apps/account-management/sellAccountV1Oas3.d.ts +2579 -0
- package/build/types/sell-apps/account-management/sellAccountV1Oas3.js +5 -0
- package/build/types/sell-apps/analytics-and-report/sellAnalyticsV1Oas3.d.ts +446 -0
- package/build/types/sell-apps/analytics-and-report/sellAnalyticsV1Oas3.js +5 -0
- package/build/types/sell-apps/communication/commerceFeedbackV1BetaOas3.d.ts +705 -0
- package/build/types/sell-apps/communication/commerceFeedbackV1BetaOas3.js +5 -0
- package/build/types/sell-apps/communication/commerceMessageV1Oas3.d.ts +590 -0
- package/build/types/sell-apps/communication/commerceMessageV1Oas3.js +5 -0
- package/build/types/sell-apps/communication/commerceNotificationV1Oas3.d.ts +1276 -0
- package/build/types/sell-apps/communication/commerceNotificationV1Oas3.js +5 -0
- package/build/types/sell-apps/communication/sellNegotiationV1Oas3.d.ts +277 -0
- package/build/types/sell-apps/communication/sellNegotiationV1Oas3.js +5 -0
- package/build/types/sell-apps/listing-management/sellInventoryV1Oas3.d.ts +3133 -0
- package/build/types/sell-apps/listing-management/sellInventoryV1Oas3.js +5 -0
- package/build/types/sell-apps/listing-metadata/sellMetadataV1Oas3.d.ts +2289 -0
- package/build/types/sell-apps/listing-metadata/sellMetadataV1Oas3.js +5 -0
- package/build/types/sell-apps/markeitng-and-promotions/sellMarketingV1Oas3.d.ts +6650 -0
- package/build/types/sell-apps/markeitng-and-promotions/sellMarketingV1Oas3.js +5 -0
- package/build/types/sell-apps/markeitng-and-promotions/sellRecommendationV1Oas3.d.ts +172 -0
- package/build/types/sell-apps/markeitng-and-promotions/sellRecommendationV1Oas3.js +5 -0
- package/build/types/sell-apps/order-management/sellFulfillmentV1Oas3.d.ts +1869 -0
- package/build/types/sell-apps/order-management/sellFulfillmentV1Oas3.js +5 -0
- package/build/types/sell-apps/other-apis/commerceIdentityV1Oas3.d.ts +178 -0
- package/build/types/sell-apps/other-apis/commerceIdentityV1Oas3.js +5 -0
- package/build/types/sell-apps/other-apis/commerceTranslationV1BetaOas3.d.ts +128 -0
- package/build/types/sell-apps/other-apis/commerceTranslationV1BetaOas3.js +5 -0
- package/build/types/sell-apps/other-apis/commerceVeroV1Oas3.d.ts +417 -0
- package/build/types/sell-apps/other-apis/commerceVeroV1Oas3.js +5 -0
- package/build/types/sell-apps/other-apis/sellComplianceV1Oas3.d.ts +273 -0
- package/build/types/sell-apps/other-apis/sellComplianceV1Oas3.js +5 -0
- package/build/types/sell-apps/other-apis/sellEdeliveryInternationalShippingOas3.d.ts +2537 -0
- package/build/types/sell-apps/other-apis/sellEdeliveryInternationalShippingOas3.js +5 -0
- package/build/types/sell-apps/other-apis/sellMarketingV1Oas3.d.ts +6650 -0
- package/build/types/sell-apps/other-apis/sellMarketingV1Oas3.js +5 -0
- package/build/types/sell-apps/other-apis/sellRecommendationV1Oas3.d.ts +172 -0
- package/build/types/sell-apps/other-apis/sellRecommendationV1Oas3.js +5 -0
- package/build/utils/account-management/account.d.ts +1094 -0
- package/build/utils/account-management/account.js +831 -0
- package/build/utils/communication/feedback.d.ts +152 -0
- package/build/utils/communication/feedback.js +216 -0
- package/build/utils/communication/message.d.ts +174 -0
- package/build/utils/communication/message.js +242 -0
- package/build/utils/communication/negotiation.d.ts +123 -0
- package/build/utils/communication/negotiation.js +150 -0
- package/build/utils/communication/notification.d.ts +370 -0
- package/build/utils/communication/notification.js +369 -0
- package/build/utils/date-converter.d.ts +59 -0
- package/build/utils/date-converter.js +160 -0
- package/build/utils/llm-client-detector.d.ts +54 -0
- package/build/utils/llm-client-detector.js +318 -0
- package/build/utils/oauth-helper.d.ts +37 -0
- package/build/utils/oauth-helper.js +315 -0
- package/build/utils/order-management/dispute.d.ts +346 -0
- package/build/utils/order-management/dispute.js +369 -0
- package/build/utils/order-management/fulfillment.d.ts +200 -0
- package/build/utils/order-management/fulfillment.js +205 -0
- package/build/utils/other/compliance.d.ts +49 -0
- package/build/utils/other/compliance.js +76 -0
- package/build/utils/other/edelivery.d.ts +310 -0
- package/build/utils/other/edelivery.js +241 -0
- package/build/utils/other/identity.d.ts +13 -0
- package/build/utils/other/identity.js +13 -0
- package/build/utils/other/translation.d.ts +28 -0
- package/build/utils/other/translation.js +41 -0
- package/build/utils/other/vero.d.ts +61 -0
- package/build/utils/other/vero.js +90 -0
- package/build/utils/scope-helper.d.ts +49 -0
- package/build/utils/scope-helper.js +207 -0
- package/build/utils/security-checker.d.ts +46 -0
- package/build/utils/security-checker.js +248 -0
- package/build/utils/setup-validator.d.ts +25 -0
- package/build/utils/setup-validator.js +305 -0
- package/build/utils/token-utils.d.ts +40 -0
- package/build/utils/token-utils.js +40 -0
- package/package.json +115 -0
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { zodToJsonSchema } from 'zod-to-json-schema';
|
|
3
|
+
import { MessageReferenceType, FeedbackRating } from '../../types/ebay-enums.js';
|
|
4
|
+
/**
|
|
5
|
+
* Communication API Schemas - Messages, Feedback, and Notifications
|
|
6
|
+
*
|
|
7
|
+
* This file contains Zod schemas for all Communication endpoints including:
|
|
8
|
+
* - Message API
|
|
9
|
+
* - Feedback API
|
|
10
|
+
* - Notification API
|
|
11
|
+
*/
|
|
12
|
+
// ============================================================================
|
|
13
|
+
// Common Schemas
|
|
14
|
+
// ============================================================================
|
|
15
|
+
const errorSchema = z.object({
|
|
16
|
+
errorId: z.number().optional(),
|
|
17
|
+
domain: z.string().optional(),
|
|
18
|
+
category: z.string().optional(),
|
|
19
|
+
message: z.string().optional(),
|
|
20
|
+
longMessage: z.string().optional(),
|
|
21
|
+
parameters: z.array(z.object({
|
|
22
|
+
name: z.string().optional(),
|
|
23
|
+
value: z.string().optional(),
|
|
24
|
+
})).optional(),
|
|
25
|
+
});
|
|
26
|
+
const amountSchema = z.object({
|
|
27
|
+
currency: z.string(),
|
|
28
|
+
value: z.string(),
|
|
29
|
+
});
|
|
30
|
+
// ============================================================================
|
|
31
|
+
// Message API Schemas
|
|
32
|
+
// ============================================================================
|
|
33
|
+
const messageReferenceSchema = z.object({
|
|
34
|
+
referenceId: z.string().optional(),
|
|
35
|
+
referenceType: z.nativeEnum(MessageReferenceType).optional(),
|
|
36
|
+
});
|
|
37
|
+
const messageMediaSchema = z.object({
|
|
38
|
+
mediaUrl: z.string().optional(),
|
|
39
|
+
mediaType: z.string().optional(),
|
|
40
|
+
});
|
|
41
|
+
export const sendMessageInputSchema = z.object({
|
|
42
|
+
messageText: z.string()
|
|
43
|
+
.describe('The text content of the message'),
|
|
44
|
+
conversationId: z.string().optional()
|
|
45
|
+
.describe('The ID of the conversation to send the message in'),
|
|
46
|
+
otherPartyUsername: z.string().optional()
|
|
47
|
+
.describe('The username of the other party (required if conversationId not provided)'),
|
|
48
|
+
reference: messageReferenceSchema.optional()
|
|
49
|
+
.describe('Reference information for the message (e.g., item or order ID)'),
|
|
50
|
+
messageMedia: z.array(messageMediaSchema).optional()
|
|
51
|
+
.describe('Media attachments for the message'),
|
|
52
|
+
emailCopyToSender: z.boolean().optional()
|
|
53
|
+
.describe('Whether to send an email copy to the sender'),
|
|
54
|
+
});
|
|
55
|
+
export const sendMessageOutputSchema = z.object({
|
|
56
|
+
messageId: z.string().optional(),
|
|
57
|
+
conversationId: z.string().optional(),
|
|
58
|
+
warnings: z.array(errorSchema).optional(),
|
|
59
|
+
});
|
|
60
|
+
const messageSchema = z.object({
|
|
61
|
+
messageId: z.string().optional(),
|
|
62
|
+
messageText: z.string().optional(),
|
|
63
|
+
creationDate: z.string().optional(),
|
|
64
|
+
senderUsername: z.string().optional(),
|
|
65
|
+
recipientUsername: z.string().optional(),
|
|
66
|
+
messageType: z.string().optional(),
|
|
67
|
+
messageMedia: z.array(messageMediaSchema).optional(),
|
|
68
|
+
});
|
|
69
|
+
export const getConversationsInputSchema = z.object({
|
|
70
|
+
limit: z.number().optional()
|
|
71
|
+
.describe('Number of conversations to return'),
|
|
72
|
+
offset: z.number().optional()
|
|
73
|
+
.describe('Number of conversations to skip'),
|
|
74
|
+
status: z.string().optional()
|
|
75
|
+
.describe('Filter by conversation status'),
|
|
76
|
+
});
|
|
77
|
+
export const getConversationsOutputSchema = z.object({
|
|
78
|
+
conversations: z.array(z.object({
|
|
79
|
+
conversationId: z.string().optional(),
|
|
80
|
+
creationDate: z.string().optional(),
|
|
81
|
+
lastMessageDate: z.string().optional(),
|
|
82
|
+
subject: z.string().optional(),
|
|
83
|
+
otherPartyUsername: z.string().optional(),
|
|
84
|
+
unreadMessageCount: z.number().optional(),
|
|
85
|
+
status: z.string().optional(),
|
|
86
|
+
})).optional(),
|
|
87
|
+
href: z.string().optional(),
|
|
88
|
+
limit: z.number().optional(),
|
|
89
|
+
next: z.string().optional(),
|
|
90
|
+
offset: z.number().optional(),
|
|
91
|
+
prev: z.string().optional(),
|
|
92
|
+
total: z.number().optional(),
|
|
93
|
+
warnings: z.array(errorSchema).optional(),
|
|
94
|
+
});
|
|
95
|
+
export const getConversationInputSchema = z.object({
|
|
96
|
+
conversationId: z.string()
|
|
97
|
+
.describe('The unique identifier of the conversation'),
|
|
98
|
+
});
|
|
99
|
+
export const getConversationOutputSchema = z.object({
|
|
100
|
+
conversationId: z.string().optional(),
|
|
101
|
+
messages: z.array(messageSchema).optional(),
|
|
102
|
+
otherPartyUsername: z.string().optional(),
|
|
103
|
+
subject: z.string().optional(),
|
|
104
|
+
creationDate: z.string().optional(),
|
|
105
|
+
warnings: z.array(errorSchema).optional(),
|
|
106
|
+
});
|
|
107
|
+
// ============================================================================
|
|
108
|
+
// Feedback API Schemas
|
|
109
|
+
// ============================================================================
|
|
110
|
+
export const leaveFeedbackInputSchema = z.object({
|
|
111
|
+
orderLineItemId: z.string()
|
|
112
|
+
.describe('The unique identifier of the order line item'),
|
|
113
|
+
rating: z.nativeEnum(FeedbackRating)
|
|
114
|
+
.describe('The feedback rating (POSITIVE, NEGATIVE, NEUTRAL)'),
|
|
115
|
+
feedbackText: z.string().optional()
|
|
116
|
+
.describe('The feedback comment text'),
|
|
117
|
+
});
|
|
118
|
+
export const leaveFeedbackOutputSchema = z.object({
|
|
119
|
+
feedbackId: z.string().optional(),
|
|
120
|
+
transactionId: z.string().optional(),
|
|
121
|
+
warnings: z.array(errorSchema).optional(),
|
|
122
|
+
});
|
|
123
|
+
export const getFeedbackInputSchema = z.object({
|
|
124
|
+
transactionId: z.string()
|
|
125
|
+
.describe('The transaction ID'),
|
|
126
|
+
});
|
|
127
|
+
const feedbackDetailSchema = z.object({
|
|
128
|
+
feedbackId: z.string().optional(),
|
|
129
|
+
rating: z.string().optional(),
|
|
130
|
+
feedbackText: z.string().optional(),
|
|
131
|
+
commentingUser: z.string().optional(),
|
|
132
|
+
creationDate: z.string().optional(),
|
|
133
|
+
itemId: z.string().optional(),
|
|
134
|
+
transactionId: z.string().optional(),
|
|
135
|
+
orderLineItemId: z.string().optional(),
|
|
136
|
+
});
|
|
137
|
+
export const getFeedbackOutputSchema = z.object({
|
|
138
|
+
feedback: feedbackDetailSchema.optional(),
|
|
139
|
+
warnings: z.array(errorSchema).optional(),
|
|
140
|
+
});
|
|
141
|
+
export const getFeedbackSummaryOutputSchema = z.object({
|
|
142
|
+
positiveFeedbackPercent: z.string().optional(),
|
|
143
|
+
uniquePositiveFeedbackCount: z.number().optional(),
|
|
144
|
+
uniqueNegativeFeedbackCount: z.number().optional(),
|
|
145
|
+
uniqueNeutralFeedbackCount: z.number().optional(),
|
|
146
|
+
averageFeedbackRating: z.string().optional(),
|
|
147
|
+
warnings: z.array(errorSchema).optional(),
|
|
148
|
+
});
|
|
149
|
+
export const getAwaitingFeedbackInputSchema = z.object({
|
|
150
|
+
filter: z.string().optional()
|
|
151
|
+
.describe('Filter criteria for awaiting feedback'),
|
|
152
|
+
limit: z.number().optional()
|
|
153
|
+
.describe('Number of items to return'),
|
|
154
|
+
offset: z.number().optional()
|
|
155
|
+
.describe('Number of items to skip'),
|
|
156
|
+
});
|
|
157
|
+
export const getAwaitingFeedbackOutputSchema = z.object({
|
|
158
|
+
items: z.array(z.object({
|
|
159
|
+
orderLineItemId: z.string().optional(),
|
|
160
|
+
transactionId: z.string().optional(),
|
|
161
|
+
itemId: z.string().optional(),
|
|
162
|
+
title: z.string().optional(),
|
|
163
|
+
buyer: z.string().optional(),
|
|
164
|
+
transactionDate: z.string().optional(),
|
|
165
|
+
transactionPrice: amountSchema.optional(),
|
|
166
|
+
})).optional(),
|
|
167
|
+
href: z.string().optional(),
|
|
168
|
+
limit: z.number().optional(),
|
|
169
|
+
next: z.string().optional(),
|
|
170
|
+
offset: z.number().optional(),
|
|
171
|
+
prev: z.string().optional(),
|
|
172
|
+
total: z.number().optional(),
|
|
173
|
+
warnings: z.array(errorSchema).optional(),
|
|
174
|
+
});
|
|
175
|
+
export const respondToFeedbackInputSchema = z.object({
|
|
176
|
+
feedbackId: z.string()
|
|
177
|
+
.describe('The unique identifier of the feedback'),
|
|
178
|
+
responseText: z.string()
|
|
179
|
+
.describe('The response text'),
|
|
180
|
+
});
|
|
181
|
+
export const respondToFeedbackOutputSchema = z.object({
|
|
182
|
+
responseId: z.string().optional(),
|
|
183
|
+
warnings: z.array(errorSchema).optional(),
|
|
184
|
+
});
|
|
185
|
+
// ============================================================================
|
|
186
|
+
// Notification API Schemas
|
|
187
|
+
// ============================================================================
|
|
188
|
+
const deliveryConfigSchema = z.object({
|
|
189
|
+
endpoint: z.string().optional(),
|
|
190
|
+
format: z.string().optional(),
|
|
191
|
+
});
|
|
192
|
+
export const createNotificationDestinationInputSchema = z.object({
|
|
193
|
+
name: z.string()
|
|
194
|
+
.describe('The name of the notification destination'),
|
|
195
|
+
endpoint: z.string()
|
|
196
|
+
.describe('The endpoint URL for notifications'),
|
|
197
|
+
verificationToken: z.string().optional()
|
|
198
|
+
.describe('Verification token for the endpoint'),
|
|
199
|
+
});
|
|
200
|
+
export const createNotificationDestinationOutputSchema = z.object({
|
|
201
|
+
destinationId: z.string().optional(),
|
|
202
|
+
warnings: z.array(errorSchema).optional(),
|
|
203
|
+
});
|
|
204
|
+
export const getNotificationDestinationsInputSchema = z.object({
|
|
205
|
+
limit: z.number().optional()
|
|
206
|
+
.describe('Number of destinations to return'),
|
|
207
|
+
continuationToken: z.string().optional()
|
|
208
|
+
.describe('Token for pagination'),
|
|
209
|
+
});
|
|
210
|
+
export const getNotificationDestinationsOutputSchema = z.object({
|
|
211
|
+
destinations: z.array(z.object({
|
|
212
|
+
destinationId: z.string().optional(),
|
|
213
|
+
name: z.string().optional(),
|
|
214
|
+
endpoint: z.string().optional(),
|
|
215
|
+
status: z.string().optional(),
|
|
216
|
+
})).optional(),
|
|
217
|
+
limit: z.number().optional(),
|
|
218
|
+
next: z.string().optional(),
|
|
219
|
+
total: z.number().optional(),
|
|
220
|
+
warnings: z.array(errorSchema).optional(),
|
|
221
|
+
});
|
|
222
|
+
export const createNotificationSubscriptionInputSchema = z.object({
|
|
223
|
+
topicId: z.string()
|
|
224
|
+
.describe('The topic ID to subscribe to'),
|
|
225
|
+
destinationId: z.string()
|
|
226
|
+
.describe('The destination ID for notifications'),
|
|
227
|
+
deliveryConfig: deliveryConfigSchema.optional()
|
|
228
|
+
.describe('Delivery configuration'),
|
|
229
|
+
});
|
|
230
|
+
export const createNotificationSubscriptionOutputSchema = z.object({
|
|
231
|
+
subscriptionId: z.string().optional(),
|
|
232
|
+
warnings: z.array(errorSchema).optional(),
|
|
233
|
+
});
|
|
234
|
+
export const getNotificationSubscriptionsInputSchema = z.object({
|
|
235
|
+
limit: z.number().optional()
|
|
236
|
+
.describe('Number of subscriptions to return'),
|
|
237
|
+
continuationToken: z.string().optional()
|
|
238
|
+
.describe('Token for pagination'),
|
|
239
|
+
});
|
|
240
|
+
export const getNotificationSubscriptionsOutputSchema = z.object({
|
|
241
|
+
subscriptions: z.array(z.object({
|
|
242
|
+
subscriptionId: z.string().optional(),
|
|
243
|
+
topicId: z.string().optional(),
|
|
244
|
+
destinationId: z.string().optional(),
|
|
245
|
+
status: z.string().optional(),
|
|
246
|
+
enabled: z.boolean().optional(),
|
|
247
|
+
})).optional(),
|
|
248
|
+
limit: z.number().optional(),
|
|
249
|
+
next: z.string().optional(),
|
|
250
|
+
total: z.number().optional(),
|
|
251
|
+
warnings: z.array(errorSchema).optional(),
|
|
252
|
+
});
|
|
253
|
+
export const getNotificationTopicsOutputSchema = z.object({
|
|
254
|
+
topics: z.array(z.object({
|
|
255
|
+
topicId: z.string().optional(),
|
|
256
|
+
description: z.string().optional(),
|
|
257
|
+
category: z.string().optional(),
|
|
258
|
+
})).optional(),
|
|
259
|
+
warnings: z.array(errorSchema).optional(),
|
|
260
|
+
});
|
|
261
|
+
// ============================================================================
|
|
262
|
+
// Negotiation API Schemas
|
|
263
|
+
// ============================================================================
|
|
264
|
+
export const sendOfferToInterestedBuyersInputSchema = z.object({
|
|
265
|
+
allowCounterOffer: z.boolean().optional()
|
|
266
|
+
.describe('Whether to allow counter offers'),
|
|
267
|
+
message: z.string().optional()
|
|
268
|
+
.describe('Message to send with the offer'),
|
|
269
|
+
offeredItems: z.array(z.object({
|
|
270
|
+
offerId: z.string().optional(),
|
|
271
|
+
availableQuantity: z.number().optional(),
|
|
272
|
+
price: amountSchema.optional(),
|
|
273
|
+
})).optional()
|
|
274
|
+
.describe('Items to include in the offer'),
|
|
275
|
+
});
|
|
276
|
+
export const sendOfferToInterestedBuyersOutputSchema = z.object({
|
|
277
|
+
offerToInterestedBuyersId: z.string().optional(),
|
|
278
|
+
warnings: z.array(errorSchema).optional(),
|
|
279
|
+
});
|
|
280
|
+
export const getOffersToBuyersInputSchema = z.object({
|
|
281
|
+
filter: z.string().optional()
|
|
282
|
+
.describe('Filter criteria'),
|
|
283
|
+
limit: z.number().optional()
|
|
284
|
+
.describe('Number of offers to return'),
|
|
285
|
+
offset: z.number().optional()
|
|
286
|
+
.describe('Number of offers to skip'),
|
|
287
|
+
});
|
|
288
|
+
export const getOffersToBuyersOutputSchema = z.object({
|
|
289
|
+
offers: z.array(z.object({
|
|
290
|
+
offerToInterestedBuyersId: z.string().optional(),
|
|
291
|
+
offeredItems: z.array(z.object({
|
|
292
|
+
offerId: z.string().optional(),
|
|
293
|
+
price: amountSchema.optional(),
|
|
294
|
+
quantity: z.number().optional(),
|
|
295
|
+
})).optional(),
|
|
296
|
+
creationDate: z.string().optional(),
|
|
297
|
+
status: z.string().optional(),
|
|
298
|
+
})).optional(),
|
|
299
|
+
href: z.string().optional(),
|
|
300
|
+
limit: z.number().optional(),
|
|
301
|
+
next: z.string().optional(),
|
|
302
|
+
offset: z.number().optional(),
|
|
303
|
+
prev: z.string().optional(),
|
|
304
|
+
total: z.number().optional(),
|
|
305
|
+
warnings: z.array(errorSchema).optional(),
|
|
306
|
+
});
|
|
307
|
+
// ============================================================================
|
|
308
|
+
// JSON Schema Conversion Functions
|
|
309
|
+
// ============================================================================
|
|
310
|
+
/**
|
|
311
|
+
* Convert Zod schemas to JSON Schema format for MCP tools
|
|
312
|
+
*/
|
|
313
|
+
export function getCommunicationJsonSchemas() {
|
|
314
|
+
return {
|
|
315
|
+
// Message API
|
|
316
|
+
sendMessageInput: zodToJsonSchema(sendMessageInputSchema, 'sendMessageInput'),
|
|
317
|
+
sendMessageOutput: zodToJsonSchema(sendMessageOutputSchema, 'sendMessageOutput'),
|
|
318
|
+
getConversationsInput: zodToJsonSchema(getConversationsInputSchema, 'getConversationsInput'),
|
|
319
|
+
getConversationsOutput: zodToJsonSchema(getConversationsOutputSchema, 'getConversationsOutput'),
|
|
320
|
+
getConversationInput: zodToJsonSchema(getConversationInputSchema, 'getConversationInput'),
|
|
321
|
+
getConversationOutput: zodToJsonSchema(getConversationOutputSchema, 'getConversationOutput'),
|
|
322
|
+
// Feedback API
|
|
323
|
+
leaveFeedbackInput: zodToJsonSchema(leaveFeedbackInputSchema, 'leaveFeedbackInput'),
|
|
324
|
+
leaveFeedbackOutput: zodToJsonSchema(leaveFeedbackOutputSchema, 'leaveFeedbackOutput'),
|
|
325
|
+
getFeedbackInput: zodToJsonSchema(getFeedbackInputSchema, 'getFeedbackInput'),
|
|
326
|
+
getFeedbackOutput: zodToJsonSchema(getFeedbackOutputSchema, 'getFeedbackOutput'),
|
|
327
|
+
getFeedbackSummaryOutput: zodToJsonSchema(getFeedbackSummaryOutputSchema, 'getFeedbackSummaryOutput'),
|
|
328
|
+
getAwaitingFeedbackInput: zodToJsonSchema(getAwaitingFeedbackInputSchema, 'getAwaitingFeedbackInput'),
|
|
329
|
+
getAwaitingFeedbackOutput: zodToJsonSchema(getAwaitingFeedbackOutputSchema, 'getAwaitingFeedbackOutput'),
|
|
330
|
+
respondToFeedbackInput: zodToJsonSchema(respondToFeedbackInputSchema, 'respondToFeedbackInput'),
|
|
331
|
+
respondToFeedbackOutput: zodToJsonSchema(respondToFeedbackOutputSchema, 'respondToFeedbackOutput'),
|
|
332
|
+
// Notification API
|
|
333
|
+
createNotificationDestinationInput: zodToJsonSchema(createNotificationDestinationInputSchema, 'createNotificationDestinationInput'),
|
|
334
|
+
createNotificationDestinationOutput: zodToJsonSchema(createNotificationDestinationOutputSchema, 'createNotificationDestinationOutput'),
|
|
335
|
+
getNotificationDestinationsInput: zodToJsonSchema(getNotificationDestinationsInputSchema, 'getNotificationDestinationsInput'),
|
|
336
|
+
getNotificationDestinationsOutput: zodToJsonSchema(getNotificationDestinationsOutputSchema, 'getNotificationDestinationsOutput'),
|
|
337
|
+
createNotificationSubscriptionInput: zodToJsonSchema(createNotificationSubscriptionInputSchema, 'createNotificationSubscriptionInput'),
|
|
338
|
+
createNotificationSubscriptionOutput: zodToJsonSchema(createNotificationSubscriptionOutputSchema, 'createNotificationSubscriptionOutput'),
|
|
339
|
+
getNotificationSubscriptionsInput: zodToJsonSchema(getNotificationSubscriptionsInputSchema, 'getNotificationSubscriptionsInput'),
|
|
340
|
+
getNotificationSubscriptionsOutput: zodToJsonSchema(getNotificationSubscriptionsOutputSchema, 'getNotificationSubscriptionsOutput'),
|
|
341
|
+
getNotificationTopicsOutput: zodToJsonSchema(getNotificationTopicsOutputSchema, 'getNotificationTopicsOutput'),
|
|
342
|
+
// Negotiation API
|
|
343
|
+
sendOfferToInterestedBuyersInput: zodToJsonSchema(sendOfferToInterestedBuyersInputSchema, 'sendOfferToInterestedBuyersInput'),
|
|
344
|
+
sendOfferToInterestedBuyersOutput: zodToJsonSchema(sendOfferToInterestedBuyersOutputSchema, 'sendOfferToInterestedBuyersOutput'),
|
|
345
|
+
getOffersToBuyersInput: zodToJsonSchema(getOffersToBuyersInputSchema, 'getOffersToBuyersInput'),
|
|
346
|
+
getOffersToBuyersOutput: zodToJsonSchema(getOffersToBuyersOutputSchema, 'getOffersToBuyersOutput'),
|
|
347
|
+
};
|
|
348
|
+
}
|