@datadive-tools/mcp 0.8.0 → 0.9.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.
package/README.md CHANGED
@@ -16,6 +16,8 @@ except as the `x-api-key` header on requests to `api.datadive.tools`.
16
16
  - "Show me my rank radars."
17
17
  - "Plot the organic ranking trend for rank radar Y from 2024-03-01 to 2024-04-01."
18
18
  - "Run a niche dive on ASIN B08N5WRWNW in the US marketplace with 5 competitors."
19
+ - "Refresh niche X with today's data, same competitors."
20
+ - "Re-dive niche X with 12 competitors but keep B08N5WRWNW in the set."
19
21
  - "Is my dive done yet?"
20
22
  - "Start a rank radar tracking 10 keywords for ASIN B08N5WRWNW in niche X."
21
23
  - "Which Amazon seller accounts are connected?"
@@ -103,7 +105,8 @@ niches, plus pagination metadata. If you don't, see Troubleshooting below.
103
105
  | `list_rank_radars` | Paginated list of rank radars. Filter by `nicheId` or `status`. |
104
106
  | `get_rank_radar_data` | Historical keyword rankings for a rank radar within a `startDate`/`endDate` range. |
105
107
  | `create_niche_dive` | **Spends dive tokens.** Starts new niche research from a seed ASIN. Async — returns a `diveId` to poll with `get_dive_status`. Requires `confirm: true`. |
106
- | `get_dive_status` | Poll a dive started by `create_niche_dive`: `in_progress`, `success` (carries the new `nicheId`), or `error`. |
108
+ | `redive_niche` | **Spends dive tokens.** Refreshes an existing niche with current data — either the same competitors or a newly discovered set. Async — returns a `diveId` to poll with `get_dive_status`. Requires `confirm: true`. |
109
+ | `get_dive_status` | Poll a dive started by `create_niche_dive` or `redive_niche`: `in_progress`, `success` (carries the `nicheId`), or `error`. |
107
110
  | `create_rank_radar` | **Spends Search Term tokens.** Starts tracking keyword rankings for an ASIN in a niche. Returns a `rankRadarId`. Requires `confirm: true`. |
108
111
  | `list_seller_profiles` | Paginated list of connected Amazon seller accounts. Discovery step — returns the `sellerId` + `marketplace` the seller-scoped tools below (and the alert tools) need. |
109
112
  | `get_seller_catalog` | Paginated catalog of a seller's own ASINs. Filter by `search`, `brand`, and `status` (Active by default). |
@@ -115,17 +118,18 @@ niches, plus pagination metadata. If you don't, see Troubleshooting below.
115
118
  | `list_usage` | Paginated billable usage logs (token-consumption events). Filter by `type`, `search` (user), and `startDate`/`endDate`. |
116
119
 
117
120
  All data is scoped to the organization that owns the API key. Most tools are
118
- read-only; the two `create_*` tools below spend tokens (`get_dive_status` only
119
- polls a dive and is read-only) — see
121
+ read-only; the three tools below spend tokens (`get_dive_status` only polls a
122
+ dive and is read-only) — see
120
123
  [Creating dives & rank radars](#creating-dives--rank-radars).
121
124
 
122
125
  ### Creating dives & rank radars
123
126
 
124
- `create_niche_dive` and `create_rank_radar` **consume billable tokens and cannot
125
- be undone**, so they require an explicit `confirm: true` argument. The assistant
126
- should confirm the cost with you before passing it. The amount scales with
127
- `numberOfCompetitors` (dives) / `numberOfKeywords` (rank radars). Check remaining
128
- balance any time with `get_quota`.
127
+ `create_niche_dive`, `redive_niche` and `create_rank_radar` **consume billable
128
+ tokens and cannot be undone**, so they require an explicit `confirm: true`
129
+ argument. The assistant should confirm the cost with you before passing it. The
130
+ amount scales with `numberOfCompetitors` (dives and re-dives) /
131
+ `numberOfKeywords` (rank radars). Check remaining balance any time with
132
+ `get_quota`.
129
133
 
130
134
  To skip the per-call confirmation (e.g. in an automated setup), set
131
135
  `DATADIVE_AUTO_CONFIRM_WRITES=true` in your client config — then these tools run
@@ -136,6 +140,17 @@ estimated completion time immediately; poll `get_dive_status` with that `diveId`
136
140
  until it reports `success`, which carries the new `nicheId` you then feed to
137
141
  `list_niches`, `get_niche_keywords`, and the other niche tools.
138
142
 
143
+ `redive_niche` refreshes a niche you already have rather than creating another
144
+ one, and it keeps the same `nicheId` — so rank radars and reports built on that
145
+ niche follow the refreshed data. It takes a `mode`:
146
+
147
+ - `same_competitors` — re-dive the niche's current competitor set. Nothing else
148
+ to supply; use it purely to pull in current sales, price and keyword data.
149
+ - `discover` — search for a fresh competitor set of `numberOfCompetitors` ASINs.
150
+ Steer it with `heroAsin` (the seed to build around; defaults to the niche's
151
+ highest-selling competitor, preferring one of your own ASINs), `lockedAsins`
152
+ (kept no matter what discovery finds) and `excludedAsins` (never selected).
153
+
139
154
  > ⚠️ For `create_niche_dive`, `marketplace` uses full Amazon domain suffixes
140
155
  > (`com`, `co.uk`, `com.mx`, `co.jp`, …) — e.g. the UK marketplace is `co.uk`,
141
156
  > not `uk`.
package/dist/index.js CHANGED
@@ -105,7 +105,7 @@ function extractMessage(body) {
105
105
  }
106
106
 
107
107
  // package.json
108
- var version = "0.8.0";
108
+ var version = "0.9.0";
109
109
 
110
110
  // src/http/client.ts
111
111
  var PKG_VERSION = version;
@@ -489,16 +489,73 @@ var createNicheDiveTool = {
489
489
  }
490
490
  };
491
491
 
492
- // src/tools/get-dive-status.ts
492
+ // src/tools/redive-niche.ts
493
493
  import { z as z10 } from "zod";
494
494
  var inputSchema10 = {
495
- diveId: z10.string().min(1).describe("The dive identifier returned by `create_niche_dive`.")
495
+ nicheId: z10.string().min(1).describe("The niche to re-dive. Get one from `list_niches`."),
496
+ mode: z10.enum(["same_competitors", "discover"]).describe(
497
+ "How to pick the competitors for the refreshed dive. `same_competitors` re-runs the niche's current competitor set and takes no other argument \u2014 use it to refresh stale data. `discover` searches for a fresh competitor set, which is what you want when the niche has changed."
498
+ ),
499
+ numberOfCompetitors: z10.number().int().min(2).optional().describe(
500
+ "Total ASINs the refreshed dive should contain, including `lockedAsins`. Required in `discover` mode and rejected in `same_competitors` mode. Dive tokens are spent per ASIN."
501
+ ),
502
+ heroAsin: z10.string().min(1).optional().describe(
503
+ "`discover` mode only. Seed product the competitor discovery starts from. Defaults to the niche's highest-selling competitor, preferring one the user's own connected seller account owns."
504
+ ),
505
+ lockedAsins: z10.array(z10.string().min(1)).optional().describe(
506
+ "`discover` mode only. ASINs that must stay in the competitor set regardless of what discovery finds. Cannot exceed `numberOfCompetitors`, and cannot overlap `excludedAsins`."
507
+ ),
508
+ excludedAsins: z10.array(z10.string().min(1)).optional().describe("`discover` mode only. ASINs discovery must never select."),
509
+ confirm: z10.boolean().optional().describe(
510
+ "Must be true to proceed \u2014 a re-dive spends dive tokens. Confirm the cost with the user first."
511
+ )
512
+ };
513
+ var rediveNicheTool = {
514
+ name: "redive_niche",
515
+ title: "Re-dive an Existing Niche",
516
+ description: "Use this to refresh an existing niche's research with current Amazon data, instead of creating a new niche with `create_niche_dive`. \u26A0\uFE0F Spends dive tokens (one batch per ASIN dived) and cannot be undone \u2014 set `confirm: true` only after the user approves the cost. Two modes: `same_competitors` re-dives the niche's current competitor set (no other argument needed) and `discover` finds a fresh set, sized by `numberOfCompetitors` and steerable with `heroAsin` / `lockedAsins` / `excludedAsins`. Runs asynchronously: returns a `diveId` and an `estimatedCompletionDate` \u2014 poll `get_dive_status` with that `diveId` until it reports `success`. The niche keeps its `nicheId`, so existing rank radars and reports follow the refreshed data.",
517
+ inputSchema: inputSchema10,
518
+ // Same reasoning as create_niche_dive: a re-dive is additive rather than destructive, but the
519
+ // irreversible token spend is what clients need to prompt on. The confirm gate enforces it regardless.
520
+ annotations: { readOnlyHint: false, destructiveHint: true },
521
+ handler: async (args, ctx) => {
522
+ if (args.mode === "discover" && args.numberOfCompetitors === void 0) {
523
+ throw new ApiError(
524
+ "bad_request",
525
+ 400,
526
+ 'numberOfCompetitors is required in `discover` mode \u2014 it is how many ASINs the refreshed dive will contain, and therefore what it costs. Ask the user how many competitors they want (minimum 2), or use mode "same_competitors" to re-dive the niche\'s current set.'
527
+ );
528
+ }
529
+ const pending = requireConfirmation(
530
+ args.confirm,
531
+ ctx,
532
+ args.mode === "discover" ? `Re-diving this niche consumes dive tokens \u2014 one batch per ASIN analyzed (${args.numberOfCompetitors} requested).` : "Re-diving this niche consumes dive tokens \u2014 one batch per competitor currently in the niche. Use `get_niche_competitors` first if the user needs the exact count."
533
+ );
534
+ if (pending) return pending;
535
+ return await httpPost(
536
+ { config: ctx.config, toolName: "redive_niche" },
537
+ `/v1/niches/${encodeURIComponent(args.nicheId)}/redive`,
538
+ {
539
+ mode: args.mode,
540
+ numberOfCompetitors: args.numberOfCompetitors,
541
+ heroAsin: args.heroAsin,
542
+ lockedAsins: args.lockedAsins,
543
+ excludedAsins: args.excludedAsins
544
+ }
545
+ );
546
+ }
547
+ };
548
+
549
+ // src/tools/get-dive-status.ts
550
+ import { z as z11 } from "zod";
551
+ var inputSchema11 = {
552
+ diveId: z11.string().min(1).describe("The dive identifier returned by `create_niche_dive` or `redive_niche`.")
496
553
  };
497
554
  var getDiveStatusTool = {
498
555
  name: "get_dive_status",
499
556
  title: "Get Niche Dive Status",
500
- description: "Use this to poll a niche dive started with `create_niche_dive` until it finishes. Returns one of three shapes keyed by `status`: `in_progress` (with `estimatedCompletionDate`), `success` (with the new `nicheId` plus `tokensUsed`/`tokensLeft`), or `error` (with an `error` message). On `success`, use the `nicheId` with `list_niches`, `get_niche_keywords`, `get_niche_competitors`, etc. Re-poll periodically \u2014 dives can take minutes; the `estimatedCompletionDate` hints at when to check.",
501
- inputSchema: inputSchema10,
557
+ description: "Use this to poll a niche dive started with `create_niche_dive` or `redive_niche` until it finishes. Returns one of three shapes keyed by `status`: `in_progress` (with `estimatedCompletionDate`), `success` (with the `nicheId` plus `tokensUsed`/`tokensLeft`), or `error` (with an `error` message). On `success`, use the `nicheId` with `list_niches`, `get_niche_keywords`, `get_niche_competitors`, etc. (for a re-dive it is the same niche you passed in, now carrying refreshed data). Re-poll periodically \u2014 dives can take minutes; the `estimatedCompletionDate` hints at when to check.",
558
+ inputSchema: inputSchema11,
502
559
  annotations: { readOnlyHint: true },
503
560
  handler: async (args, ctx) => {
504
561
  return await httpGet(
@@ -509,16 +566,16 @@ var getDiveStatusTool = {
509
566
  };
510
567
 
511
568
  // src/tools/list-seller-profiles.ts
512
- import { z as z11 } from "zod";
513
- var inputSchema11 = {
514
- currentPage: z11.number().int().min(1).optional().describe("Page number, 1-indexed. Defaults to 1."),
515
- pageSize: z11.number().int().min(1).max(50).optional().describe("Items per page (max 50). Defaults to 20.")
569
+ import { z as z12 } from "zod";
570
+ var inputSchema12 = {
571
+ currentPage: z12.number().int().min(1).optional().describe("Page number, 1-indexed. Defaults to 1."),
572
+ pageSize: z12.number().int().min(1).max(50).optional().describe("Items per page (max 50). Defaults to 20.")
516
573
  };
517
574
  var listSellerProfilesTool = {
518
575
  name: "list_seller_profiles",
519
576
  title: "List Connected Amazon Seller Profiles",
520
577
  description: 'Use this when the user asks which Amazon seller accounts are connected, or as the discovery step to find the `sellerId` and `marketplace` required by `get_asin_inventory_distribution`, `get_seller_catalog`, `get_seller_listing_changes`, and the alert tools. Returns a paginated list of the organization\'s connected seller profiles \u2014 each item has sellerId, sellerName, marketplace (e.g. "com", "co.uk"), hasAdApi (whether Advertising API credentials are connected), and createdAt \u2014 plus pagination metadata (currentPage, pageSize, total, lastPage, hasNext, hasPrev).',
521
- inputSchema: inputSchema11,
578
+ inputSchema: inputSchema12,
522
579
  annotations: { readOnlyHint: true },
523
580
  handler: async (args, ctx) => {
524
581
  return await httpGet(
@@ -533,15 +590,15 @@ var listSellerProfilesTool = {
533
590
  };
534
591
 
535
592
  // src/tools/get-seller-catalog.ts
536
- import { z as z13 } from "zod";
593
+ import { z as z14 } from "zod";
537
594
 
538
595
  // src/tools/seller-scoped.ts
539
- import { z as z12 } from "zod";
596
+ import { z as z13 } from "zod";
540
597
  var sellerScopedInputSchema = {
541
- sellerId: z12.string().min(1).describe(
598
+ sellerId: z13.string().min(1).describe(
542
599
  "Amazon seller account ID. Get it from `list_seller_profiles`, or find it on the Connections page at https://2.datadive.tools."
543
600
  ),
544
- marketplace: z12.enum(SUPPORTED_MARKETPLACES).describe('Amazon marketplace code, e.g. "com" for amazon.com or "co.uk" for amazon.co.uk.')
601
+ marketplace: z13.enum(SUPPORTED_MARKETPLACES).describe('Amazon marketplace code, e.g. "com" for amazon.com or "co.uk" for amazon.co.uk.')
545
602
  };
546
603
  function sellerMarketplacePath(sellerId, marketplace, suffix) {
547
604
  return `/v1/seller_profiles/${encodeURIComponent(sellerId)}/marketplaces/${encodeURIComponent(
@@ -550,19 +607,19 @@ function sellerMarketplacePath(sellerId, marketplace, suffix) {
550
607
  }
551
608
 
552
609
  // src/tools/get-seller-catalog.ts
553
- var inputSchema12 = {
610
+ var inputSchema13 = {
554
611
  ...sellerScopedInputSchema,
555
- search: z13.string().min(1).optional().describe("Case-insensitive partial match on product title or brand."),
556
- brand: z13.string().min(1).optional().describe("Case-insensitive partial match on brand name."),
557
- status: z13.enum(CATALOG_STATUSES).optional().describe('Listing status filter. "Active" (default) or "all".'),
558
- currentPage: z13.number().int().min(1).optional().describe("Page number, 1-indexed. Defaults to 1."),
559
- pageSize: z13.number().int().min(1).max(50).optional().describe("Items per page (max 50). Defaults to 20.")
612
+ search: z14.string().min(1).optional().describe("Case-insensitive partial match on product title or brand."),
613
+ brand: z14.string().min(1).optional().describe("Case-insensitive partial match on brand name."),
614
+ status: z14.enum(CATALOG_STATUSES).optional().describe('Listing status filter. "Active" (default) or "all".'),
615
+ currentPage: z14.number().int().min(1).optional().describe("Page number, 1-indexed. Defaults to 1."),
616
+ pageSize: z14.number().int().min(1).max(50).optional().describe("Items per page (max 50). Defaults to 20.")
560
617
  };
561
618
  var getSellerCatalogTool = {
562
619
  name: "get_seller_catalog",
563
620
  title: "List Catalog ASINs for a Seller",
564
621
  description: "Use this when the user wants to browse or search a seller's own Amazon catalog \u2014 the products they sell on a given marketplace. Requires a `sellerId` + `marketplace` (use `list_seller_profiles` to discover them). Filter by `search` (title/brand), `brand`, and `status` (Active by default, or all). Returns a paginated list where each item has asin, title, parentAsin, brand, status, imageUrl, and hasVariations, plus pagination metadata (currentPage, pageSize, total, lastPage, hasNext, hasPrev).",
565
- inputSchema: inputSchema12,
622
+ inputSchema: inputSchema13,
566
623
  annotations: { readOnlyHint: true },
567
624
  handler: async (args, ctx) => {
568
625
  return await httpGet(
@@ -580,28 +637,28 @@ var getSellerCatalogTool = {
580
637
  };
581
638
 
582
639
  // src/tools/get-seller-listing-changes.ts
583
- import { z as z14 } from "zod";
584
- var inputSchema13 = {
640
+ import { z as z15 } from "zod";
641
+ var inputSchema14 = {
585
642
  ...sellerScopedInputSchema,
586
- types: z14.array(z14.enum(LISTING_CHANGE_TYPES)).min(1).optional().describe('Filter to specific change types. Omit for all. Any of "Price", "Content", "Image".'),
587
- asin: z14.string().min(1).optional().describe("Filter to an exact ASIN or parent ASIN."),
588
- brand: z14.string().min(1).optional().describe("Case-insensitive partial match on brand name."),
589
- search: z14.string().min(1).optional().describe("Case-insensitive partial match on product title or brand."),
590
- startDate: z14.string().regex(ISO_8601, "startDate must be an ISO-8601 date or timestamp (e.g. 2026-05-01 or 2026-05-01T00:00:00Z)").optional().describe("ISO-8601 date/timestamp; return only changes detected on or after this time."),
591
- endDate: z14.string().regex(ISO_8601, "endDate must be an ISO-8601 date or timestamp (e.g. 2026-05-31 or 2026-05-31T23:59:59Z)").optional().describe("ISO-8601 date/timestamp; return only changes detected on or before this time."),
592
- sortBy: z14.enum(LISTING_CHANGE_SORT_BY).optional().describe('Sort field. "date" (default) or "type".'),
593
- sortOrder: z14.enum(SORT_ORDER).optional().describe('Sort direction. "DESC" (default) or "ASC".'),
594
- includeCorrelations: z14.boolean().optional().describe(
643
+ types: z15.array(z15.enum(LISTING_CHANGE_TYPES)).min(1).optional().describe('Filter to specific change types. Omit for all. Any of "Price", "Content", "Image".'),
644
+ asin: z15.string().min(1).optional().describe("Filter to an exact ASIN or parent ASIN."),
645
+ brand: z15.string().min(1).optional().describe("Case-insensitive partial match on brand name."),
646
+ search: z15.string().min(1).optional().describe("Case-insensitive partial match on product title or brand."),
647
+ startDate: z15.string().regex(ISO_8601, "startDate must be an ISO-8601 date or timestamp (e.g. 2026-05-01 or 2026-05-01T00:00:00Z)").optional().describe("ISO-8601 date/timestamp; return only changes detected on or after this time."),
648
+ endDate: z15.string().regex(ISO_8601, "endDate must be an ISO-8601 date or timestamp (e.g. 2026-05-31 or 2026-05-31T23:59:59Z)").optional().describe("ISO-8601 date/timestamp; return only changes detected on or before this time."),
649
+ sortBy: z15.enum(LISTING_CHANGE_SORT_BY).optional().describe('Sort field. "date" (default) or "type".'),
650
+ sortOrder: z15.enum(SORT_ORDER).optional().describe('Sort direction. "DESC" (default) or "ASC".'),
651
+ includeCorrelations: z15.boolean().optional().describe(
595
652
  "When true, include the ranking/conversion `correlation` object per change (CVR and search-term movement before vs after). Defaults to false."
596
653
  ),
597
- currentPage: z14.number().int().min(1).optional().describe("Page number, 1-indexed. Defaults to 1."),
598
- pageSize: z14.number().int().min(1).max(50).optional().describe("Items per page (max 50). Defaults to 20.")
654
+ currentPage: z15.number().int().min(1).optional().describe("Page number, 1-indexed. Defaults to 1."),
655
+ pageSize: z15.number().int().min(1).max(50).optional().describe("Items per page (max 50). Defaults to 20.")
599
656
  };
600
657
  var getSellerListingChangesTool = {
601
658
  name: "get_seller_listing_changes",
602
659
  title: "List Listing Changes for a Seller",
603
660
  description: "Use this when the user asks what changed on their Amazon listings \u2014 price, content (title/bullets/description), or image edits \u2014 for a seller account. Requires a `sellerId` + `marketplace` (use `list_seller_profiles` to discover them). Filter by `types`, `asin`/parent ASIN, `brand`, `search`, and a `startDate`/`endDate` range; sort with `sortBy`/`sortOrder`. Set `includeCorrelations: true` to attach the ranking/conversion impact per change. Returns a paginated list where each item has asin, title, imageUrl, date, type, contentType, description, previousValue, newValue, and (optionally) correlation, plus pagination metadata (currentPage, pageSize, total, lastPage, hasNext, hasPrev).",
604
- inputSchema: inputSchema13,
661
+ inputSchema: inputSchema14,
605
662
  annotations: { readOnlyHint: true },
606
663
  handler: async (args, ctx) => {
607
664
  return await httpGet(
@@ -626,13 +683,13 @@ var getSellerListingChangesTool = {
626
683
  };
627
684
 
628
685
  // src/tools/get-asin-inventory-distribution.ts
629
- import { z as z15 } from "zod";
630
- var inputSchema14 = {
631
- sellerId: z15.string().min(1).describe(
686
+ import { z as z16 } from "zod";
687
+ var inputSchema15 = {
688
+ sellerId: z16.string().min(1).describe(
632
689
  "Amazon seller account ID as connected to DataDive. Get it from `list_seller_profiles`, or find it on the Connections page at https://2.datadive.tools."
633
690
  ),
634
- marketplace: z15.enum(SUPPORTED_MARKETPLACES).describe('Amazon marketplace code, e.g. "com" for amazon.com or "co.uk" for amazon.co.uk.'),
635
- asin: z15.string().regex(/^[A-Z0-9]{10}$/, "ASIN must be 10 uppercase alphanumeric characters (e.g. B08XYZ1234).").describe(
691
+ marketplace: z16.enum(SUPPORTED_MARKETPLACES).describe('Amazon marketplace code, e.g. "com" for amazon.com or "co.uk" for amazon.co.uk.'),
692
+ asin: z16.string().regex(/^[A-Z0-9]{10}$/, "ASIN must be 10 uppercase alphanumeric characters (e.g. B08XYZ1234).").describe(
636
693
  "Amazon Standard Identification Number (10 uppercase alphanumeric characters, e.g. B08XYZ1234)."
637
694
  )
638
695
  };
@@ -640,7 +697,7 @@ var getAsinInventoryDistributionTool = {
640
697
  name: "get_asin_inventory_distribution",
641
698
  title: "Get Per-Fulfillment-Center Inventory Distribution for an ASIN",
642
699
  description: "Use this when the user asks about inventory levels, stock by fulfillment center, or where their units are sitting across Amazon's fulfillment network for a specific ASIN. Requires the Amazon sellerId (from `list_seller_profiles` or the user's DataDive Connections page at https://2.datadive.tools), the marketplace code, and the ASIN. Returns totalSellableUnits and a per-FC `distribution` array (fc, state, availableStock, availableStockPercentage). `lastUpdatedAt` may be null when no successful inventory ingestion has occurred in the last 30 days.",
643
- inputSchema: inputSchema14,
700
+ inputSchema: inputSchema15,
644
701
  annotations: { readOnlyHint: true },
645
702
  handler: async (args, ctx) => {
646
703
  return await httpGet(
@@ -653,18 +710,18 @@ var getAsinInventoryDistributionTool = {
653
710
  };
654
711
 
655
712
  // src/tools/alert-query.ts
656
- import { z as z16 } from "zod";
713
+ import { z as z17 } from "zod";
657
714
  var alertsQueryInputSchema = {
658
- sellerId: z16.string().min(1).max(50).optional().describe('Filter to a single connected Amazon seller account ID, e.g. "A1B2C3D4E5".'),
659
- marketplace: z16.enum(SUPPORTED_MARKETPLACES).optional().describe('Filter to a single Amazon marketplace code, e.g. "com" for amazon.com or "co.uk" for amazon.co.uk.'),
660
- status: z16.enum(ALERT_STATUSES).optional().describe(
715
+ sellerId: z17.string().min(1).max(50).optional().describe('Filter to a single connected Amazon seller account ID, e.g. "A1B2C3D4E5".'),
716
+ marketplace: z17.enum(SUPPORTED_MARKETPLACES).optional().describe('Filter to a single Amazon marketplace code, e.g. "com" for amazon.com or "co.uk" for amazon.co.uk.'),
717
+ status: z17.enum(ALERT_STATUSES).optional().describe(
661
718
  "Lifecycle filter. `active` (default) returns unresolved alerts, `resolved` returns resolved alerts, `all` returns both. Dismissed alerts are never returned."
662
719
  ),
663
- updatedSince: z16.string().regex(ISO_8601, "updatedSince must be an ISO-8601 date or timestamp (e.g. 2026-05-01 or 2026-05-01T00:00:00Z)").optional().describe(
720
+ updatedSince: z17.string().regex(ISO_8601, "updatedSince must be an ISO-8601 date or timestamp (e.g. 2026-05-01 or 2026-05-01T00:00:00Z)").optional().describe(
664
721
  "ISO-8601 timestamp; return only alerts surfaced at or after this time (filters on `lastAlertedAt`). Use it to incrementally sync since your last poll. Defaults to the last 30 days when omitted."
665
722
  ),
666
- currentPage: z16.number().int().min(1).optional().describe("Page number, 1-indexed. Defaults to 1."),
667
- pageSize: z16.number().int().min(1).max(50).optional().describe("Items per page (max 50). Defaults to 20.")
723
+ currentPage: z17.number().int().min(1).optional().describe("Page number, 1-indexed. Defaults to 1."),
724
+ pageSize: z17.number().int().min(1).max(50).optional().describe("Items per page (max 50). Defaults to 20.")
668
725
  };
669
726
 
670
727
  // src/tools/list-indexing-issue-alerts.ts
@@ -714,12 +771,12 @@ var listBlindSpendAlertsTool = {
714
771
  };
715
772
 
716
773
  // src/tools/get-quota.ts
717
- var inputSchema15 = {};
774
+ var inputSchema16 = {};
718
775
  var getQuotaTool = {
719
776
  name: "get_quota",
720
777
  title: "Get Quota Usage",
721
778
  description: "Use this when the user asks how much quota or how many tokens they have left, or before creating a Niche Dive or Rank Radar to check remaining headroom. Returns current quota usage and capacity for each billable feature \u2014 DIVED_ASINS (Dive tokens), RANK_RADAR_KEYWORDS (tracked keywords), PRODUCT_BRIEF_ASINS, and AI_COPYWRITER_PROMPTS \u2014 each with `used` and `capacity` (null when unlimited / not applicable), plus `nextRefreshDate` (ISO-8601 timestamp of the next quota reset, or null). Takes no arguments.",
722
- inputSchema: inputSchema15,
779
+ inputSchema: inputSchema16,
723
780
  annotations: { readOnlyHint: true },
724
781
  handler: async (_args, ctx) => {
725
782
  return await httpGet({ config: ctx.config, toolName: "get_quota" }, "/v1/quota");
@@ -727,20 +784,20 @@ var getQuotaTool = {
727
784
  };
728
785
 
729
786
  // src/tools/list-usage.ts
730
- import { z as z17 } from "zod";
731
- var inputSchema16 = {
732
- type: z17.enum(BILLABLE_FEATURE_TYPES).optional().describe("Filter to a single billable feature type. Omit to return all types."),
733
- search: z17.string().min(1).optional().describe("Case-insensitive partial match on the user's name or email."),
734
- startDate: z17.string().regex(ISO_8601, "startDate must be an ISO-8601 date or timestamp (e.g. 2026-05-01 or 2026-05-01T00:00:00Z)").optional().describe("ISO-8601 date/timestamp; return only usage logs recorded on or after this time."),
735
- endDate: z17.string().regex(ISO_8601, "endDate must be an ISO-8601 date or timestamp (e.g. 2026-05-31 or 2026-05-31T23:59:59Z)").optional().describe("ISO-8601 date/timestamp; return only usage logs recorded on or before this time."),
736
- currentPage: z17.number().int().min(1).optional().describe("Page number, 1-indexed. Defaults to 1."),
737
- pageSize: z17.number().int().min(1).max(200).optional().describe("Items per page (max 200). Defaults to 50.")
787
+ import { z as z18 } from "zod";
788
+ var inputSchema17 = {
789
+ type: z18.enum(BILLABLE_FEATURE_TYPES).optional().describe("Filter to a single billable feature type. Omit to return all types."),
790
+ search: z18.string().min(1).optional().describe("Case-insensitive partial match on the user's name or email."),
791
+ startDate: z18.string().regex(ISO_8601, "startDate must be an ISO-8601 date or timestamp (e.g. 2026-05-01 or 2026-05-01T00:00:00Z)").optional().describe("ISO-8601 date/timestamp; return only usage logs recorded on or after this time."),
792
+ endDate: z18.string().regex(ISO_8601, "endDate must be an ISO-8601 date or timestamp (e.g. 2026-05-31 or 2026-05-31T23:59:59Z)").optional().describe("ISO-8601 date/timestamp; return only usage logs recorded on or before this time."),
793
+ currentPage: z18.number().int().min(1).optional().describe("Page number, 1-indexed. Defaults to 1."),
794
+ pageSize: z18.number().int().min(1).max(200).optional().describe("Items per page (max 200). Defaults to 50.")
738
795
  };
739
796
  var listUsageTool = {
740
797
  name: "list_usage",
741
798
  title: "List Billable Usage Logs",
742
799
  description: "Use this when the user asks who consumed tokens, how their quota was spent, or wants an audit of billable activity over a date range. Retrieves a paginated list of billable feature usage logs for the organization \u2014 each entry is a token-consumption event (a dive, rank-radar creation, AI copywriter prompt, etc.). Filter by `type` (billable feature), `search` (user name/email), and `startDate`/`endDate`. Each item includes name, email, qty (tokens consumed), type, action (specific operation), nicheId/nicheName, rankRadarId, and date, plus pagination metadata (currentPage, pageSize, total, lastPage, hasNext, hasPrev).",
743
- inputSchema: inputSchema16,
800
+ inputSchema: inputSchema17,
744
801
  annotations: { readOnlyHint: true },
745
802
  handler: async (args, ctx) => {
746
803
  return await httpGet(
@@ -769,6 +826,7 @@ var allTools = [
769
826
  getRankRadarDataTool,
770
827
  createRankRadarTool,
771
828
  createNicheDiveTool,
829
+ rediveNicheTool,
772
830
  getDiveStatusTool,
773
831
  listSellerProfilesTool,
774
832
  getSellerCatalogTool,