ebay-mcp 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +586 -0
  3. package/build/api/account-management/account.d.ts +216 -0
  4. package/build/api/account-management/account.js +305 -0
  5. package/build/api/analytics-and-report/analytics.d.ts +33 -0
  6. package/build/api/analytics-and-report/analytics.js +102 -0
  7. package/build/api/client.d.ts +89 -0
  8. package/build/api/client.js +343 -0
  9. package/build/api/communication/feedback.d.ts +45 -0
  10. package/build/api/communication/feedback.js +119 -0
  11. package/build/api/communication/message.d.ts +55 -0
  12. package/build/api/communication/message.js +131 -0
  13. package/build/api/communication/negotiation.d.ts +39 -0
  14. package/build/api/communication/negotiation.js +97 -0
  15. package/build/api/communication/notification.d.ts +128 -0
  16. package/build/api/communication/notification.js +373 -0
  17. package/build/api/index.d.ts +96 -0
  18. package/build/api/index.js +121 -0
  19. package/build/api/listing-management/inventory.d.ts +216 -0
  20. package/build/api/listing-management/inventory.js +633 -0
  21. package/build/api/listing-metadata/metadata.d.ts +154 -0
  22. package/build/api/listing-metadata/metadata.js +485 -0
  23. package/build/api/listing-metadata/taxonomy.d.ts +38 -0
  24. package/build/api/listing-metadata/taxonomy.js +58 -0
  25. package/build/api/marketing-and-promotions/marketing.d.ts +395 -0
  26. package/build/api/marketing-and-promotions/marketing.js +565 -0
  27. package/build/api/marketing-and-promotions/recommendation.d.ts +20 -0
  28. package/build/api/marketing-and-promotions/recommendation.js +32 -0
  29. package/build/api/order-management/dispute.d.ts +65 -0
  30. package/build/api/order-management/dispute.js +69 -0
  31. package/build/api/order-management/fulfillment.d.ts +80 -0
  32. package/build/api/order-management/fulfillment.js +89 -0
  33. package/build/api/other/compliance.d.ts +26 -0
  34. package/build/api/other/compliance.js +47 -0
  35. package/build/api/other/edelivery.d.ts +153 -0
  36. package/build/api/other/edelivery.js +219 -0
  37. package/build/api/other/identity.d.ts +17 -0
  38. package/build/api/other/identity.js +24 -0
  39. package/build/api/other/translation.d.ts +14 -0
  40. package/build/api/other/translation.js +22 -0
  41. package/build/api/other/vero.d.ts +30 -0
  42. package/build/api/other/vero.js +48 -0
  43. package/build/auth/oauth-metadata.d.ts +46 -0
  44. package/build/auth/oauth-metadata.js +59 -0
  45. package/build/auth/oauth-middleware.d.ts +35 -0
  46. package/build/auth/oauth-middleware.js +99 -0
  47. package/build/auth/oauth-types.d.ts +66 -0
  48. package/build/auth/oauth-types.js +4 -0
  49. package/build/auth/oauth.d.ts +93 -0
  50. package/build/auth/oauth.js +383 -0
  51. package/build/auth/scope-utils.d.ts +70 -0
  52. package/build/auth/scope-utils.js +304 -0
  53. package/build/auth/token-verifier.d.ts +57 -0
  54. package/build/auth/token-verifier.js +172 -0
  55. package/build/config/environment.d.ts +61 -0
  56. package/build/config/environment.js +260 -0
  57. package/build/index.d.ts +1 -0
  58. package/build/index.js +98 -0
  59. package/build/schemas/account-management/account.d.ts +5324 -0
  60. package/build/schemas/account-management/account.js +366 -0
  61. package/build/schemas/analytics/analytics.d.ts +167 -0
  62. package/build/schemas/analytics/analytics.js +191 -0
  63. package/build/schemas/communication/messages.d.ts +1872 -0
  64. package/build/schemas/communication/messages.js +348 -0
  65. package/build/schemas/fulfillment/orders.d.ts +4655 -0
  66. package/build/schemas/fulfillment/orders.js +317 -0
  67. package/build/schemas/index.d.ts +2100 -0
  68. package/build/schemas/index.js +68 -0
  69. package/build/schemas/inventory-management/inventory.d.ts +6419 -0
  70. package/build/schemas/inventory-management/inventory.js +450 -0
  71. package/build/schemas/marketing/marketing.d.ts +14181 -0
  72. package/build/schemas/marketing/marketing.js +1088 -0
  73. package/build/schemas/metadata/metadata.d.ts +5259 -0
  74. package/build/schemas/metadata/metadata.js +614 -0
  75. package/build/schemas/other/other-apis.d.ts +257 -0
  76. package/build/schemas/other/other-apis.js +372 -0
  77. package/build/schemas/taxonomy/taxonomy.d.ts +215 -0
  78. package/build/schemas/taxonomy/taxonomy.js +571 -0
  79. package/build/scripts/auto-setup.d.ts +12 -0
  80. package/build/scripts/auto-setup.js +277 -0
  81. package/build/scripts/diagnostics.d.ts +8 -0
  82. package/build/scripts/diagnostics.js +299 -0
  83. package/build/scripts/download-specs.d.ts +1 -0
  84. package/build/scripts/download-specs.js +116 -0
  85. package/build/scripts/interactive-setup.d.ts +21 -0
  86. package/build/scripts/interactive-setup.js +723 -0
  87. package/build/server-http.d.ts +11 -0
  88. package/build/server-http.js +361 -0
  89. package/build/tools/definitions/account-with-schemas.d.ts +39 -0
  90. package/build/tools/definitions/account-with-schemas.js +170 -0
  91. package/build/tools/definitions/account.d.ts +12 -0
  92. package/build/tools/definitions/account.js +428 -0
  93. package/build/tools/definitions/analytics.d.ts +25 -0
  94. package/build/tools/definitions/analytics.js +66 -0
  95. package/build/tools/definitions/communication.d.ts +12 -0
  96. package/build/tools/definitions/communication.js +151 -0
  97. package/build/tools/definitions/fulfillment.d.ts +12 -0
  98. package/build/tools/definitions/fulfillment.js +326 -0
  99. package/build/tools/definitions/index.d.ts +25 -0
  100. package/build/tools/definitions/index.js +37 -0
  101. package/build/tools/definitions/inventory.d.ts +12 -0
  102. package/build/tools/definitions/inventory.js +429 -0
  103. package/build/tools/definitions/marketing.d.ts +12 -0
  104. package/build/tools/definitions/marketing.js +1095 -0
  105. package/build/tools/definitions/metadata.d.ts +12 -0
  106. package/build/tools/definitions/metadata.js +188 -0
  107. package/build/tools/definitions/other.d.ts +13 -0
  108. package/build/tools/definitions/other.js +309 -0
  109. package/build/tools/definitions/taxonomy.d.ts +25 -0
  110. package/build/tools/definitions/taxonomy.js +64 -0
  111. package/build/tools/definitions/token-management.d.ts +35 -0
  112. package/build/tools/definitions/token-management.js +103 -0
  113. package/build/tools/index.d.ts +11 -0
  114. package/build/tools/index.js +1003 -0
  115. package/build/tools/schemas.d.ts +14764 -0
  116. package/build/tools/schemas.js +667 -0
  117. package/build/tools/tool-definitions.d.ts +35 -0
  118. package/build/tools/tool-definitions.js +3534 -0
  119. package/build/types/application-settings/developerAnalyticsV1BetaOas3.d.ts +197 -0
  120. package/build/types/application-settings/developerAnalyticsV1BetaOas3.js +5 -0
  121. package/build/types/application-settings/developerClientRegistrationV1Oas3.d.ts +155 -0
  122. package/build/types/application-settings/developerClientRegistrationV1Oas3.js +5 -0
  123. package/build/types/application-settings/developerKeyManagementV1Oas3.d.ts +246 -0
  124. package/build/types/application-settings/developerKeyManagementV1Oas3.js +5 -0
  125. package/build/types/ebay-enums.d.ts +1204 -0
  126. package/build/types/ebay-enums.js +1330 -0
  127. package/build/types/ebay.d.ts +143 -0
  128. package/build/types/ebay.js +123 -0
  129. package/build/types/index.d.ts +6 -0
  130. package/build/types/index.js +10 -0
  131. package/build/types/sell-apps/account-management/sellAccountV1Oas3.d.ts +2579 -0
  132. package/build/types/sell-apps/account-management/sellAccountV1Oas3.js +5 -0
  133. package/build/types/sell-apps/analytics-and-report/sellAnalyticsV1Oas3.d.ts +446 -0
  134. package/build/types/sell-apps/analytics-and-report/sellAnalyticsV1Oas3.js +5 -0
  135. package/build/types/sell-apps/communication/commerceFeedbackV1BetaOas3.d.ts +705 -0
  136. package/build/types/sell-apps/communication/commerceFeedbackV1BetaOas3.js +5 -0
  137. package/build/types/sell-apps/communication/commerceMessageV1Oas3.d.ts +590 -0
  138. package/build/types/sell-apps/communication/commerceMessageV1Oas3.js +5 -0
  139. package/build/types/sell-apps/communication/commerceNotificationV1Oas3.d.ts +1276 -0
  140. package/build/types/sell-apps/communication/commerceNotificationV1Oas3.js +5 -0
  141. package/build/types/sell-apps/communication/sellNegotiationV1Oas3.d.ts +277 -0
  142. package/build/types/sell-apps/communication/sellNegotiationV1Oas3.js +5 -0
  143. package/build/types/sell-apps/listing-management/sellInventoryV1Oas3.d.ts +3133 -0
  144. package/build/types/sell-apps/listing-management/sellInventoryV1Oas3.js +5 -0
  145. package/build/types/sell-apps/listing-metadata/sellMetadataV1Oas3.d.ts +2289 -0
  146. package/build/types/sell-apps/listing-metadata/sellMetadataV1Oas3.js +5 -0
  147. package/build/types/sell-apps/markeitng-and-promotions/sellMarketingV1Oas3.d.ts +6650 -0
  148. package/build/types/sell-apps/markeitng-and-promotions/sellMarketingV1Oas3.js +5 -0
  149. package/build/types/sell-apps/markeitng-and-promotions/sellRecommendationV1Oas3.d.ts +172 -0
  150. package/build/types/sell-apps/markeitng-and-promotions/sellRecommendationV1Oas3.js +5 -0
  151. package/build/types/sell-apps/order-management/sellFulfillmentV1Oas3.d.ts +1869 -0
  152. package/build/types/sell-apps/order-management/sellFulfillmentV1Oas3.js +5 -0
  153. package/build/types/sell-apps/other-apis/commerceIdentityV1Oas3.d.ts +178 -0
  154. package/build/types/sell-apps/other-apis/commerceIdentityV1Oas3.js +5 -0
  155. package/build/types/sell-apps/other-apis/commerceTranslationV1BetaOas3.d.ts +128 -0
  156. package/build/types/sell-apps/other-apis/commerceTranslationV1BetaOas3.js +5 -0
  157. package/build/types/sell-apps/other-apis/commerceVeroV1Oas3.d.ts +417 -0
  158. package/build/types/sell-apps/other-apis/commerceVeroV1Oas3.js +5 -0
  159. package/build/types/sell-apps/other-apis/sellComplianceV1Oas3.d.ts +273 -0
  160. package/build/types/sell-apps/other-apis/sellComplianceV1Oas3.js +5 -0
  161. package/build/types/sell-apps/other-apis/sellEdeliveryInternationalShippingOas3.d.ts +2537 -0
  162. package/build/types/sell-apps/other-apis/sellEdeliveryInternationalShippingOas3.js +5 -0
  163. package/build/types/sell-apps/other-apis/sellMarketingV1Oas3.d.ts +6650 -0
  164. package/build/types/sell-apps/other-apis/sellMarketingV1Oas3.js +5 -0
  165. package/build/types/sell-apps/other-apis/sellRecommendationV1Oas3.d.ts +172 -0
  166. package/build/types/sell-apps/other-apis/sellRecommendationV1Oas3.js +5 -0
  167. package/build/utils/account-management/account.d.ts +1094 -0
  168. package/build/utils/account-management/account.js +831 -0
  169. package/build/utils/communication/feedback.d.ts +152 -0
  170. package/build/utils/communication/feedback.js +216 -0
  171. package/build/utils/communication/message.d.ts +174 -0
  172. package/build/utils/communication/message.js +242 -0
  173. package/build/utils/communication/negotiation.d.ts +123 -0
  174. package/build/utils/communication/negotiation.js +150 -0
  175. package/build/utils/communication/notification.d.ts +370 -0
  176. package/build/utils/communication/notification.js +369 -0
  177. package/build/utils/date-converter.d.ts +59 -0
  178. package/build/utils/date-converter.js +160 -0
  179. package/build/utils/llm-client-detector.d.ts +54 -0
  180. package/build/utils/llm-client-detector.js +318 -0
  181. package/build/utils/oauth-helper.d.ts +37 -0
  182. package/build/utils/oauth-helper.js +315 -0
  183. package/build/utils/order-management/dispute.d.ts +346 -0
  184. package/build/utils/order-management/dispute.js +369 -0
  185. package/build/utils/order-management/fulfillment.d.ts +200 -0
  186. package/build/utils/order-management/fulfillment.js +205 -0
  187. package/build/utils/other/compliance.d.ts +49 -0
  188. package/build/utils/other/compliance.js +76 -0
  189. package/build/utils/other/edelivery.d.ts +310 -0
  190. package/build/utils/other/edelivery.js +241 -0
  191. package/build/utils/other/identity.d.ts +13 -0
  192. package/build/utils/other/identity.js +13 -0
  193. package/build/utils/other/translation.d.ts +28 -0
  194. package/build/utils/other/translation.js +41 -0
  195. package/build/utils/other/vero.d.ts +61 -0
  196. package/build/utils/other/vero.js +90 -0
  197. package/build/utils/scope-helper.d.ts +49 -0
  198. package/build/utils/scope-helper.js +207 -0
  199. package/build/utils/security-checker.d.ts +46 -0
  200. package/build/utils/security-checker.js +248 -0
  201. package/build/utils/setup-validator.d.ts +25 -0
  202. package/build/utils/setup-validator.js +305 -0
  203. package/build/utils/token-utils.d.ts +40 -0
  204. package/build/utils/token-utils.js +40 -0
  205. package/package.json +115 -0
@@ -0,0 +1,103 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Token Management & Authentication Tools
4
+ *
5
+ * These tools handle OAuth token management, including:
6
+ * - Generating OAuth authorization URLs
7
+ * - Setting and clearing user tokens
8
+ * - Token status monitoring
9
+ * - Token expiry validation
10
+ * - Date/timestamp conversion utilities
11
+ */
12
+ export const tokenManagementTools = [
13
+ {
14
+ name: 'ebay_get_oauth_url',
15
+ description: 'Generate the eBay OAuth authorization URL for user consent. The user should open this URL in a browser to grant permissions to the application. This supports the OAuth 2.0 Authorization Code grant flow. The redirect URI can be provided as a parameter or will be read from EBAY_REDIRECT_URI environment variable.\n\nIMPORTANT: eBay has different OAuth scopes available for production vs sandbox environments:\n- Sandbox includes additional Buy API scopes (e.g., buy.order.readonly, buy.guest.order, buy.shopping.cart) and extended Identity scopes\n- Production includes sell.edelivery, commerce.message (explicit), and commerce.shipping scopes not available in sandbox\n- If you provide custom scopes, they will be validated against the current environment (set via EBAY_ENVIRONMENT). Any scopes not valid for the environment will generate warnings.',
16
+ inputSchema: {
17
+ redirectUri: z
18
+ .string()
19
+ .optional()
20
+ .describe('Optional redirect URI registered with your eBay application (RuName). If not provided, will use EBAY_REDIRECT_URI from .env file.'),
21
+ scopes: z
22
+ .array(z.string())
23
+ .optional()
24
+ .describe('Optional array of OAuth scopes. If not provided, uses environment-specific default scopes (production or sandbox based on EBAY_ENVIRONMENT). Custom scopes will be validated against the environment.'),
25
+ state: z.string().optional().describe('Optional state parameter for CSRF protection'),
26
+ },
27
+ },
28
+ {
29
+ name: 'ebay_set_user_tokens',
30
+ description: 'Set the user access token and refresh token for authenticated API requests. These tokens should be obtained through the OAuth authorization code flow. Tokens will be persisted to disk and automatically refreshed when needed. User tokens provide higher rate limits (10,000-50,000 requests/day) compared to client credentials (1,000 requests/day).',
31
+ inputSchema: {
32
+ accessToken: z.string().describe('The user access token obtained from OAuth flow'),
33
+ refreshToken: z.string().describe('The refresh token obtained from OAuth flow'),
34
+ },
35
+ },
36
+ {
37
+ name: 'ebay_set_user_tokens_with_expiry',
38
+ description: "Set user access and refresh tokens with custom expiry times. This is an enhanced version of ebay_set_user_tokens that accepts expiry times and can automatically refresh the access token if it's expired but the refresh token is valid. Useful when user provides tokens that may already be partially expired.",
39
+ inputSchema: {
40
+ accessToken: z.string().min(1).describe('eBay user access token'),
41
+ refreshToken: z.string().min(1).describe('eBay user refresh token'),
42
+ accessTokenExpiry: z
43
+ .union([z.string(), z.number()])
44
+ .optional()
45
+ .describe('Optional: Access token expiry time. If not provided, defaults to 2 hours from now. Can be ISO date string, Unix timestamp, or relative time (e.g., "in 7200 seconds")'),
46
+ refreshTokenExpiry: z
47
+ .union([z.string(), z.number()])
48
+ .optional()
49
+ .describe('Optional: Refresh token expiry time. If not provided, defaults to 18 months from now. Can be ISO date string, Unix timestamp, or relative time'),
50
+ autoRefresh: z
51
+ .boolean()
52
+ .optional()
53
+ .default(true)
54
+ .describe('If true and access token is expired but refresh token is valid, automatically refresh the access token. Default: true'),
55
+ },
56
+ },
57
+ {
58
+ name: 'ebay_get_token_status',
59
+ description: 'Check the current OAuth token status. Returns information about whether user tokens or client credentials are being used, and whether tokens are valid.',
60
+ inputSchema: {},
61
+ },
62
+ {
63
+ name: 'ebay_clear_tokens',
64
+ description: 'Clear all stored OAuth tokens (both user tokens and client credentials). This will require re-authentication for subsequent API calls.',
65
+ inputSchema: {},
66
+ },
67
+ {
68
+ name: 'ebay_validate_token_expiry',
69
+ description: 'Validate token expiry times and get recommendations. Checks if access/refresh tokens are expired or expiring soon, and provides actionable recommendations (e.g., refresh access token, re-authorize user).',
70
+ inputSchema: {
71
+ accessTokenExpiry: z
72
+ .union([z.string(), z.number()])
73
+ .describe('Access token expiry time. Can be ISO date string, Unix timestamp (seconds or milliseconds), or relative time'),
74
+ refreshTokenExpiry: z
75
+ .union([z.string(), z.number()])
76
+ .describe('Refresh token expiry time. Can be ISO date string, Unix timestamp (seconds or milliseconds), or relative time'),
77
+ },
78
+ },
79
+ {
80
+ name: 'ebay_convert_date_to_timestamp',
81
+ description: 'Convert a date string or number to Unix timestamp (milliseconds). Supports ISO 8601 dates, Unix timestamps (seconds or milliseconds), and relative time (e.g., "in 2 hours", "in 7200 seconds"). Useful when setting token expiry times from user input.',
82
+ inputSchema: {
83
+ dateInput: z
84
+ .union([z.string(), z.number()])
85
+ .describe('Date to convert. Supports ISO 8601 strings (e.g., "2025-01-15T10:30:00Z"), Unix timestamps (seconds or milliseconds), or relative time (e.g., "in 2 hours")'),
86
+ },
87
+ },
88
+ {
89
+ name: 'ebay_display_credentials',
90
+ description: 'Display all eBay API credentials and current token information. Shows client ID, client secret (masked), environment (production/sandbox), redirect URI, and current token status including access token (masked), refresh token (masked), app token (masked), and their expiry times. Useful for debugging authentication issues and verifying configuration.',
91
+ inputSchema: {},
92
+ },
93
+ {
94
+ name: 'ebay_refresh_access_token',
95
+ description: 'Manually refresh the user access token using the stored refresh token. This is useful when you want to proactively refresh an access token before it expires, or when recovering from authentication errors. Requires that user tokens are already set (either via EBAY_USER_REFRESH_TOKEN in .env or via ebay_set_user_tokens_with_expiry). Returns the new access token and expiry time.',
96
+ inputSchema: {},
97
+ outputSchema: {
98
+ type: 'object',
99
+ properties: {},
100
+ description: 'Success response',
101
+ },
102
+ },
103
+ ];
@@ -0,0 +1,11 @@
1
+ import type { EbaySellerApi } from '../api/index.js';
2
+ import { type ToolDefinition } from '../tools/definitions/index.js';
3
+ export type { ToolDefinition };
4
+ /**
5
+ * Get all tool definitions for the MCP server
6
+ */
7
+ export declare function getToolDefinitions(): ToolDefinition[];
8
+ /**
9
+ * Execute a tool based on its name
10
+ */
11
+ export declare function executeTool(api: EbaySellerApi, toolName: string, args: Record<string, unknown>): Promise<unknown>;