@datadive-tools/mcp 0.14.0 → 0.16.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 +4 -0
- package/dist/index.js +405 -145
- package/dist/index.js.map +1 -1
- package/dist/lib.d.ts +34 -1
- package/dist/lib.js +410 -146
- package/dist/lib.js.map +1 -1
- package/package.json +1 -1
package/dist/lib.js
CHANGED
|
@@ -139,7 +139,7 @@ function extractMessage(body) {
|
|
|
139
139
|
}
|
|
140
140
|
|
|
141
141
|
// package.json
|
|
142
|
-
var version = "0.
|
|
142
|
+
var version = "0.16.0";
|
|
143
143
|
|
|
144
144
|
// src/http/client.ts
|
|
145
145
|
var PKG_VERSION = version;
|
|
@@ -403,6 +403,33 @@ var SUPPORTED_MARKETPLACES = [
|
|
|
403
403
|
];
|
|
404
404
|
var RANK_RADAR_STATES = ["ACTIVE", "PAUSED", "ARCHIVED"];
|
|
405
405
|
var RANK_RADAR_STATUSES = [...RANK_RADAR_STATES, "ALL"];
|
|
406
|
+
var PPC_CAMPAIGN_BASE_SORT_BY = [
|
|
407
|
+
"name",
|
|
408
|
+
"state",
|
|
409
|
+
"bidStrategy",
|
|
410
|
+
"budget",
|
|
411
|
+
"impressions",
|
|
412
|
+
"clicks",
|
|
413
|
+
"ctr",
|
|
414
|
+
"cpc",
|
|
415
|
+
"spend",
|
|
416
|
+
"unitsSold",
|
|
417
|
+
"sales",
|
|
418
|
+
"acos",
|
|
419
|
+
"cvr",
|
|
420
|
+
"tosImpressionShare"
|
|
421
|
+
];
|
|
422
|
+
var PPC_CAMPAIGN_PLACEMENT_SORT_BY = [
|
|
423
|
+
...["tos", "ros", "pp", "off"].flatMap(
|
|
424
|
+
(p) => ["Impressions", "Clicks", "Spend", "Sales", "UnitsSold", "Ctr", "Cpc", "Acos"].map(
|
|
425
|
+
(m) => `${p}${m}`
|
|
426
|
+
)
|
|
427
|
+
),
|
|
428
|
+
"tosBidAdjustment",
|
|
429
|
+
"rosBidAdjustment",
|
|
430
|
+
"ppBidAdjustment"
|
|
431
|
+
];
|
|
432
|
+
var PPC_CAMPAIGN_STATES = ["ENABLED", "PAUSED"];
|
|
406
433
|
var ALERT_STATUSES = ["active", "resolved", "all"];
|
|
407
434
|
var BILLABLE_FEATURE_TYPES = [
|
|
408
435
|
"DIVED_ASINS",
|
|
@@ -454,42 +481,92 @@ var listRankRadarsTool = {
|
|
|
454
481
|
}
|
|
455
482
|
};
|
|
456
483
|
|
|
457
|
-
// src/tools/
|
|
484
|
+
// src/tools/rank-radar-keyword-query.ts
|
|
458
485
|
import { z as z7 } from "zod";
|
|
459
486
|
var ISO_DATE = /^\d{4}-\d{2}-\d{2}$/;
|
|
460
487
|
var RANK_RADAR_KEYWORDS_MAX_PAGE_SIZE = 100;
|
|
461
488
|
var RANK_RADAR_MAX_DATE_RANGE_DAYS = 90;
|
|
462
|
-
var
|
|
489
|
+
var rankRadarKeywordQueryInputSchema = {
|
|
463
490
|
rankRadarId: z7.string().uuid().describe("The Rank Radar UUID (from `list_rank_radars`)."),
|
|
464
|
-
startDate: z7.string().regex(ISO_DATE, "startDate must be in yyyy-mm-dd format").describe("Start date
|
|
491
|
+
startDate: z7.string().regex(ISO_DATE, "startDate must be in yyyy-mm-dd format").describe("Start date of the range, yyyy-mm-dd (e.g. 2024-03-26)."),
|
|
465
492
|
endDate: z7.string().regex(ISO_DATE, "endDate must be in yyyy-mm-dd format").describe(
|
|
466
|
-
`End date
|
|
493
|
+
`End date of the range, yyyy-mm-dd (e.g. 2024-04-26). Must be on or after startDate, and at most ${RANK_RADAR_MAX_DATE_RANGE_DAYS} days after it.`
|
|
467
494
|
),
|
|
468
495
|
currentPage: z7.number().int().min(1).optional().describe("Page of keywords, 1-indexed. Defaults to 1."),
|
|
469
496
|
pageSize: z7.number().int().min(1).max(RANK_RADAR_KEYWORDS_MAX_PAGE_SIZE).optional().describe(`Keywords per page (max ${RANK_RADAR_KEYWORDS_MAX_PAGE_SIZE}). Defaults to 20.`)
|
|
470
497
|
};
|
|
498
|
+
var RANK_RADAR_KEYWORD_PAGING_NOTE = `Results are paged by keyword: \`data\` holds one page, and the response carries currentPage, pageSize, total, lastPage, hasNext and hasPrev. \`total\` is the Rank Radar's active keyword count; to read every keyword, call again with \`currentPage\` + 1 while \`hasNext\` is true, using \`pageSize\` ${RANK_RADAR_KEYWORDS_MAX_PAGE_SIZE} for large Rank Radars. Paused keywords are not included.`;
|
|
499
|
+
function rankRadarPath(rankRadarId, suffix = "") {
|
|
500
|
+
return `/v1/niches/rank-radars/${encodeURIComponent(rankRadarId)}${suffix ? `/${suffix}` : ""}`;
|
|
501
|
+
}
|
|
502
|
+
function rankRadarKeywordQuery(args) {
|
|
503
|
+
return {
|
|
504
|
+
startDate: args.startDate,
|
|
505
|
+
endDate: args.endDate,
|
|
506
|
+
currentPage: args.currentPage,
|
|
507
|
+
pageSize: args.pageSize
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
// src/tools/get-rank-radar-data.ts
|
|
512
|
+
var inputSchema7 = rankRadarKeywordQueryInputSchema;
|
|
471
513
|
var getRankRadarDataTool = {
|
|
472
514
|
name: "get_rank_radar_data",
|
|
473
515
|
title: "Get Keyword Rankings for a Rank Radar",
|
|
474
|
-
description: `Use this to analyze keyword ranking trends over time. Requires startDate and endDate (yyyy-mm-dd), at most ${RANK_RADAR_MAX_DATE_RANGE_DAYS} days apart. Retrieves historical keyword ranking data for the specified Rank Radar within the date range.
|
|
516
|
+
description: `Use this to analyze keyword ranking trends over time. Requires startDate and endDate (yyyy-mm-dd), at most ${RANK_RADAR_MAX_DATE_RANGE_DAYS} days apart. Retrieves historical keyword ranking data for the specified Rank Radar within the date range. ${RANK_RADAR_KEYWORD_PAGING_NOTE} Each keyword has id, keyword, searchVolume, relevancy, ranks (per-day { date, organicRank, sponsoredRank, impressionRank }), and any highlight annotations. A rank of 101 means the product was not in the top 100 results that day. For PPC metrics use \`get_rank_radar_ppc_data\`; for Search Query Performance use \`get_rank_radar_sqp_data\`. Use after \`list_rank_radars\` to discover a \`rankRadarId\`.`,
|
|
475
517
|
inputSchema: inputSchema7,
|
|
476
518
|
annotations: { readOnlyHint: true },
|
|
477
519
|
handler: async (args, ctx) => {
|
|
478
520
|
return await httpGet(
|
|
479
521
|
{ config: ctx.config, toolName: "get_rank_radar_data" },
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
startDate: args.startDate,
|
|
483
|
-
endDate: args.endDate,
|
|
484
|
-
currentPage: args.currentPage,
|
|
485
|
-
pageSize: args.pageSize
|
|
486
|
-
}
|
|
522
|
+
rankRadarPath(args.rankRadarId),
|
|
523
|
+
rankRadarKeywordQuery(args)
|
|
487
524
|
);
|
|
488
525
|
}
|
|
489
526
|
};
|
|
490
527
|
|
|
491
|
-
// src/tools/
|
|
528
|
+
// src/tools/get-rank-radar-sqp-data.ts
|
|
529
|
+
var inputSchema8 = rankRadarKeywordQueryInputSchema;
|
|
530
|
+
var getRankRadarSqpDataTool = {
|
|
531
|
+
name: "get_rank_radar_sqp_data",
|
|
532
|
+
title: "Get Search Query Performance for a Rank Radar",
|
|
533
|
+
description: `Use this when the user asks how shoppers search, click, add to cart and buy for the keywords of a Rank Radar \u2014 Amazon's Search Query Performance (SQP) data, from Brand Analytics. Requires startDate and endDate (yyyy-mm-dd), at most ${RANK_RADAR_MAX_DATE_RANGE_DAYS} days apart; 30 days or less keeps it fast. Each keyword's metrics are aggregated over the range: searchQueryVolume and searchQueryScore; impressions, clicks, cart adds and purchases, each as the total across all sellers (\`*TotalCount\`), this ASIN family's count (\`*AsinCount\`) and its share (\`*AsinShare\`); click, cart-add and purchase rates; and ctr/cvr for the market (\`*Total\`) and for this ASIN family (\`*Asin\`). \`numberOfDaysWithData\` says how many days of the range had SQP data; metrics are null when there is none, which is normal for low-volume keywords, recent dates (Amazon publishes SQP with a delay) and sellers without Brand Analytics. ${RANK_RADAR_KEYWORD_PAGING_NOTE} Each call counts toward API usage and is rate limited (about 60 requests/minute). Use after \`list_rank_radars\` to discover a \`rankRadarId\`.`,
|
|
534
|
+
inputSchema: inputSchema8,
|
|
535
|
+
annotations: { readOnlyHint: true },
|
|
536
|
+
handler: async (args, ctx) => {
|
|
537
|
+
return await httpGet(
|
|
538
|
+
{ config: ctx.config, toolName: "get_rank_radar_sqp_data" },
|
|
539
|
+
rankRadarPath(args.rankRadarId, "sqp"),
|
|
540
|
+
rankRadarKeywordQuery(args)
|
|
541
|
+
);
|
|
542
|
+
}
|
|
543
|
+
};
|
|
544
|
+
|
|
545
|
+
// src/tools/get-rank-radar-ppc-data.ts
|
|
492
546
|
import { z as z8 } from "zod";
|
|
547
|
+
var inputSchema9 = {
|
|
548
|
+
...rankRadarKeywordQueryInputSchema,
|
|
549
|
+
includeCampaigns: z8.boolean().optional().describe(
|
|
550
|
+
"When true, each keyword also carries `campaigns`: the per-campaign/ad-group breakdown (campaign and ad group name, match type, targeting, spend, sales, clicks, impressions, orders, CPC, CTR, CVR, ACOS). Defaults to false; leave it off unless the user asks which campaigns drive a keyword."
|
|
551
|
+
)
|
|
552
|
+
};
|
|
553
|
+
var getRankRadarPpcDataTool = {
|
|
554
|
+
name: "get_rank_radar_ppc_data",
|
|
555
|
+
title: "Get PPC Data for a Rank Radar",
|
|
556
|
+
description: `Use this when the user asks about advertising (Sponsored Products) performance for the keywords of a Rank Radar. Requires startDate and endDate (yyyy-mm-dd), at most ${RANK_RADAR_MAX_DATE_RANGE_DAYS} days apart; 30 days or less keeps it fast. Each keyword's metrics are aggregated over the range: sponsoredRank (median; 101 means not in the top 100 sponsored results), impressionRank and impressionRankShare; how many exact, phrase, broad and auto campaigns target it; organicSales, ppcSales, ppcSpend, costPerClicks, clickThroughRate, conversionRate, totalClicks, totalImpressions, totalOrders and acos. Metrics are null or 0 when the seller runs no ads on a keyword. Set \`includeCampaigns\` for the per-campaign breakdown. ${RANK_RADAR_KEYWORD_PAGING_NOTE} Each call counts toward API usage and is rate limited (about 60 requests/minute). For the seller's campaigns as a whole, use \`list_ppc_campaigns\`. Use after \`list_rank_radars\` to discover a \`rankRadarId\`.`,
|
|
557
|
+
inputSchema: inputSchema9,
|
|
558
|
+
annotations: { readOnlyHint: true },
|
|
559
|
+
handler: async (args, ctx) => {
|
|
560
|
+
return await httpGet(
|
|
561
|
+
{ config: ctx.config, toolName: "get_rank_radar_ppc_data" },
|
|
562
|
+
rankRadarPath(args.rankRadarId, "ppc"),
|
|
563
|
+
{ ...rankRadarKeywordQuery(args), includeCampaigns: args.includeCampaigns }
|
|
564
|
+
);
|
|
565
|
+
}
|
|
566
|
+
};
|
|
567
|
+
|
|
568
|
+
// src/tools/create-rank-radar.ts
|
|
569
|
+
import { z as z9 } from "zod";
|
|
493
570
|
|
|
494
571
|
// src/tools/confirm.ts
|
|
495
572
|
function needsConfirmation(confirm, ctx) {
|
|
@@ -510,11 +587,11 @@ function requireConfirmation(confirm, ctx, costNote) {
|
|
|
510
587
|
|
|
511
588
|
// src/tools/create-rank-radar.ts
|
|
512
589
|
var PATH = "/v1/niches/rank-radars";
|
|
513
|
-
var
|
|
514
|
-
asin:
|
|
515
|
-
numberOfKeywords:
|
|
516
|
-
nicheId:
|
|
517
|
-
confirm:
|
|
590
|
+
var inputSchema10 = {
|
|
591
|
+
asin: z9.string().min(1).describe("The ASIN to track keyword rankings for."),
|
|
592
|
+
numberOfKeywords: z9.number().int().min(1).describe("How many keywords to track (minimum 1). More keywords = broader tracking but more Search Term tokens."),
|
|
593
|
+
nicheId: z9.string().min(1).describe("The niche this Rank Radar belongs to. Get one from `list_niches`."),
|
|
594
|
+
confirm: z9.boolean().optional().describe(
|
|
518
595
|
"Must be true to proceed \u2014 creating a Rank Radar spends Search Term tokens. Confirm the cost with the user first."
|
|
519
596
|
)
|
|
520
597
|
};
|
|
@@ -522,7 +599,7 @@ var createRankRadarTool = {
|
|
|
522
599
|
name: "create_rank_radar",
|
|
523
600
|
title: "Create a Rank Radar",
|
|
524
601
|
description: "Use this to start tracking organic and sponsored keyword rankings for an ASIN within a niche. \u26A0\uFE0F Spends Search Term tokens (cost scales with `numberOfKeywords`) and cannot be undone \u2014 set `confirm: true` only after the user approves the cost. Not safe to retry: each call spends tokens again and creates a separate Rank Radar \u2014 if a call errors or times out, check `list_rank_radars` instead of re-calling. The first call previews the creation and may return `warnings` alongside the cost note \u2014 for example that this product family is already tracked by another Rank Radar. Show every warning `message` to the user verbatim, before asking them to confirm; do not summarise it or decide on their behalf. A warning never blocks creation. Returns the new `rankRadarId`; read its data later with `get_rank_radar_data`. Requires `asin`, `numberOfKeywords` (min 1), and a `nicheId` from `list_niches`.",
|
|
525
|
-
inputSchema:
|
|
602
|
+
inputSchema: inputSchema10,
|
|
526
603
|
// destructiveHint is technically "additive" here (this creates a new Rank Radar, it
|
|
527
604
|
// doesn't destroy data), but we flag it destructive so clients prompt before the
|
|
528
605
|
// irreversible token spend. The confirm gate enforces this server-side regardless.
|
|
@@ -547,20 +624,20 @@ var createRankRadarTool = {
|
|
|
547
624
|
};
|
|
548
625
|
|
|
549
626
|
// src/tools/create-niche-dive.ts
|
|
550
|
-
import { z as
|
|
551
|
-
var
|
|
552
|
-
marketplace:
|
|
627
|
+
import { z as z10 } from "zod";
|
|
628
|
+
var inputSchema11 = {
|
|
629
|
+
marketplace: z10.enum(SUPPORTED_MARKETPLACES).describe(
|
|
553
630
|
"Amazon marketplace of the seed ASIN. Note these are full domain suffixes: com, ca, co.uk, com.mx, in, fr, de, es, it, co.jp (e.g. UK is `co.uk`, not `uk`)."
|
|
554
631
|
),
|
|
555
|
-
asin:
|
|
556
|
-
numberOfCompetitors:
|
|
557
|
-
confirm:
|
|
632
|
+
asin: z10.string().min(1).describe("The seed ASIN to start the dive from (e.g. B08N5WRWNW). Competitors are built around it."),
|
|
633
|
+
numberOfCompetitors: z10.number().int().min(2).describe("How many competitors to analyze (minimum 2). More competitors = deeper niche but more dive tokens."),
|
|
634
|
+
confirm: z10.boolean().optional().describe("Must be true to proceed \u2014 creating a dive spends dive tokens. Confirm the cost with the user first.")
|
|
558
635
|
};
|
|
559
636
|
var createNicheDiveTool = {
|
|
560
637
|
name: "create_niche_dive",
|
|
561
638
|
title: "Create a Niche Dive",
|
|
562
639
|
description: "Use this to start new niche research from a seed ASIN. \u26A0\uFE0F Spends dive tokens (cost scales with `numberOfCompetitors`) and cannot be undone \u2014 set `confirm: true` only after the user approves the cost. Not safe to retry: each call spends tokens again and starts a separate dive \u2014 if a call errors or times out, poll `get_dive_status` (or check `list_niches`) instead of re-calling. The dive runs asynchronously: this returns immediately with a `diveId` and an `estimatedCompletionDate`. Poll `get_dive_status` with that `diveId` until it reports `success` (which carries the new `nicheId` for use with `list_niches`, `get_niche_keywords`, etc.). Requires `marketplace`, `asin`, and `numberOfCompetitors` (min 2).",
|
|
563
|
-
inputSchema:
|
|
640
|
+
inputSchema: inputSchema11,
|
|
564
641
|
// destructiveHint is technically "additive" here (a dive creates a new niche, it
|
|
565
642
|
// doesn't destroy data), but we flag it destructive so clients prompt before the
|
|
566
643
|
// irreversible token spend. The confirm gate enforces this server-side regardless.
|
|
@@ -584,24 +661,65 @@ var createNicheDiveTool = {
|
|
|
584
661
|
}
|
|
585
662
|
};
|
|
586
663
|
|
|
664
|
+
// src/tools/create-niche-dive-from-competitors-list.ts
|
|
665
|
+
import { z as z11 } from "zod";
|
|
666
|
+
var DIVE_FROM_COMPETITORS_MIN_ASINS = 2;
|
|
667
|
+
var DIVE_FROM_COMPETITORS_MAX_ASINS = 200;
|
|
668
|
+
var normalizedAsins = z11.array(z11.string().trim().min(1).toUpperCase()).min(DIVE_FROM_COMPETITORS_MIN_ASINS).max(DIVE_FROM_COMPETITORS_MAX_ASINS).refine((asins) => new Set(asins).size === asins.length, {
|
|
669
|
+
message: "asins must not contain the same ASIN twice"
|
|
670
|
+
});
|
|
671
|
+
var inputSchema12 = {
|
|
672
|
+
marketplace: z11.enum(SUPPORTED_MARKETPLACES).describe(
|
|
673
|
+
"Amazon marketplace where the ASINs are listed. Full domain suffixes: com, ca, co.uk, com.mx, in, fr, de, es, it, co.jp (e.g. UK is `co.uk`, not `uk`)."
|
|
674
|
+
),
|
|
675
|
+
asins: normalizedAsins.describe(
|
|
676
|
+
`The exact competitor ASINs to build the niche from, ${DIVE_FROM_COMPETITORS_MIN_ASINS} to ${DIVE_FROM_COMPETITORS_MAX_ASINS}, each once. No other competitors are added.`
|
|
677
|
+
),
|
|
678
|
+
confirm: z11.boolean().optional().describe(
|
|
679
|
+
"Must be true to proceed \u2014 this dive spends dive tokens for every ASIN. Confirm the cost with the user first."
|
|
680
|
+
)
|
|
681
|
+
};
|
|
682
|
+
var createNicheDiveFromCompetitorsListTool = {
|
|
683
|
+
name: "create_niche_dive_from_competitors_list",
|
|
684
|
+
title: "Create a Niche Dive from a Competitor List",
|
|
685
|
+
description: `Use this when the user already knows which products belong in the niche \u2014 e.g. they list competitor ASINs, or picked them from search results \u2014 and wants niche research on exactly those. Unlike \`create_niche_dive\`, which discovers competitors around one seed ASIN, this builds the niche from the given ASINs only (${DIVE_FROM_COMPETITORS_MIN_ASINS}-${DIVE_FROM_COMPETITORS_MAX_ASINS}). \u26A0\uFE0F Spends dive tokens for every ASIN and cannot be undone \u2014 set \`confirm: true\` only after the user approves the cost. Not safe to retry: each call spends tokens again and starts a separate dive \u2014 if a call errors or times out, poll \`get_dive_status\` (or check \`list_niches\`) instead of re-calling. Fails without spending tokens when the ASIN count is over the plan's limit, when the account is at its niche limit, or when Amazon product data cannot be found for enough of the ASINs. The dive runs asynchronously: this returns a \`diveId\` and an \`estimatedCompletionDate\`; poll \`get_dive_status\` with the \`diveId\` until it reports \`success\`, which carries the new \`nicheId\`.`,
|
|
686
|
+
inputSchema: inputSchema12,
|
|
687
|
+
// Additive rather than destructive, but flagged destructive so clients prompt before the
|
|
688
|
+
// irreversible token spend — same reasoning as create_niche_dive. The confirm gate enforces it.
|
|
689
|
+
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: false },
|
|
690
|
+
handler: async (args, ctx) => {
|
|
691
|
+
const pending = requireConfirmation(
|
|
692
|
+
args.confirm,
|
|
693
|
+
ctx,
|
|
694
|
+
`Creating this dive consumes dive tokens \u2014 one batch per ASIN analyzed (${args.asins.length} ASINs given).`
|
|
695
|
+
);
|
|
696
|
+
if (pending) return pending;
|
|
697
|
+
return await httpPost(
|
|
698
|
+
{ config: ctx.config, toolName: "create_niche_dive_from_competitors_list" },
|
|
699
|
+
"/v1/niches/dive_with_competitors",
|
|
700
|
+
{ marketplace: args.marketplace, asins: args.asins }
|
|
701
|
+
);
|
|
702
|
+
}
|
|
703
|
+
};
|
|
704
|
+
|
|
587
705
|
// src/tools/redive-niche.ts
|
|
588
|
-
import { z as
|
|
589
|
-
var
|
|
590
|
-
nicheId:
|
|
591
|
-
mode:
|
|
706
|
+
import { z as z12 } from "zod";
|
|
707
|
+
var inputSchema13 = {
|
|
708
|
+
nicheId: z12.string().min(1).describe("The niche to re-dive. Get one from `list_niches`."),
|
|
709
|
+
mode: z12.enum(["same_competitors", "discover"]).describe(
|
|
592
710
|
"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."
|
|
593
711
|
),
|
|
594
|
-
numberOfCompetitors:
|
|
712
|
+
numberOfCompetitors: z12.number().int().min(2).optional().describe(
|
|
595
713
|
"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."
|
|
596
714
|
),
|
|
597
|
-
heroAsin:
|
|
715
|
+
heroAsin: z12.string().min(1).optional().describe(
|
|
598
716
|
"`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."
|
|
599
717
|
),
|
|
600
|
-
lockedAsins:
|
|
718
|
+
lockedAsins: z12.array(z12.string().min(1)).optional().describe(
|
|
601
719
|
"`discover` mode only. ASINs that must stay in the competitor set regardless of what discovery finds. Cannot exceed `numberOfCompetitors`, and cannot overlap `excludedAsins`."
|
|
602
720
|
),
|
|
603
|
-
excludedAsins:
|
|
604
|
-
confirm:
|
|
721
|
+
excludedAsins: z12.array(z12.string().min(1)).optional().describe("`discover` mode only. ASINs discovery must never select."),
|
|
722
|
+
confirm: z12.boolean().optional().describe(
|
|
605
723
|
"Must be true to proceed \u2014 a re-dive spends dive tokens. Confirm the cost with the user first."
|
|
606
724
|
)
|
|
607
725
|
};
|
|
@@ -609,7 +727,7 @@ var rediveNicheTool = {
|
|
|
609
727
|
name: "redive_niche",
|
|
610
728
|
title: "Re-dive an Existing Niche",
|
|
611
729
|
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. Not safe to retry: each call spends tokens again and starts a separate re-dive \u2014 if a call errors or times out, poll `get_dive_status` instead of re-calling. 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.",
|
|
612
|
-
inputSchema:
|
|
730
|
+
inputSchema: inputSchema13,
|
|
613
731
|
// Same reasoning as create_niche_dive: a re-dive is additive rather than destructive, but the
|
|
614
732
|
// irreversible token spend is what clients need to prompt on. The confirm gate enforces it regardless.
|
|
615
733
|
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: false },
|
|
@@ -642,15 +760,17 @@ var rediveNicheTool = {
|
|
|
642
760
|
};
|
|
643
761
|
|
|
644
762
|
// src/tools/get-dive-status.ts
|
|
645
|
-
import { z as
|
|
646
|
-
var
|
|
647
|
-
diveId:
|
|
763
|
+
import { z as z13 } from "zod";
|
|
764
|
+
var inputSchema14 = {
|
|
765
|
+
diveId: z13.string().min(1).describe(
|
|
766
|
+
"The dive identifier returned by `create_niche_dive`, `create_niche_dive_from_competitors_list` or `redive_niche`."
|
|
767
|
+
)
|
|
648
768
|
};
|
|
649
769
|
var getDiveStatusTool = {
|
|
650
770
|
name: "get_dive_status",
|
|
651
771
|
title: "Get Niche Dive Status",
|
|
652
|
-
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.",
|
|
653
|
-
inputSchema:
|
|
772
|
+
description: "Use this to poll a niche dive started with `create_niche_dive`, `create_niche_dive_from_competitors_list` 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.",
|
|
773
|
+
inputSchema: inputSchema14,
|
|
654
774
|
annotations: { readOnlyHint: true },
|
|
655
775
|
handler: async (args, ctx) => {
|
|
656
776
|
return await httpGet(
|
|
@@ -661,10 +781,10 @@ var getDiveStatusTool = {
|
|
|
661
781
|
};
|
|
662
782
|
|
|
663
783
|
// src/tools/delete-niche.ts
|
|
664
|
-
import { z as
|
|
665
|
-
var
|
|
666
|
-
nicheId:
|
|
667
|
-
confirm:
|
|
784
|
+
import { z as z14 } from "zod";
|
|
785
|
+
var inputSchema15 = {
|
|
786
|
+
nicheId: z14.string().min(1).describe("The niche to delete. Get one from `list_niches`."),
|
|
787
|
+
confirm: z14.boolean().optional().describe(
|
|
668
788
|
"Must be true to proceed \u2014 deleting a niche destroys its keywords, competitors and dive history permanently. Confirm with the user first."
|
|
669
789
|
)
|
|
670
790
|
};
|
|
@@ -672,7 +792,7 @@ var deleteNicheTool = {
|
|
|
672
792
|
name: "delete_niche",
|
|
673
793
|
title: "Delete a Niche",
|
|
674
794
|
description: "Use this to permanently remove a niche the user no longer needs. \u26A0\uFE0F Deletes the niche and everything attached to it \u2014 keywords, competitors, all dives and diveboxes \u2014 and cannot be undone; the dive tokens already spent on it are NOT refunded. Set `confirm: true` only after the user approves. A niche used by any Rank Radar cannot be deleted: the call fails with a conflict, so delete or archive those rank radars first (`list_rank_radars` with the `nicheId` filter shows them).",
|
|
675
|
-
inputSchema:
|
|
795
|
+
inputSchema: inputSchema15,
|
|
676
796
|
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: false },
|
|
677
797
|
handler: async (args, ctx) => {
|
|
678
798
|
const pending = requireConfirmation(
|
|
@@ -690,15 +810,15 @@ var deleteNicheTool = {
|
|
|
690
810
|
};
|
|
691
811
|
|
|
692
812
|
// src/tools/pause-rank-radar.ts
|
|
693
|
-
import { z as
|
|
694
|
-
var
|
|
695
|
-
rankRadarId:
|
|
813
|
+
import { z as z15 } from "zod";
|
|
814
|
+
var inputSchema16 = {
|
|
815
|
+
rankRadarId: z15.string().uuid().describe("The Rank Radar UUID to pause (from `list_rank_radars`).")
|
|
696
816
|
};
|
|
697
817
|
var pauseRankRadarTool = {
|
|
698
818
|
name: "pause_rank_radar",
|
|
699
819
|
title: "Pause a Rank Radar",
|
|
700
820
|
description: "Use this to pause tracking on a Rank Radar without losing anything \u2014 the action the DataDive API calls 'archiving', so when a user asks to archive a Rank Radar, this is the tool they mean. Tracking stops for all of its keywords and the Daily Tracked Keywords quota they held is freed for other Rank Radars, while the Rank Radar and its ranking history are kept. Fully reversible with `resume_rank_radar`, so it needs no `confirm` \u2014 prefer it over `delete_rank_radar` whenever the user may want the data back. Paused Rank Radars show up in `list_rank_radars` under `status: PAUSED` \u2014 not `ARCHIVED`, which covers Rank Radars removed with `delete_rank_radar`. Safe to repeat: pausing an already paused Rank Radar succeeds and changes nothing.",
|
|
701
|
-
inputSchema:
|
|
821
|
+
inputSchema: inputSchema16,
|
|
702
822
|
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: false },
|
|
703
823
|
handler: async (args, ctx) => {
|
|
704
824
|
await httpPost(
|
|
@@ -711,15 +831,15 @@ var pauseRankRadarTool = {
|
|
|
711
831
|
};
|
|
712
832
|
|
|
713
833
|
// src/tools/resume-rank-radar.ts
|
|
714
|
-
import { z as
|
|
715
|
-
var
|
|
716
|
-
rankRadarId:
|
|
834
|
+
import { z as z16 } from "zod";
|
|
835
|
+
var inputSchema17 = {
|
|
836
|
+
rankRadarId: z16.string().uuid().describe("The Rank Radar UUID to resume (from `list_rank_radars`).")
|
|
717
837
|
};
|
|
718
838
|
var resumeRankRadarTool = {
|
|
719
839
|
name: "resume_rank_radar",
|
|
720
840
|
title: "Resume a Paused Rank Radar",
|
|
721
841
|
description: "Use this to restart tracking on a Rank Radar that was paused with `pause_rank_radar` (shown by `list_rank_radars` under `status: PAUSED`; a deleted, `ARCHIVED` one cannot be resumed). Keywords are resumed as far as the available Daily Tracked Keywords quota allows, most relevant first \u2014 so with a tight quota only part of the original keyword set comes back; check `get_quota` first if that matters. Reversible with `pause_rank_radar`, so it needs no `confirm`. Fails with a bad-request error when there is no quota left at all. Safe to repeat: resuming an already active Rank Radar changes nothing.",
|
|
722
|
-
inputSchema:
|
|
842
|
+
inputSchema: inputSchema17,
|
|
723
843
|
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: false },
|
|
724
844
|
handler: async (args, ctx) => {
|
|
725
845
|
await httpPost(
|
|
@@ -732,10 +852,10 @@ var resumeRankRadarTool = {
|
|
|
732
852
|
};
|
|
733
853
|
|
|
734
854
|
// src/tools/delete-rank-radar.ts
|
|
735
|
-
import { z as
|
|
736
|
-
var
|
|
737
|
-
rankRadarId:
|
|
738
|
-
confirm:
|
|
855
|
+
import { z as z17 } from "zod";
|
|
856
|
+
var inputSchema18 = {
|
|
857
|
+
rankRadarId: z17.string().uuid().describe("The Rank Radar UUID to delete (from `list_rank_radars`)."),
|
|
858
|
+
confirm: z17.boolean().optional().describe(
|
|
739
859
|
"Must be true to proceed \u2014 deleting a Rank Radar destroys its ranking history permanently. Confirm with the user first."
|
|
740
860
|
)
|
|
741
861
|
};
|
|
@@ -743,7 +863,7 @@ var deleteRankRadarTool = {
|
|
|
743
863
|
name: "delete_rank_radar",
|
|
744
864
|
title: "Delete a Rank Radar",
|
|
745
865
|
description: "Use this to permanently remove a Rank Radar and all of its keyword ranking history. \u26A0\uFE0F Cannot be undone \u2014 there is no restore endpoint; set `confirm: true` only after the user approves. It does free the Daily Tracked Keywords quota those keywords held. Deleted Rank Radars are what `list_rank_radars` returns for `status: ARCHIVED`. If the user only wants to stop tracking for a while and keep the history \u2014 or asks to 'archive' the Rank Radar, which is what the DataDive API calls pausing \u2014 use `pause_rank_radar` instead: it frees the same quota and is reversible with `resume_rank_radar`.",
|
|
746
|
-
inputSchema:
|
|
866
|
+
inputSchema: inputSchema18,
|
|
747
867
|
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: false },
|
|
748
868
|
handler: async (args, ctx) => {
|
|
749
869
|
const pending = requireConfirmation(
|
|
@@ -761,10 +881,10 @@ var deleteRankRadarTool = {
|
|
|
761
881
|
};
|
|
762
882
|
|
|
763
883
|
// src/tools/add-rank-radar-search-terms.ts
|
|
764
|
-
import { z as
|
|
765
|
-
var
|
|
766
|
-
rankRadarId:
|
|
767
|
-
searchTerms:
|
|
884
|
+
import { z as z18 } from "zod";
|
|
885
|
+
var inputSchema19 = {
|
|
886
|
+
rankRadarId: z18.string().uuid().describe("The Rank Radar UUID to add the search terms to (from `list_rank_radars`)."),
|
|
887
|
+
searchTerms: z18.array(z18.string().min(1)).min(1).max(ADD_SEARCH_TERMS_MAX).describe(
|
|
768
888
|
`The keywords to start tracking, 1\u2013${ADD_SEARCH_TERMS_MAX} per call. Must be unique. Amazon-ignored special characters (@, #, _, parentheses, \u2026) are rejected.`
|
|
769
889
|
)
|
|
770
890
|
};
|
|
@@ -772,7 +892,7 @@ var addRankRadarSearchTermsTool = {
|
|
|
772
892
|
name: "add_rank_radar_search_terms",
|
|
773
893
|
title: "Add Search Terms to a Rank Radar",
|
|
774
894
|
description: "Use this to start tracking extra keywords on an existing Rank Radar, instead of creating a new one with `create_rank_radar`. New keywords are added to the niche and tracked from now on; any matching keyword that was previously paused is resumed. Each newly tracked keyword takes one Daily Tracked Keywords slot, and the call fails if the quota is exhausted \u2014 check `get_quota` first. Reversible with `pause_rank_radar_search_terms`, which frees the slots again, so it needs no `confirm`. Returns `originBreakdown` (where each submitted term ended up) and `keywordToRankRadarKeywordIdMap`, whose ids are what the pause/resume search-term tools take.",
|
|
775
|
-
inputSchema:
|
|
895
|
+
inputSchema: inputSchema19,
|
|
776
896
|
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: false },
|
|
777
897
|
handler: async (args, ctx) => {
|
|
778
898
|
return await httpPost(
|
|
@@ -784,10 +904,10 @@ var addRankRadarSearchTermsTool = {
|
|
|
784
904
|
};
|
|
785
905
|
|
|
786
906
|
// src/tools/pause-rank-radar-search-terms.ts
|
|
787
|
-
import { z as
|
|
788
|
-
var
|
|
789
|
-
rankRadarId:
|
|
790
|
-
rankRadarKeywordIds:
|
|
907
|
+
import { z as z19 } from "zod";
|
|
908
|
+
var inputSchema20 = {
|
|
909
|
+
rankRadarId: z19.string().uuid().describe("The Rank Radar UUID the search terms belong to."),
|
|
910
|
+
rankRadarKeywordIds: z19.array(z19.string().uuid()).min(1).describe(
|
|
791
911
|
"The Rank Radar keyword ids to pause. These are the `id` values from `get_rank_radar_data`, or the values of `keywordToRankRadarKeywordIdMap` returned by `add_rank_radar_search_terms` \u2014 not the keyword text."
|
|
792
912
|
)
|
|
793
913
|
};
|
|
@@ -795,7 +915,7 @@ var pauseRankRadarSearchTermsTool = {
|
|
|
795
915
|
name: "pause_rank_radar_search_terms",
|
|
796
916
|
title: "Pause Search Terms of a Rank Radar",
|
|
797
917
|
description: "Use this to stop tracking individual keywords on a Rank Radar while keeping the Rank Radar itself active \u2014 the way to trim a keyword set the user finds too broad. The DataDive API calls this 'archiving' the search terms; nothing is lost. The paused keywords keep their history and their Daily Tracked Keywords slots are freed for other keywords. Reversible with `resume_rank_radar_search_terms`, so it needs no `confirm`. Takes keyword ids, not keyword text: get them from `get_rank_radar_data`. Safe to repeat: already-paused terms are left unchanged.",
|
|
798
|
-
inputSchema:
|
|
918
|
+
inputSchema: inputSchema20,
|
|
799
919
|
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: false },
|
|
800
920
|
handler: async (args, ctx) => {
|
|
801
921
|
await httpPost(
|
|
@@ -812,10 +932,10 @@ var pauseRankRadarSearchTermsTool = {
|
|
|
812
932
|
};
|
|
813
933
|
|
|
814
934
|
// src/tools/resume-rank-radar-search-terms.ts
|
|
815
|
-
import { z as
|
|
816
|
-
var
|
|
817
|
-
rankRadarId:
|
|
818
|
-
rankRadarKeywordIds:
|
|
935
|
+
import { z as z20 } from "zod";
|
|
936
|
+
var inputSchema21 = {
|
|
937
|
+
rankRadarId: z20.string().uuid().describe("The Rank Radar UUID the search terms belong to."),
|
|
938
|
+
rankRadarKeywordIds: z20.array(z20.string().uuid()).min(1).describe(
|
|
819
939
|
"The Rank Radar keyword ids to resume. These are the `id` values from `get_rank_radar_data`, or the values of `keywordToRankRadarKeywordIdMap` returned by `add_rank_radar_search_terms` \u2014 not the keyword text."
|
|
820
940
|
)
|
|
821
941
|
};
|
|
@@ -823,7 +943,7 @@ var resumeRankRadarSearchTermsTool = {
|
|
|
823
943
|
name: "resume_rank_radar_search_terms",
|
|
824
944
|
title: "Resume Paused Search Terms of a Rank Radar",
|
|
825
945
|
description: "Use this to start tracking keywords again that were paused with `pause_rank_radar_search_terms`. Each resumed keyword takes back one Daily Tracked Keywords slot, and the call fails if the quota is exhausted \u2014 check `get_quota` first. Reversible with `pause_rank_radar_search_terms`, so it needs no `confirm`. Takes keyword ids, not keyword text: get them from `get_rank_radar_data`. Safe to repeat: already-active terms are left unchanged.",
|
|
826
|
-
inputSchema:
|
|
946
|
+
inputSchema: inputSchema21,
|
|
827
947
|
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: false },
|
|
828
948
|
handler: async (args, ctx) => {
|
|
829
949
|
await httpPost(
|
|
@@ -840,16 +960,16 @@ var resumeRankRadarSearchTermsTool = {
|
|
|
840
960
|
};
|
|
841
961
|
|
|
842
962
|
// src/tools/generate-listing-copy.ts
|
|
843
|
-
import { z as
|
|
844
|
-
var
|
|
845
|
-
nicheId:
|
|
846
|
-
strategy:
|
|
963
|
+
import { z as z21 } from "zod";
|
|
964
|
+
var inputSchema22 = {
|
|
965
|
+
nicheId: z21.string().min(1).describe("The niche whose keyword data the copy is written from. Get one from `list_niches`."),
|
|
966
|
+
strategy: z21.enum(LISTING_COPY_STRATEGIES).describe(
|
|
847
967
|
"Which generation strategy to use. `cosmo` targets Amazon's COSMO relevance model, `ranking-juice` optimises for DataDive's ranking-juice score, `nlp` writes for keyword coverage, and `cosmo-rufus` targets COSMO plus the Rufus shopping assistant. Ask the user if they have no preference."
|
|
848
968
|
),
|
|
849
|
-
currentListing:
|
|
969
|
+
currentListing: z21.record(z21.union([z21.string(), z21.array(z21.string())])).describe(
|
|
850
970
|
'The seller\'s existing listing to rewrite, as an object \u2014 e.g. `{ "title": "...", "description": "...", "bullets": ["...", "..."] }`. Pass what the user has; it is the starting point the generated copy builds on.'
|
|
851
971
|
),
|
|
852
|
-
confirm:
|
|
972
|
+
confirm: z21.boolean().optional().describe(
|
|
853
973
|
"Must be true to proceed \u2014 each generation spends one AI Copywriter prompt from the quota. Confirm the cost with the user first."
|
|
854
974
|
)
|
|
855
975
|
};
|
|
@@ -857,7 +977,7 @@ var generateListingCopyTool = {
|
|
|
857
977
|
name: "generate_listing_copy",
|
|
858
978
|
title: "Generate Listing Copy for a Niche",
|
|
859
979
|
description: "Use this to draft an optimised Amazon listing \u2014 title, bullets and description \u2014 from a niche's keyword research and the seller's current listing. It writes text only: nothing is published to Amazon, and the user still has to paste the result into Seller Central. \u26A0\uFE0F Spends one AI Copywriter prompt from the quota per call and cannot be undone \u2014 set `confirm: true` only after the user approves. Not safe to retry: each call spends another prompt, so if a call errors or times out, poll `get_listing_copy_generation_status` instead of re-calling. Runs asynchronously: returns a `generationId` \u2014 poll `get_listing_copy_generation_status` with it until the status is `complete`.",
|
|
860
|
-
inputSchema:
|
|
980
|
+
inputSchema: inputSchema22,
|
|
861
981
|
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: false },
|
|
862
982
|
handler: async (args, ctx) => {
|
|
863
983
|
const pending = requireConfirmation(
|
|
@@ -875,16 +995,16 @@ var generateListingCopyTool = {
|
|
|
875
995
|
};
|
|
876
996
|
|
|
877
997
|
// src/tools/get-listing-copy-generation-status.ts
|
|
878
|
-
import { z as
|
|
879
|
-
var
|
|
880
|
-
nicheId:
|
|
881
|
-
generationId:
|
|
998
|
+
import { z as z22 } from "zod";
|
|
999
|
+
var inputSchema23 = {
|
|
1000
|
+
nicheId: z22.string().min(1).describe("The niche the generation was started for."),
|
|
1001
|
+
generationId: z22.string().min(1).describe("The `generationId` returned by `generate_listing_copy`.")
|
|
882
1002
|
};
|
|
883
1003
|
var getListingCopyGenerationStatusTool = {
|
|
884
1004
|
name: "get_listing_copy_generation_status",
|
|
885
1005
|
title: "Get Listing Copy Generation Status",
|
|
886
1006
|
description: "Use this to poll a listing-copy draft started with `generate_listing_copy` until it finishes. Returns one of three shapes keyed by `status`: `generating` (still running \u2014 poll again in a few seconds), `complete` (with `result`, carrying the generated `title`, `bullets`, `description`, `itemHighlights` and its `rankingJuice` score), or `failed` (with an `error` message). Polling is free \u2014 it does not spend another AI Copywriter prompt, so always poll rather than re-calling `generate_listing_copy`.",
|
|
887
|
-
inputSchema:
|
|
1007
|
+
inputSchema: inputSchema23,
|
|
888
1008
|
annotations: { readOnlyHint: true },
|
|
889
1009
|
handler: async (args, ctx) => {
|
|
890
1010
|
return await httpGet(
|
|
@@ -895,16 +1015,16 @@ var getListingCopyGenerationStatusTool = {
|
|
|
895
1015
|
};
|
|
896
1016
|
|
|
897
1017
|
// src/tools/list-seller-profiles.ts
|
|
898
|
-
import { z as
|
|
899
|
-
var
|
|
900
|
-
currentPage:
|
|
901
|
-
pageSize:
|
|
1018
|
+
import { z as z23 } from "zod";
|
|
1019
|
+
var inputSchema24 = {
|
|
1020
|
+
currentPage: z23.number().int().min(1).optional().describe("Page number, 1-indexed. Defaults to 1."),
|
|
1021
|
+
pageSize: z23.number().int().min(1).max(50).optional().describe("Items per page (max 50). Defaults to 20.")
|
|
902
1022
|
};
|
|
903
1023
|
var listSellerProfilesTool = {
|
|
904
1024
|
name: "list_seller_profiles",
|
|
905
1025
|
title: "List Connected Amazon Seller Profiles",
|
|
906
1026
|
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).',
|
|
907
|
-
inputSchema:
|
|
1027
|
+
inputSchema: inputSchema24,
|
|
908
1028
|
annotations: { readOnlyHint: true },
|
|
909
1029
|
handler: async (args, ctx) => {
|
|
910
1030
|
return await httpGet(
|
|
@@ -919,15 +1039,15 @@ var listSellerProfilesTool = {
|
|
|
919
1039
|
};
|
|
920
1040
|
|
|
921
1041
|
// src/tools/get-seller-catalog.ts
|
|
922
|
-
import { z as
|
|
1042
|
+
import { z as z25 } from "zod";
|
|
923
1043
|
|
|
924
1044
|
// src/tools/seller-scoped.ts
|
|
925
|
-
import { z as
|
|
1045
|
+
import { z as z24 } from "zod";
|
|
926
1046
|
var sellerScopedInputSchema = {
|
|
927
|
-
sellerId:
|
|
1047
|
+
sellerId: z24.string().min(1).describe(
|
|
928
1048
|
"Amazon seller account ID. Get it from `list_seller_profiles`, or find it on the Connections page at https://2.datadive.tools."
|
|
929
1049
|
),
|
|
930
|
-
marketplace:
|
|
1050
|
+
marketplace: z24.enum(SUPPORTED_MARKETPLACES).describe('Amazon marketplace code, e.g. "com" for amazon.com or "co.uk" for amazon.co.uk.')
|
|
931
1051
|
};
|
|
932
1052
|
function sellerMarketplacePath(sellerId, marketplace, suffix) {
|
|
933
1053
|
return `/v1/seller_profiles/${encodeURIComponent(sellerId)}/marketplaces/${encodeURIComponent(
|
|
@@ -936,19 +1056,19 @@ function sellerMarketplacePath(sellerId, marketplace, suffix) {
|
|
|
936
1056
|
}
|
|
937
1057
|
|
|
938
1058
|
// src/tools/get-seller-catalog.ts
|
|
939
|
-
var
|
|
1059
|
+
var inputSchema25 = {
|
|
940
1060
|
...sellerScopedInputSchema,
|
|
941
|
-
search:
|
|
942
|
-
brand:
|
|
943
|
-
status:
|
|
944
|
-
currentPage:
|
|
945
|
-
pageSize:
|
|
1061
|
+
search: z25.string().min(1).optional().describe("Case-insensitive partial match on product title or brand."),
|
|
1062
|
+
brand: z25.string().min(1).optional().describe("Case-insensitive partial match on brand name."),
|
|
1063
|
+
status: z25.enum(CATALOG_STATUSES).optional().describe('Listing status filter. "Active" (default) or "all".'),
|
|
1064
|
+
currentPage: z25.number().int().min(1).optional().describe("Page number, 1-indexed. Defaults to 1."),
|
|
1065
|
+
pageSize: z25.number().int().min(1).max(50).optional().describe("Items per page (max 50). Defaults to 20.")
|
|
946
1066
|
};
|
|
947
1067
|
var getSellerCatalogTool = {
|
|
948
1068
|
name: "get_seller_catalog",
|
|
949
1069
|
title: "List Catalog ASINs for a Seller",
|
|
950
1070
|
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).",
|
|
951
|
-
inputSchema:
|
|
1071
|
+
inputSchema: inputSchema25,
|
|
952
1072
|
annotations: { readOnlyHint: true },
|
|
953
1073
|
handler: async (args, ctx) => {
|
|
954
1074
|
return await httpGet(
|
|
@@ -966,28 +1086,28 @@ var getSellerCatalogTool = {
|
|
|
966
1086
|
};
|
|
967
1087
|
|
|
968
1088
|
// src/tools/get-seller-listing-changes.ts
|
|
969
|
-
import { z as
|
|
970
|
-
var
|
|
1089
|
+
import { z as z26 } from "zod";
|
|
1090
|
+
var inputSchema26 = {
|
|
971
1091
|
...sellerScopedInputSchema,
|
|
972
|
-
types:
|
|
973
|
-
asin:
|
|
974
|
-
brand:
|
|
975
|
-
search:
|
|
976
|
-
startDate:
|
|
977
|
-
endDate:
|
|
978
|
-
sortBy:
|
|
979
|
-
sortOrder:
|
|
980
|
-
includeCorrelations:
|
|
1092
|
+
types: z26.array(z26.enum(LISTING_CHANGE_TYPES)).min(1).optional().describe('Filter to specific change types. Omit for all. Any of "Price", "Content", "Image".'),
|
|
1093
|
+
asin: z26.string().min(1).optional().describe("Filter to an exact ASIN or parent ASIN."),
|
|
1094
|
+
brand: z26.string().min(1).optional().describe("Case-insensitive partial match on brand name."),
|
|
1095
|
+
search: z26.string().min(1).optional().describe("Case-insensitive partial match on product title or brand."),
|
|
1096
|
+
startDate: z26.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."),
|
|
1097
|
+
endDate: z26.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."),
|
|
1098
|
+
sortBy: z26.enum(LISTING_CHANGE_SORT_BY).optional().describe('Sort field. "date" (default) or "type".'),
|
|
1099
|
+
sortOrder: z26.enum(SORT_ORDER).optional().describe('Sort direction. "DESC" (default) or "ASC".'),
|
|
1100
|
+
includeCorrelations: z26.boolean().optional().describe(
|
|
981
1101
|
"When true, include the ranking/conversion `correlation` object per change (CVR and search-term movement before vs after). Defaults to false."
|
|
982
1102
|
),
|
|
983
|
-
currentPage:
|
|
984
|
-
pageSize:
|
|
1103
|
+
currentPage: z26.number().int().min(1).optional().describe("Page number, 1-indexed. Defaults to 1."),
|
|
1104
|
+
pageSize: z26.number().int().min(1).max(50).optional().describe("Items per page (max 50). Defaults to 20.")
|
|
985
1105
|
};
|
|
986
1106
|
var getSellerListingChangesTool = {
|
|
987
1107
|
name: "get_seller_listing_changes",
|
|
988
1108
|
title: "List Listing Changes for a Seller",
|
|
989
1109
|
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).",
|
|
990
|
-
inputSchema:
|
|
1110
|
+
inputSchema: inputSchema26,
|
|
991
1111
|
annotations: { readOnlyHint: true },
|
|
992
1112
|
handler: async (args, ctx) => {
|
|
993
1113
|
return await httpGet(
|
|
@@ -1011,14 +1131,78 @@ var getSellerListingChangesTool = {
|
|
|
1011
1131
|
}
|
|
1012
1132
|
};
|
|
1013
1133
|
|
|
1134
|
+
// src/tools/list-ppc-campaigns.ts
|
|
1135
|
+
import { z as z27 } from "zod";
|
|
1136
|
+
var PPC_CAMPAIGNS_MAX_WINDOW_DAYS = 90;
|
|
1137
|
+
var PPC_CAMPAIGNS_MAX_PAGE_SIZE = 50;
|
|
1138
|
+
var inputSchema27 = {
|
|
1139
|
+
...sellerScopedInputSchema,
|
|
1140
|
+
startDate: z27.string().regex(
|
|
1141
|
+
ISO_8601,
|
|
1142
|
+
"startDate must be an ISO-8601 date or timestamp (e.g. 2026-05-01 or 2026-05-01T00:00:00Z)"
|
|
1143
|
+
).optional().describe("Start of the reporting window, ISO-8601. Defaults to 30 days before endDate."),
|
|
1144
|
+
endDate: z27.string().regex(
|
|
1145
|
+
ISO_8601,
|
|
1146
|
+
"endDate must be an ISO-8601 date or timestamp (e.g. 2026-05-31 or 2026-05-31T23:59:59Z)"
|
|
1147
|
+
).optional().describe(
|
|
1148
|
+
`End of the reporting window, ISO-8601. Defaults to now. At most ${PPC_CAMPAIGNS_MAX_WINDOW_DAYS} days after startDate.`
|
|
1149
|
+
),
|
|
1150
|
+
asin: z27.string().min(1).optional().describe("Only campaigns advertising this ASIN. Cannot be combined with parentAsin."),
|
|
1151
|
+
parentAsin: z27.string().min(1).optional().describe("Only campaigns advertising any ASIN of this variation family. Cannot be combined with asin."),
|
|
1152
|
+
search: z27.string().min(3).max(200).optional().describe("Partial match on campaign name or advertised ASIN. At least 3 characters."),
|
|
1153
|
+
includePlacements: z27.boolean().optional().describe(
|
|
1154
|
+
"Include the per-placement breakdown (topOfSearch, restOfSearch, productPage, offAmazon, each with its bid adjustment). Defaults to true; set false for a smaller response when placements are not needed."
|
|
1155
|
+
),
|
|
1156
|
+
sortBy: z27.enum([...PPC_CAMPAIGN_BASE_SORT_BY, ...PPC_CAMPAIGN_PLACEMENT_SORT_BY]).optional().describe(
|
|
1157
|
+
`Sort field. Defaults to "name". Any of ${PPC_CAMPAIGN_BASE_SORT_BY.join(", ")}. The placement fields (e.g. "tosSpend", "tosAcos", "ppBidAdjustment") are only accepted when includePlacements is not false.`
|
|
1158
|
+
),
|
|
1159
|
+
sortOrder: z27.enum(SORT_ORDER).optional().describe('Sort direction. "ASC" (default) or "DESC".'),
|
|
1160
|
+
state: z27.enum(PPC_CAMPAIGN_STATES).optional().describe("Only ENABLED or only PAUSED campaigns. Omit for both."),
|
|
1161
|
+
currentPage: z27.number().int().min(1).optional().describe("Page number, 1-indexed. Defaults to 1."),
|
|
1162
|
+
pageSize: z27.number().int().min(1).max(PPC_CAMPAIGNS_MAX_PAGE_SIZE).optional().describe(`Campaigns per page (max ${PPC_CAMPAIGNS_MAX_PAGE_SIZE}). Defaults to 20.`)
|
|
1163
|
+
};
|
|
1164
|
+
var listPpcCampaignsTool = {
|
|
1165
|
+
name: "list_ppc_campaigns",
|
|
1166
|
+
title: "List PPC Campaigns for a Seller",
|
|
1167
|
+
description: `Use this when the user asks about their Sponsored Products campaigns \u2014 which campaigns spend the most, which have a high ACOS, how placements (top of search, rest of search, product pages) perform, or which campaigns advertise a given product. Requires a \`sellerId\` + \`marketplace\` (use \`list_seller_profiles\` to discover them). Narrow to one product with \`asin\`, or to a variation family with \`parentAsin\` (not both). The reporting window defaults to the last 30 days and cannot exceed ${PPC_CAMPAIGNS_MAX_WINDOW_DAYS} days. Returns a paginated list where each campaign has campaignId, name, type, state, targetingType, bidStrategy, budget { type, amount, currencyCode }, window totals (impressions, clicks, ctr, cpc, cvr, spend, unitsSold, orders, sales, tosImpressionShare, acos, roas, tacos), asinCount and, unless includePlacements is false, \`placements\`; plus pagination metadata (currentPage, pageSize, total, lastPage, hasNext, hasPrev). To find the biggest spenders, sort with \`sortBy: "spend", sortOrder: "DESC"\` rather than paging through every campaign. Each call counts toward API usage and is rate limited (about 60 requests/minute). For per-keyword ad data of a Rank Radar, use \`get_rank_radar_ppc_data\`.`,
|
|
1168
|
+
inputSchema: inputSchema27,
|
|
1169
|
+
annotations: { readOnlyHint: true },
|
|
1170
|
+
handler: async (args, ctx) => {
|
|
1171
|
+
if (args.asin && args.parentAsin) {
|
|
1172
|
+
throw new ApiError(
|
|
1173
|
+
"bad_request",
|
|
1174
|
+
400,
|
|
1175
|
+
"Pass either `asin` (one product) or `parentAsin` (its whole variation family), not both."
|
|
1176
|
+
);
|
|
1177
|
+
}
|
|
1178
|
+
return await httpGet(
|
|
1179
|
+
{ config: ctx.config, toolName: "list_ppc_campaigns" },
|
|
1180
|
+
sellerMarketplacePath(args.sellerId, args.marketplace, "ppc/campaigns"),
|
|
1181
|
+
{
|
|
1182
|
+
startDate: args.startDate,
|
|
1183
|
+
endDate: args.endDate,
|
|
1184
|
+
asin: args.asin,
|
|
1185
|
+
parentAsin: args.parentAsin,
|
|
1186
|
+
search: args.search,
|
|
1187
|
+
includePlacements: args.includePlacements,
|
|
1188
|
+
sortBy: args.sortBy,
|
|
1189
|
+
sortOrder: args.sortOrder,
|
|
1190
|
+
state: args.state,
|
|
1191
|
+
currentPage: args.currentPage,
|
|
1192
|
+
pageSize: args.pageSize
|
|
1193
|
+
}
|
|
1194
|
+
);
|
|
1195
|
+
}
|
|
1196
|
+
};
|
|
1197
|
+
|
|
1014
1198
|
// src/tools/get-asin-inventory-distribution.ts
|
|
1015
|
-
import { z as
|
|
1016
|
-
var
|
|
1017
|
-
sellerId:
|
|
1199
|
+
import { z as z28 } from "zod";
|
|
1200
|
+
var inputSchema28 = {
|
|
1201
|
+
sellerId: z28.string().min(1).describe(
|
|
1018
1202
|
"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."
|
|
1019
1203
|
),
|
|
1020
|
-
marketplace:
|
|
1021
|
-
asin:
|
|
1204
|
+
marketplace: z28.enum(SUPPORTED_MARKETPLACES).describe('Amazon marketplace code, e.g. "com" for amazon.com or "co.uk" for amazon.co.uk.'),
|
|
1205
|
+
asin: z28.string().regex(/^[A-Z0-9]{10}$/, "ASIN must be 10 uppercase alphanumeric characters (e.g. B08XYZ1234).").describe(
|
|
1022
1206
|
"Amazon Standard Identification Number (10 uppercase alphanumeric characters, e.g. B08XYZ1234)."
|
|
1023
1207
|
)
|
|
1024
1208
|
};
|
|
@@ -1026,7 +1210,7 @@ var getAsinInventoryDistributionTool = {
|
|
|
1026
1210
|
name: "get_asin_inventory_distribution",
|
|
1027
1211
|
title: "Get Per-Fulfillment-Center Inventory Distribution for an ASIN",
|
|
1028
1212
|
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.",
|
|
1029
|
-
inputSchema:
|
|
1213
|
+
inputSchema: inputSchema28,
|
|
1030
1214
|
annotations: { readOnlyHint: true },
|
|
1031
1215
|
handler: async (args, ctx) => {
|
|
1032
1216
|
return await httpGet(
|
|
@@ -1039,18 +1223,18 @@ var getAsinInventoryDistributionTool = {
|
|
|
1039
1223
|
};
|
|
1040
1224
|
|
|
1041
1225
|
// src/tools/alert-query.ts
|
|
1042
|
-
import { z as
|
|
1226
|
+
import { z as z29 } from "zod";
|
|
1043
1227
|
var alertsQueryInputSchema = {
|
|
1044
|
-
sellerId:
|
|
1045
|
-
marketplace:
|
|
1046
|
-
status:
|
|
1228
|
+
sellerId: z29.string().min(1).max(50).optional().describe('Filter to a single connected Amazon seller account ID, e.g. "A1B2C3D4E5".'),
|
|
1229
|
+
marketplace: z29.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.'),
|
|
1230
|
+
status: z29.enum(ALERT_STATUSES).optional().describe(
|
|
1047
1231
|
"Lifecycle filter. `active` (default) returns unresolved alerts, `resolved` returns resolved alerts, `all` returns both. Dismissed alerts are never returned."
|
|
1048
1232
|
),
|
|
1049
|
-
updatedSince:
|
|
1233
|
+
updatedSince: z29.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(
|
|
1050
1234
|
"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."
|
|
1051
1235
|
),
|
|
1052
|
-
currentPage:
|
|
1053
|
-
pageSize:
|
|
1236
|
+
currentPage: z29.number().int().min(1).optional().describe("Page number, 1-indexed. Defaults to 1."),
|
|
1237
|
+
pageSize: z29.number().int().min(1).max(50).optional().describe("Items per page (max 50). Defaults to 20.")
|
|
1054
1238
|
};
|
|
1055
1239
|
|
|
1056
1240
|
// src/tools/list-indexing-issue-alerts.ts
|
|
@@ -1100,12 +1284,12 @@ var listBlindSpendAlertsTool = {
|
|
|
1100
1284
|
};
|
|
1101
1285
|
|
|
1102
1286
|
// src/tools/get-quota.ts
|
|
1103
|
-
var
|
|
1287
|
+
var inputSchema29 = {};
|
|
1104
1288
|
var getQuotaTool = {
|
|
1105
1289
|
name: "get_quota",
|
|
1106
1290
|
title: "Get Quota Usage",
|
|
1107
1291
|
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.",
|
|
1108
|
-
inputSchema:
|
|
1292
|
+
inputSchema: inputSchema29,
|
|
1109
1293
|
annotations: { readOnlyHint: true },
|
|
1110
1294
|
handler: async (_args, ctx) => {
|
|
1111
1295
|
return await httpGet({ config: ctx.config, toolName: "get_quota" }, "/v1/quota");
|
|
@@ -1113,20 +1297,20 @@ var getQuotaTool = {
|
|
|
1113
1297
|
};
|
|
1114
1298
|
|
|
1115
1299
|
// src/tools/list-usage.ts
|
|
1116
|
-
import { z as
|
|
1117
|
-
var
|
|
1118
|
-
type:
|
|
1119
|
-
search:
|
|
1120
|
-
startDate:
|
|
1121
|
-
endDate:
|
|
1122
|
-
currentPage:
|
|
1123
|
-
pageSize:
|
|
1300
|
+
import { z as z30 } from "zod";
|
|
1301
|
+
var inputSchema30 = {
|
|
1302
|
+
type: z30.enum(BILLABLE_FEATURE_TYPES).optional().describe("Filter to a single billable feature type. Omit to return all types."),
|
|
1303
|
+
search: z30.string().min(1).optional().describe("Case-insensitive partial match on the user's name or email."),
|
|
1304
|
+
startDate: z30.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."),
|
|
1305
|
+
endDate: z30.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."),
|
|
1306
|
+
currentPage: z30.number().int().min(1).optional().describe("Page number, 1-indexed. Defaults to 1."),
|
|
1307
|
+
pageSize: z30.number().int().min(1).max(200).optional().describe("Items per page (max 200). Defaults to 50.")
|
|
1124
1308
|
};
|
|
1125
1309
|
var listUsageTool = {
|
|
1126
1310
|
name: "list_usage",
|
|
1127
1311
|
title: "List Billable Usage Logs",
|
|
1128
1312
|
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).",
|
|
1129
|
-
inputSchema:
|
|
1313
|
+
inputSchema: inputSchema30,
|
|
1130
1314
|
annotations: { readOnlyHint: true },
|
|
1131
1315
|
handler: async (args, ctx) => {
|
|
1132
1316
|
return await httpGet(
|
|
@@ -1153,8 +1337,11 @@ var allTools = [
|
|
|
1153
1337
|
getRankingJuiceTool,
|
|
1154
1338
|
listRankRadarsTool,
|
|
1155
1339
|
getRankRadarDataTool,
|
|
1340
|
+
getRankRadarSqpDataTool,
|
|
1341
|
+
getRankRadarPpcDataTool,
|
|
1156
1342
|
createRankRadarTool,
|
|
1157
1343
|
createNicheDiveTool,
|
|
1344
|
+
createNicheDiveFromCompetitorsListTool,
|
|
1158
1345
|
rediveNicheTool,
|
|
1159
1346
|
getDiveStatusTool,
|
|
1160
1347
|
addRankRadarSearchTermsTool,
|
|
@@ -1169,6 +1356,7 @@ var allTools = [
|
|
|
1169
1356
|
listSellerProfilesTool,
|
|
1170
1357
|
getSellerCatalogTool,
|
|
1171
1358
|
getSellerListingChangesTool,
|
|
1359
|
+
listPpcCampaignsTool,
|
|
1172
1360
|
getAsinInventoryDistributionTool,
|
|
1173
1361
|
listIndexingIssueAlertsTool,
|
|
1174
1362
|
listBlindSpendAlertsTool,
|
|
@@ -1176,15 +1364,87 @@ var allTools = [
|
|
|
1176
1364
|
listUsageTool
|
|
1177
1365
|
];
|
|
1178
1366
|
|
|
1367
|
+
// src/whats-new.ts
|
|
1368
|
+
var WHATS_NEW = [
|
|
1369
|
+
{
|
|
1370
|
+
version: "0.16.0",
|
|
1371
|
+
released: "2026-09-28",
|
|
1372
|
+
items: [
|
|
1373
|
+
"Niche research from your own competitor list (`create_niche_dive_from_competitors_list`): give 2 to 200 ASINs and the niche is built from exactly those products, with no automatic competitor search."
|
|
1374
|
+
]
|
|
1375
|
+
},
|
|
1376
|
+
{
|
|
1377
|
+
version: "0.15.0",
|
|
1378
|
+
released: "2026-09-28",
|
|
1379
|
+
items: [
|
|
1380
|
+
"Search Query Performance for Rank Radar keywords (`get_rank_radar_sqp_data`): how shoppers search, click, add to cart and buy, for the whole market and for your product.",
|
|
1381
|
+
"PPC data for Rank Radar keywords (`get_rank_radar_ppc_data`): sponsored rank, spend, sales, ACOS and CPC per keyword, optionally broken down by campaign.",
|
|
1382
|
+
"Your Sponsored Products campaigns (`list_ppc_campaigns`): totals and placement performance per campaign, sortable by any metric, e.g. the top spenders first."
|
|
1383
|
+
]
|
|
1384
|
+
},
|
|
1385
|
+
{
|
|
1386
|
+
version: "0.14.0",
|
|
1387
|
+
released: "2026-09-25",
|
|
1388
|
+
items: [
|
|
1389
|
+
"Rank Radar keywords are now read page by page (`get_rank_radar_data`, up to 100 keywords per page), so large Rank Radars load reliably."
|
|
1390
|
+
]
|
|
1391
|
+
},
|
|
1392
|
+
{
|
|
1393
|
+
version: "0.13.0",
|
|
1394
|
+
released: "2026-09-09",
|
|
1395
|
+
items: [
|
|
1396
|
+
"Before creating a Rank Radar, you are warned when the same product family is already tracked by another of your Rank Radars."
|
|
1397
|
+
]
|
|
1398
|
+
},
|
|
1399
|
+
{
|
|
1400
|
+
version: "0.12.0",
|
|
1401
|
+
released: "2026-09-07",
|
|
1402
|
+
items: ["Search and sort your niches by name, hero keyword or ASIN (`list_niches`)."]
|
|
1403
|
+
}
|
|
1404
|
+
];
|
|
1405
|
+
var INSTRUCTIONS_RELEASES = 2;
|
|
1406
|
+
function formatEntries(entries) {
|
|
1407
|
+
return entries.map((e) => `${e.released} (v${e.version}):
|
|
1408
|
+
${e.items.map((i) => `- ${i}`).join("\n")}`).join("\n\n");
|
|
1409
|
+
}
|
|
1410
|
+
var SERVER_INSTRUCTIONS = `DataDive tools for Amazon sellers: niche research (niches, keywords, roots, competitors, Ranking Juice), Rank Radar keyword rank tracking with SQP and PPC data, the seller's catalog, listing changes, inventory, PPC campaigns and alerts. Start with a discovery tool: \`list_niches\`, \`list_rank_radars\` or \`list_seller_profiles\`. Tools that spend tokens ask for confirmation first.
|
|
1411
|
+
|
|
1412
|
+
Recently added:
|
|
1413
|
+
${formatEntries(WHATS_NEW.slice(0, INSTRUCTIONS_RELEASES))}
|
|
1414
|
+
|
|
1415
|
+
When one of these additions fits what the user is doing, mention it once. The user can see the full list with the \`whats_new\` prompt.`;
|
|
1416
|
+
var WHATS_NEW_PROMPT = {
|
|
1417
|
+
name: "whats_new",
|
|
1418
|
+
title: "What's new in DataDive",
|
|
1419
|
+
description: "Recent additions to the DataDive tools, newest first."
|
|
1420
|
+
};
|
|
1421
|
+
function whatsNewPromptText() {
|
|
1422
|
+
return `Here is what is new in the DataDive tools, newest first:
|
|
1423
|
+
|
|
1424
|
+
${formatEntries(WHATS_NEW)}
|
|
1425
|
+
|
|
1426
|
+
Summarize this for me in a few short lines, and for each addition give one example question I could ask you.`;
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1179
1429
|
// src/server.ts
|
|
1180
1430
|
function requiredScope(tool) {
|
|
1181
1431
|
return tool.annotations?.readOnlyHint === true ? SCOPE_READ : SCOPE_WRITE;
|
|
1182
1432
|
}
|
|
1183
1433
|
function buildServer(config) {
|
|
1184
|
-
const server = new McpServer(
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1434
|
+
const server = new McpServer(
|
|
1435
|
+
{
|
|
1436
|
+
name: "datadive",
|
|
1437
|
+
version: PKG_VERSION
|
|
1438
|
+
},
|
|
1439
|
+
{ instructions: SERVER_INSTRUCTIONS }
|
|
1440
|
+
);
|
|
1441
|
+
server.registerPrompt(
|
|
1442
|
+
WHATS_NEW_PROMPT.name,
|
|
1443
|
+
{ title: WHATS_NEW_PROMPT.title, description: WHATS_NEW_PROMPT.description },
|
|
1444
|
+
() => ({
|
|
1445
|
+
messages: [{ role: "user", content: { type: "text", text: whatsNewPromptText() } }]
|
|
1446
|
+
})
|
|
1447
|
+
);
|
|
1188
1448
|
for (const tool of allTools) {
|
|
1189
1449
|
server.registerTool(
|
|
1190
1450
|
tool.name,
|
|
@@ -1244,9 +1504,13 @@ export {
|
|
|
1244
1504
|
PKG_VERSION,
|
|
1245
1505
|
SCOPE_READ,
|
|
1246
1506
|
SCOPE_WRITE,
|
|
1507
|
+
SERVER_INSTRUCTIONS,
|
|
1508
|
+
WHATS_NEW,
|
|
1509
|
+
WHATS_NEW_PROMPT,
|
|
1247
1510
|
allTools,
|
|
1248
1511
|
buildServer,
|
|
1249
1512
|
loadConfig,
|
|
1250
|
-
requiredScope
|
|
1513
|
+
requiredScope,
|
|
1514
|
+
whatsNewPromptText
|
|
1251
1515
|
};
|
|
1252
1516
|
//# sourceMappingURL=lib.js.map
|