amazon-ads-mcp 0.2.7__py3-none-any.whl

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 (82) hide show
  1. amazon_ads_mcp/__init__.py +11 -0
  2. amazon_ads_mcp/auth/__init__.py +33 -0
  3. amazon_ads_mcp/auth/base.py +211 -0
  4. amazon_ads_mcp/auth/hooks.py +172 -0
  5. amazon_ads_mcp/auth/manager.py +791 -0
  6. amazon_ads_mcp/auth/oauth_state_store.py +277 -0
  7. amazon_ads_mcp/auth/providers/__init__.py +14 -0
  8. amazon_ads_mcp/auth/providers/direct.py +393 -0
  9. amazon_ads_mcp/auth/providers/example_auth0.py.example +216 -0
  10. amazon_ads_mcp/auth/providers/openbridge.py +512 -0
  11. amazon_ads_mcp/auth/registry.py +146 -0
  12. amazon_ads_mcp/auth/secure_token_store.py +297 -0
  13. amazon_ads_mcp/auth/token_store.py +723 -0
  14. amazon_ads_mcp/config/__init__.py +5 -0
  15. amazon_ads_mcp/config/sampling.py +111 -0
  16. amazon_ads_mcp/config/settings.py +366 -0
  17. amazon_ads_mcp/exceptions.py +314 -0
  18. amazon_ads_mcp/middleware/__init__.py +11 -0
  19. amazon_ads_mcp/middleware/authentication.py +1474 -0
  20. amazon_ads_mcp/middleware/caching.py +177 -0
  21. amazon_ads_mcp/middleware/oauth.py +175 -0
  22. amazon_ads_mcp/middleware/sampling.py +112 -0
  23. amazon_ads_mcp/models/__init__.py +320 -0
  24. amazon_ads_mcp/models/amc_models.py +837 -0
  25. amazon_ads_mcp/models/api_responses.py +847 -0
  26. amazon_ads_mcp/models/base_models.py +215 -0
  27. amazon_ads_mcp/models/builtin_responses.py +496 -0
  28. amazon_ads_mcp/models/dsp_models.py +556 -0
  29. amazon_ads_mcp/models/stores_brands.py +610 -0
  30. amazon_ads_mcp/server/__init__.py +6 -0
  31. amazon_ads_mcp/server/__main__.py +6 -0
  32. amazon_ads_mcp/server/builtin_prompts.py +269 -0
  33. amazon_ads_mcp/server/builtin_tools.py +962 -0
  34. amazon_ads_mcp/server/file_routes.py +547 -0
  35. amazon_ads_mcp/server/html_templates.py +149 -0
  36. amazon_ads_mcp/server/mcp_server.py +327 -0
  37. amazon_ads_mcp/server/openapi_utils.py +158 -0
  38. amazon_ads_mcp/server/sampling_handler.py +251 -0
  39. amazon_ads_mcp/server/server_builder.py +751 -0
  40. amazon_ads_mcp/server/sidecar_loader.py +178 -0
  41. amazon_ads_mcp/server/transform_executor.py +827 -0
  42. amazon_ads_mcp/tools/__init__.py +22 -0
  43. amazon_ads_mcp/tools/cache_management.py +105 -0
  44. amazon_ads_mcp/tools/download_tools.py +267 -0
  45. amazon_ads_mcp/tools/identity.py +236 -0
  46. amazon_ads_mcp/tools/oauth.py +598 -0
  47. amazon_ads_mcp/tools/profile.py +150 -0
  48. amazon_ads_mcp/tools/profile_listing.py +285 -0
  49. amazon_ads_mcp/tools/region.py +320 -0
  50. amazon_ads_mcp/tools/region_identity.py +175 -0
  51. amazon_ads_mcp/utils/__init__.py +6 -0
  52. amazon_ads_mcp/utils/async_compat.py +215 -0
  53. amazon_ads_mcp/utils/errors.py +452 -0
  54. amazon_ads_mcp/utils/export_content_type_resolver.py +249 -0
  55. amazon_ads_mcp/utils/export_download_handler.py +579 -0
  56. amazon_ads_mcp/utils/header_resolver.py +81 -0
  57. amazon_ads_mcp/utils/http/__init__.py +56 -0
  58. amazon_ads_mcp/utils/http/circuit_breaker.py +127 -0
  59. amazon_ads_mcp/utils/http/client_manager.py +329 -0
  60. amazon_ads_mcp/utils/http/request.py +207 -0
  61. amazon_ads_mcp/utils/http/resilience.py +512 -0
  62. amazon_ads_mcp/utils/http/resilient_client.py +195 -0
  63. amazon_ads_mcp/utils/http/retry.py +76 -0
  64. amazon_ads_mcp/utils/http_client.py +873 -0
  65. amazon_ads_mcp/utils/media/__init__.py +21 -0
  66. amazon_ads_mcp/utils/media/negotiator.py +243 -0
  67. amazon_ads_mcp/utils/media/types.py +199 -0
  68. amazon_ads_mcp/utils/openapi/__init__.py +16 -0
  69. amazon_ads_mcp/utils/openapi/json.py +55 -0
  70. amazon_ads_mcp/utils/openapi/loader.py +263 -0
  71. amazon_ads_mcp/utils/openapi/refs.py +46 -0
  72. amazon_ads_mcp/utils/region_config.py +200 -0
  73. amazon_ads_mcp/utils/response_wrapper.py +171 -0
  74. amazon_ads_mcp/utils/sampling_helpers.py +156 -0
  75. amazon_ads_mcp/utils/sampling_wrapper.py +173 -0
  76. amazon_ads_mcp/utils/security.py +630 -0
  77. amazon_ads_mcp/utils/tool_naming.py +137 -0
  78. amazon_ads_mcp-0.2.7.dist-info/METADATA +664 -0
  79. amazon_ads_mcp-0.2.7.dist-info/RECORD +82 -0
  80. amazon_ads_mcp-0.2.7.dist-info/WHEEL +4 -0
  81. amazon_ads_mcp-0.2.7.dist-info/entry_points.txt +3 -0
  82. amazon_ads_mcp-0.2.7.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,610 @@
1
+ """Pydantic models for Amazon Stores and Brand Management API responses.
2
+
3
+ This module provides comprehensive type definitions for Amazon Stores, Brand Registry,
4
+ and related brand management API responses.
5
+
6
+ The models cover all major Stores and Brand functionality including:
7
+ - Store creation and management
8
+ - Store page and content management
9
+ - Brand registry and management
10
+ - Store analytics and performance metrics
11
+ - A+ Content (Enhanced Brand Content)
12
+ - Social commerce posts
13
+ - Store templates and customization
14
+ """
15
+
16
+ from datetime import datetime
17
+ from enum import Enum
18
+ from typing import Any, Dict, List, Optional
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, HttpUrl
21
+
22
+
23
+ class StoreStatus(str, Enum):
24
+ """Store status values.
25
+
26
+ Defines the possible states an Amazon Store can be in
27
+ during creation, review, and publication.
28
+ """
29
+
30
+ PUBLISHED = "PUBLISHED"
31
+ DRAFT = "DRAFT"
32
+ UNDER_REVIEW = "UNDER_REVIEW"
33
+ REJECTED = "REJECTED"
34
+ SCHEDULED = "SCHEDULED"
35
+
36
+
37
+ class PageType(str, Enum):
38
+ """Store page types.
39
+
40
+ Defines the different types of pages that can be
41
+ created within an Amazon Store.
42
+ """
43
+
44
+ HOME = "HOME"
45
+ PRODUCT_GRID = "PRODUCT_GRID"
46
+ PRODUCT_HIGHLIGHT = "PRODUCT_HIGHLIGHT"
47
+ MARQUEE = "MARQUEE"
48
+ GALLERY = "GALLERY"
49
+ CUSTOM = "CUSTOM"
50
+
51
+
52
+ class BrandStatus(str, Enum):
53
+ """Brand registry status.
54
+
55
+ Defines the possible states a brand can be in
56
+ within the Amazon Brand Registry.
57
+ """
58
+
59
+ REGISTERED = "REGISTERED"
60
+ PENDING = "PENDING"
61
+ REJECTED = "REJECTED"
62
+ SUSPENDED = "SUSPENDED"
63
+
64
+
65
+ class ContentType(str, Enum):
66
+ """Store content types.
67
+
68
+ Defines the different types of content that can be
69
+ added to store pages.
70
+ """
71
+
72
+ IMAGE = "IMAGE"
73
+ VIDEO = "VIDEO"
74
+ TEXT = "TEXT"
75
+ PRODUCT = "PRODUCT"
76
+ HERO = "HERO"
77
+ CAROUSEL = "CAROUSEL"
78
+
79
+
80
+ # Base Store Model
81
+ class BaseStoreModel(BaseModel):
82
+ """Base model for store entities.
83
+
84
+ Provides common configuration for all store models including
85
+ extra field handling, alias population, and string processing.
86
+ """
87
+
88
+ model_config = ConfigDict(
89
+ extra="allow",
90
+ populate_by_name=True,
91
+ str_strip_whitespace=True,
92
+ )
93
+
94
+
95
+ # Store Models
96
+ class Store(BaseStoreModel):
97
+ """Amazon Store model.
98
+
99
+ Represents an Amazon Store with all its configuration,
100
+ content, and publication status.
101
+
102
+ :param storeId: Unique identifier for the store
103
+ :type storeId: str
104
+ :param storeName: Human-readable name for the store
105
+ :type storeName: str
106
+ :param brandName: Associated brand name
107
+ :type brandName: str
108
+ :param marketplaceId: Marketplace where the store is available
109
+ :type marketplaceId: str
110
+ :param status: Current publication status of the store
111
+ :type status: StoreStatus
112
+ :param storeUrl: Public URL where the store can be accessed
113
+ :type storeUrl: HttpUrl
114
+ :param previewUrl: Preview URL for unpublished changes
115
+ :type previewUrl: Optional[HttpUrl]
116
+ :param lastPublishedDate: When the store was last published
117
+ :type lastPublishedDate: Optional[datetime]
118
+ :param createdAt: When the store was created
119
+ :type createdAt: datetime
120
+ :param updatedAt: When the store was last updated
121
+ :type updatedAt: datetime
122
+ :param pageCount: Number of pages in the store
123
+ :type pageCount: int
124
+ """
125
+
126
+ storeId: str = Field(..., description="Store ID")
127
+ storeName: str = Field(..., description="Store name")
128
+ brandName: str = Field(..., description="Associated brand name")
129
+ marketplaceId: str = Field(..., description="Marketplace ID")
130
+ status: StoreStatus = Field(..., description="Store status")
131
+ storeUrl: HttpUrl = Field(..., description="Public store URL")
132
+ previewUrl: Optional[HttpUrl] = Field(None, description="Preview URL")
133
+ lastPublishedDate: Optional[datetime] = Field(
134
+ None, description="Last published date"
135
+ )
136
+ createdAt: datetime = Field(..., description="Creation timestamp")
137
+ updatedAt: datetime = Field(..., description="Last update timestamp")
138
+ pageCount: int = Field(..., description="Number of pages in store")
139
+
140
+
141
+ class StoreListResponse(BaseStoreModel):
142
+ """Response for store list operations.
143
+
144
+ Contains a list of Amazon Stores with pagination support.
145
+
146
+ :param stores: List of Amazon Stores
147
+ :type stores: List[Store]
148
+ :param nextToken: Token for retrieving the next page of results
149
+ :type nextToken: Optional[str]
150
+ :param totalResults: Total number of stores available
151
+ :type totalResults: Optional[int]
152
+ """
153
+
154
+ stores: List[Store] = Field(default_factory=list)
155
+ nextToken: Optional[str] = Field(None)
156
+ totalResults: Optional[int] = Field(None)
157
+
158
+
159
+ # Store Page Models
160
+ class StorePage(BaseStoreModel):
161
+ """Store page model.
162
+
163
+ Represents a page within an Amazon Store with
164
+ content, layout, and SEO settings.
165
+
166
+ :param pageId: Unique identifier for the page
167
+ :type pageId: str
168
+ :param storeId: Parent store identifier
169
+ :type storeId: str
170
+ :param pageName: Human-readable name for the page
171
+ :type pageName: str
172
+ :param pageType: Type of page layout
173
+ :type pageType: PageType
174
+ :param pageUrl: URL path for the page within the store
175
+ :type pageUrl: str
176
+ :param isHomePage: Whether this is the store's home page
177
+ :type isHomePage: bool
178
+ :param parentPageId: Parent page identifier for nested pages
179
+ :type parentPageId: Optional[str]
180
+ :param seoTitle: SEO title for the page
181
+ :type seoTitle: Optional[str]
182
+ :param seoDescription: SEO description for the page
183
+ :type seoDescription: Optional[str]
184
+ :param status: Current publication status of the page
185
+ :type status: StoreStatus
186
+ :param createdAt: When the page was created
187
+ :type createdAt: datetime
188
+ :param updatedAt: When the page was last updated
189
+ :type updatedAt: datetime
190
+ """
191
+
192
+ pageId: str = Field(..., description="Page ID")
193
+ storeId: str = Field(..., description="Parent store ID")
194
+ pageName: str = Field(..., description="Page name")
195
+ pageType: PageType = Field(..., description="Page type")
196
+ pageUrl: str = Field(..., description="Page URL path")
197
+ isHomePage: bool = Field(False, description="Is this the home page")
198
+ parentPageId: Optional[str] = Field(None, description="Parent page ID")
199
+ seoTitle: Optional[str] = Field(None, description="SEO title")
200
+ seoDescription: Optional[str] = Field(None, description="SEO description")
201
+ status: StoreStatus = Field(..., description="Page status")
202
+ createdAt: datetime = Field(..., description="Creation timestamp")
203
+ updatedAt: datetime = Field(..., description="Last update timestamp")
204
+
205
+
206
+ class StorePageListResponse(BaseStoreModel):
207
+ """Response for store page list operations.
208
+
209
+ Contains a list of store pages with pagination support.
210
+
211
+ :param pages: List of store pages
212
+ :type pages: List[StorePage]
213
+ :param nextToken: Token for retrieving the next page of results
214
+ :type nextToken: Optional[str]
215
+ """
216
+
217
+ pages: List[StorePage] = Field(default_factory=list)
218
+ nextToken: Optional[str] = Field(None)
219
+
220
+
221
+ # Store Content Models
222
+ class StoreContent(BaseStoreModel):
223
+ """Store content item model.
224
+
225
+ Represents a content element within a store page
226
+ such as images, text, or product showcases.
227
+
228
+ :param contentId: Unique identifier for the content
229
+ :type contentId: str
230
+ :param pageId: Page where the content appears
231
+ :type pageId: str
232
+ :param contentType: Type of content element
233
+ :type contentType: ContentType
234
+ :param position: Position of the content on the page
235
+ :type position: int
236
+ :param contentData: Content-specific data and configuration
237
+ :type contentData: Dict[str, Any]
238
+ :param isActive: Whether the content is currently active
239
+ :type isActive: bool
240
+ :param createdAt: When the content was created
241
+ :type createdAt: datetime
242
+ :param updatedAt: When the content was last updated
243
+ :type updatedAt: datetime
244
+ """
245
+
246
+ contentId: str = Field(..., description="Content ID")
247
+ pageId: str = Field(..., description="Page ID where content appears")
248
+ contentType: ContentType = Field(..., description="Content type")
249
+ position: int = Field(..., description="Content position on page")
250
+ contentData: Dict[str, Any] = Field(..., description="Content-specific data")
251
+ isActive: bool = Field(True, description="Is content active")
252
+ createdAt: datetime = Field(..., description="Creation timestamp")
253
+ updatedAt: datetime = Field(..., description="Last update timestamp")
254
+
255
+
256
+ class StoreContentListResponse(BaseStoreModel):
257
+ """Response for store content list operations.
258
+
259
+ Contains a list of store content items with pagination support.
260
+
261
+ :param content: List of store content items
262
+ :type content: List[StoreContent]
263
+ :param nextToken: Token for retrieving the next page of results
264
+ :type nextToken: Optional[str]
265
+ """
266
+
267
+ content: List[StoreContent] = Field(default_factory=list)
268
+ nextToken: Optional[str] = Field(None)
269
+
270
+
271
+ # Brand Models
272
+ class Brand(BaseStoreModel):
273
+ """Brand registry model.
274
+
275
+ Represents a brand registered in the Amazon Brand Registry
276
+ with marketplace coverage and verification status.
277
+
278
+ :param brandId: Unique identifier for the brand
279
+ :type brandId: str
280
+ :param brandName: Human-readable name for the brand
281
+ :type brandName: str
282
+ :param brandRegistry: Brand registry number
283
+ :type brandRegistry: str
284
+ :param status: Current verification status of the brand
285
+ :type status: BrandStatus
286
+ :param marketplaces: List of marketplaces where brand is registered
287
+ :type marketplaces: List[str]
288
+ :param logoUrl: URL to the brand logo image
289
+ :type logoUrl: Optional[HttpUrl]
290
+ :param websiteUrl: Brand's official website URL
291
+ :type websiteUrl: Optional[HttpUrl]
292
+ :param description: Optional description of the brand
293
+ :type description: Optional[str]
294
+ :param registeredDate: When the brand was registered
295
+ :type registeredDate: datetime
296
+ :param lastUpdatedDate: When the brand was last updated
297
+ :type lastUpdatedDate: datetime
298
+ """
299
+
300
+ brandId: str = Field(..., description="Brand ID")
301
+ brandName: str = Field(..., description="Brand name")
302
+ brandRegistry: str = Field(..., description="Brand registry number")
303
+ status: BrandStatus = Field(..., description="Brand status")
304
+ marketplaces: List[str] = Field(..., description="Registered marketplaces")
305
+ logoUrl: Optional[HttpUrl] = Field(None, description="Brand logo URL")
306
+ websiteUrl: Optional[HttpUrl] = Field(None, description="Brand website")
307
+ description: Optional[str] = Field(None, description="Brand description")
308
+ registeredDate: datetime = Field(..., description="Registration date")
309
+ lastUpdatedDate: datetime = Field(..., description="Last update date")
310
+
311
+
312
+ class BrandListResponse(BaseStoreModel):
313
+ """Response for brand list operations.
314
+
315
+ Contains a list of brands with pagination support.
316
+
317
+ :param brands: List of brands
318
+ :type brands: List[Brand]
319
+ :param nextToken: Token for retrieving the next page of results
320
+ :type nextToken: Optional[str]
321
+ :param totalResults: Total number of brands available
322
+ :type totalResults: Optional[int]
323
+ """
324
+
325
+ brands: List[Brand] = Field(default_factory=list)
326
+ nextToken: Optional[str] = Field(None)
327
+ totalResults: Optional[int] = Field(None)
328
+
329
+
330
+ # Brand Store Analytics
331
+ class StoreAnalytics(BaseStoreModel):
332
+ """Store analytics data.
333
+
334
+ Contains performance metrics for an Amazon Store
335
+ including visitor behavior and conversion data.
336
+
337
+ :param storeId: Store identifier
338
+ :type storeId: str
339
+ :param date: Date for the analytics data
340
+ :type date: datetime
341
+ :param visitors: Number of unique visitors
342
+ :type visitors: int
343
+ :param pageViews: Total number of page views
344
+ :type pageViews: int
345
+ :param avgTimeOnStore: Average time spent on store in seconds
346
+ :type avgTimeOnStore: float
347
+ :param bounceRate: Bounce rate percentage
348
+ :type bounceRate: float
349
+ :param conversionRate: Conversion rate percentage
350
+ :type conversionRate: float
351
+ :param salesAmount: Total sales amount
352
+ :type salesAmount: float
353
+ :param unitsOrdered: Number of units ordered
354
+ :type unitsOrdered: int
355
+ """
356
+
357
+ storeId: str = Field(..., description="Store ID")
358
+ date: datetime = Field(..., description="Analytics date")
359
+ visitors: int = Field(..., description="Number of visitors")
360
+ pageViews: int = Field(..., description="Number of page views")
361
+ avgTimeOnStore: float = Field(..., description="Average time on store (seconds)")
362
+ bounceRate: float = Field(..., description="Bounce rate percentage")
363
+ conversionRate: float = Field(..., description="Conversion rate percentage")
364
+ salesAmount: float = Field(..., description="Sales amount")
365
+ unitsOrdered: int = Field(..., description="Units ordered")
366
+
367
+
368
+ class StorePageAnalytics(BaseStoreModel):
369
+ """Store page-level analytics.
370
+
371
+ Contains performance metrics for individual
372
+ pages within an Amazon Store.
373
+
374
+ :param pageId: Page identifier
375
+ :type pageId: str
376
+ :param date: Date for the analytics data
377
+ :type date: datetime
378
+ :param pageViews: Number of page views
379
+ :type pageViews: int
380
+ :param uniqueVisitors: Number of unique visitors
381
+ :type uniqueVisitors: int
382
+ :param avgTimeOnPage: Average time spent on page in seconds
383
+ :type avgTimeOnPage: float
384
+ :param exitRate: Exit rate percentage
385
+ :type exitRate: float
386
+ :param clickThroughRate: Click-through rate percentage
387
+ :type clickThroughRate: float
388
+ """
389
+
390
+ pageId: str = Field(..., description="Page ID")
391
+ date: datetime = Field(..., description="Analytics date")
392
+ pageViews: int = Field(..., description="Number of page views")
393
+ uniqueVisitors: int = Field(..., description="Unique visitors")
394
+ avgTimeOnPage: float = Field(..., description="Average time on page (seconds)")
395
+ exitRate: float = Field(..., description="Exit rate percentage")
396
+ clickThroughRate: float = Field(..., description="Click-through rate")
397
+
398
+
399
+ # A+ Content Models
400
+ class APlusContent(BaseStoreModel):
401
+ """A+ Content (Enhanced Brand Content) model.
402
+
403
+ Represents enhanced brand content that can be
404
+ displayed on product detail pages.
405
+
406
+ :param contentId: A+ Content identifier
407
+ :type contentId: str
408
+ :param contentName: Human-readable name for the content
409
+ :type contentName: str
410
+ :param brandId: Associated brand identifier
411
+ :type brandId: str
412
+ :param asin: Associated product ASIN
413
+ :type asin: str
414
+ :param marketplaceId: Marketplace where content is displayed
415
+ :type marketplaceId: str
416
+ :param status: Current status of the content
417
+ :type status: str
418
+ :param modules: Content modules and layout configuration
419
+ :type modules: List[Dict[str, Any]]
420
+ :param lastUpdatedDate: When the content was last updated
421
+ :type lastUpdatedDate: datetime
422
+ """
423
+
424
+ contentId: str = Field(..., description="A+ Content ID")
425
+ contentName: str = Field(..., description="Content name")
426
+ brandId: str = Field(..., description="Brand ID")
427
+ asin: str = Field(..., description="Associated ASIN")
428
+ marketplaceId: str = Field(..., description="Marketplace ID")
429
+ status: str = Field(..., description="Content status")
430
+ modules: List[Dict[str, Any]] = Field(..., description="Content modules")
431
+ lastUpdatedDate: datetime = Field(..., description="Last update date")
432
+
433
+
434
+ class APlusContentListResponse(BaseStoreModel):
435
+ """Response for A+ Content list operations.
436
+
437
+ Contains a list of A+ Content items with pagination support.
438
+
439
+ :param content: List of A+ Content items
440
+ :type content: List[APlusContent]
441
+ :param nextToken: Token for retrieving the next page of results
442
+ :type nextToken: Optional[str]
443
+ """
444
+
445
+ content: List[APlusContent] = Field(default_factory=list)
446
+ nextToken: Optional[str] = Field(None)
447
+
448
+
449
+ # Brand Metrics
450
+ class BrandMetrics(BaseStoreModel):
451
+ """Brand-level performance metrics.
452
+
453
+ Contains comprehensive performance data for
454
+ a brand across all its products and campaigns.
455
+
456
+ :param brandId: Brand identifier
457
+ :type brandId: str
458
+ :param date: Date for the metrics data
459
+ :type date: datetime
460
+ :param brandSearchVolume: Number of brand-related searches
461
+ :type brandSearchVolume: int
462
+ :param brandImpressions: Number of brand impressions
463
+ :type brandImpressions: int
464
+ :param considerationRate: Brand consideration rate percentage
465
+ :type considerationRate: float
466
+ :param purchaseRate: Brand purchase rate percentage
467
+ :type purchaseRate: float
468
+ :param repeatPurchaseRate: Repeat purchase rate percentage
469
+ :type repeatPurchaseRate: float
470
+ :param averageOrderValue: Average order value
471
+ :type averageOrderValue: float
472
+ :param newToBrandCustomers: Number of new-to-brand customers
473
+ :type newToBrandCustomers: int
474
+ """
475
+
476
+ brandId: str = Field(..., description="Brand ID")
477
+ date: datetime = Field(..., description="Metrics date")
478
+ brandSearchVolume: int = Field(..., description="Brand search volume")
479
+ brandImpressions: int = Field(..., description="Brand impressions")
480
+ considerationRate: float = Field(..., description="Consideration rate")
481
+ purchaseRate: float = Field(..., description="Purchase rate")
482
+ repeatPurchaseRate: float = Field(..., description="Repeat purchase rate")
483
+ averageOrderValue: float = Field(..., description="Average order value")
484
+ newToBrandCustomers: int = Field(..., description="New-to-brand customers")
485
+
486
+
487
+ # Posts (Social Commerce)
488
+ class Post(BaseStoreModel):
489
+ """Brand post model for social commerce.
490
+
491
+ Represents a social media post that can be
492
+ displayed in Amazon's social commerce features.
493
+
494
+ :param postId: Post identifier
495
+ :type postId: str
496
+ :param brandId: Associated brand identifier
497
+ :type brandId: str
498
+ :param postType: Type of social media post
499
+ :type postType: str
500
+ :param title: Optional title for the post
501
+ :type title: Optional[str]
502
+ :param caption: Post caption text
503
+ :type caption: str
504
+ :param mediaUrls: URLs to media files (images, videos)
505
+ :type mediaUrls: List[HttpUrl]
506
+ :param productAsins: List of product ASINs tagged in the post
507
+ :type productAsins: List[str]
508
+ :param publishedDate: When the post was published
509
+ :type publishedDate: datetime
510
+ :param impressions: Number of post impressions
511
+ :type impressions: int
512
+ :param engagement: Total engagement with the post
513
+ :type engagement: int
514
+ """
515
+
516
+ postId: str = Field(..., description="Post ID")
517
+ brandId: str = Field(..., description="Brand ID")
518
+ postType: str = Field(..., description="Post type")
519
+ title: Optional[str] = Field(None, description="Post title")
520
+ caption: str = Field(..., description="Post caption")
521
+ mediaUrls: List[HttpUrl] = Field(..., description="Media URLs")
522
+ productAsins: List[str] = Field(default_factory=list, description="Tagged products")
523
+ publishedDate: datetime = Field(..., description="Published date")
524
+ impressions: int = Field(0, description="Post impressions")
525
+ engagement: int = Field(0, description="Total engagement")
526
+
527
+
528
+ class PostListResponse(BaseStoreModel):
529
+ """Response for post list operations.
530
+
531
+ Contains a list of brand posts with pagination support.
532
+
533
+ :param posts: List of brand posts
534
+ :type posts: List[Post]
535
+ :param nextToken: Token for retrieving the next page of results
536
+ :type nextToken: Optional[str]
537
+ """
538
+
539
+ posts: List[Post] = Field(default_factory=list)
540
+ nextToken: Optional[str] = Field(None)
541
+
542
+
543
+ # Store Template Models
544
+ class StoreTemplate(BaseStoreModel):
545
+ """Store template model.
546
+
547
+ Represents a pre-designed store template that can be
548
+ used as a starting point for store creation.
549
+
550
+ :param templateId: Template identifier
551
+ :type templateId: str
552
+ :param templateName: Human-readable name for the template
553
+ :type templateName: str
554
+ :param templateType: Type of store template
555
+ :type templateType: str
556
+ :param category: Template category or industry
557
+ :type category: str
558
+ :param thumbnailUrl: URL to template thumbnail image
559
+ :type thumbnailUrl: HttpUrl
560
+ :param previewUrl: URL to preview the template
561
+ :type previewUrl: HttpUrl
562
+ :param isPremium: Whether this is a premium template
563
+ :type isPremium: bool
564
+ :param features: List of template features and capabilities
565
+ :type features: List[str]
566
+ """
567
+
568
+ templateId: str = Field(..., description="Template ID")
569
+ templateName: str = Field(..., description="Template name")
570
+ templateType: str = Field(..., description="Template type")
571
+ category: str = Field(..., description="Template category")
572
+ thumbnailUrl: HttpUrl = Field(..., description="Template thumbnail")
573
+ previewUrl: HttpUrl = Field(..., description="Template preview")
574
+ isPremium: bool = Field(False, description="Is premium template")
575
+ features: List[str] = Field(..., description="Template features")
576
+
577
+
578
+ # Export all models
579
+ __all__ = [
580
+ # Enums
581
+ "StoreStatus",
582
+ "PageType",
583
+ "BrandStatus",
584
+ "ContentType",
585
+ # Store models
586
+ "Store",
587
+ "StoreListResponse",
588
+ # Page models
589
+ "StorePage",
590
+ "StorePageListResponse",
591
+ # Content models
592
+ "StoreContent",
593
+ "StoreContentListResponse",
594
+ # Brand models
595
+ "Brand",
596
+ "BrandListResponse",
597
+ # Analytics models
598
+ "StoreAnalytics",
599
+ "StorePageAnalytics",
600
+ # A+ Content models
601
+ "APlusContent",
602
+ "APlusContentListResponse",
603
+ # Metrics models
604
+ "BrandMetrics",
605
+ # Post models
606
+ "Post",
607
+ "PostListResponse",
608
+ # Template models
609
+ "StoreTemplate",
610
+ ]
@@ -0,0 +1,6 @@
1
+ """Amazon Ads API MCP server module.
2
+
3
+ This module contains the Model Context Protocol (MCP) server implementation
4
+ for the Amazon Ads API, including server creation, tool registration,
5
+ and request handling.
6
+ """
@@ -0,0 +1,6 @@
1
+ """Main entry point for the Amazon Ads MCP server."""
2
+
3
+ from .mcp_server import main
4
+
5
+ if __name__ == "__main__":
6
+ main()