@datadive-tools/mcp 0.9.0 → 0.11.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 +41 -16
- package/dist/index.js +342 -73
- package/dist/index.js.map +1 -1
- package/dist/lib.d.ts +27 -4
- package/dist/lib.js +342 -73
- package/dist/lib.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -105,7 +105,7 @@ function extractMessage(body) {
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
// package.json
|
|
108
|
-
var version = "0.
|
|
108
|
+
var version = "0.11.0";
|
|
109
109
|
|
|
110
110
|
// src/http/client.ts
|
|
111
111
|
var PKG_VERSION = version;
|
|
@@ -173,6 +173,23 @@ async function httpPost(ctx, path, body) {
|
|
|
173
173
|
}
|
|
174
174
|
return handleResponse(res);
|
|
175
175
|
}
|
|
176
|
+
async function httpDelete(ctx, path) {
|
|
177
|
+
const url = buildUrl(ctx.config.baseUrl, path);
|
|
178
|
+
let res;
|
|
179
|
+
try {
|
|
180
|
+
res = await fetch(url, {
|
|
181
|
+
method: "DELETE",
|
|
182
|
+
headers: {
|
|
183
|
+
...authHeaders(ctx.config),
|
|
184
|
+
accept: "application/json",
|
|
185
|
+
"user-agent": userAgent(ctx.toolName)
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
} catch (e) {
|
|
189
|
+
throw networkError(url, e);
|
|
190
|
+
}
|
|
191
|
+
return handleResponse(res);
|
|
192
|
+
}
|
|
176
193
|
function networkError(url, e) {
|
|
177
194
|
const msg = e instanceof Error ? e.message : String(e);
|
|
178
195
|
return new ApiError("network", 0, `Network error reaching ${url}: ${msg}`);
|
|
@@ -222,22 +239,22 @@ function isObject(v) {
|
|
|
222
239
|
}
|
|
223
240
|
|
|
224
241
|
// src/tools/list-niches.ts
|
|
242
|
+
var LIST_NICHES_MAX_PAGE_SIZE = 50;
|
|
225
243
|
var inputSchema = {
|
|
226
244
|
currentPage: z.number().int().min(1).optional().describe("Page number, 1-indexed. Defaults to 1."),
|
|
227
|
-
pageSize: z.number().int().min(1).max(
|
|
245
|
+
pageSize: z.number().int().min(1).max(LIST_NICHES_MAX_PAGE_SIZE).optional().describe(`Items per page (max ${LIST_NICHES_MAX_PAGE_SIZE}). Defaults to 20.`)
|
|
228
246
|
};
|
|
229
247
|
var listNichesTool = {
|
|
230
248
|
name: "list_niches",
|
|
231
249
|
title: "List DataDive Niches",
|
|
232
|
-
description: "Use this first when the user asks about their niches, or to find a `nicheId` for use with `get_niche_keywords`, `get_niche_competitors`, or `get_ranking_juice`. Retrieves
|
|
250
|
+
description: "Use this first when the user asks about their niches, or to find a `nicheId` for use with `get_niche_keywords`, `get_niche_competitors`, or `get_ranking_juice`. Retrieves the Niches of the account. Each Niche represents a market segment or product category being tracked. Returns nicheId, heroKeyword, nicheLabel, marketplace (com/uk/de/...), and latestResearchDate per niche, plus pagination metadata (currentPage, pageSize, total, lastPage, hasNext, hasPrev). TEMPORARY LIMITATION: the API does not apply paging yet, so a single call returns every niche of the account whatever `currentPage` and `pageSize` say, and the pagination metadata describes a page that was not applied. Read the whole `data` array and filter it yourself; do not walk `currentPage` while `hasNext` is true, because every page repeats the same rows. Accounts with many niches therefore return a large response. There is no server-side search or sorting.",
|
|
233
251
|
inputSchema,
|
|
234
252
|
annotations: { readOnlyHint: true },
|
|
235
253
|
handler: async (args, ctx) => {
|
|
236
|
-
return await httpGet(
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
);
|
|
254
|
+
return await httpGet({ config: ctx.config, toolName: "list_niches" }, "/v1/niches", {
|
|
255
|
+
currentPage: args.currentPage,
|
|
256
|
+
pageSize: args.pageSize
|
|
257
|
+
});
|
|
241
258
|
}
|
|
242
259
|
};
|
|
243
260
|
|
|
@@ -287,7 +304,7 @@ var inputSchema4 = {
|
|
|
287
304
|
var getNicheCompetitorsTool = {
|
|
288
305
|
name: "get_niche_competitors",
|
|
289
306
|
title: "Get Competitors and Niche Statistics",
|
|
290
|
-
description: "Use this for competitor ASINs, sales/revenue benchmarks, or niche opportunity scoring. Retrieves the list of Competitors within the specified Niche along with Niche statistics. For the Niche: keyword statistics, opportunity evaluation, benchmark median values, and overall competitor strength assessment. For each Competitor: ASIN, sales, revenue, ratings, reviews, price, image URL, and ranking data.",
|
|
307
|
+
description: "Use this for competitor ASINs, product titles, BSR, sales/revenue benchmarks, or niche opportunity scoring. Retrieves the list of Competitors within the specified Niche along with Niche statistics. For the Niche: keyword statistics, opportunity evaluation, benchmark median values, and overall competitor strength assessment. For each Competitor: ASIN, product title, BSR, category and full category tree, sales, revenue, ratings, reviews, price, number of variations, image URL, total Ranking Juice, and ranking data. BSR supports ranking Competitors by sales position within mentioned category. For the Ranking Juice breakdown by title, bullets and description, use `get_ranking_juice`.",
|
|
291
308
|
inputSchema: inputSchema4,
|
|
292
309
|
annotations: { readOnlyHint: true },
|
|
293
310
|
handler: async (args, ctx) => {
|
|
@@ -334,7 +351,8 @@ var SUPPORTED_MARKETPLACES = [
|
|
|
334
351
|
"it",
|
|
335
352
|
"co.jp"
|
|
336
353
|
];
|
|
337
|
-
var
|
|
354
|
+
var RANK_RADAR_STATES = ["ACTIVE", "PAUSED", "ARCHIVED"];
|
|
355
|
+
var RANK_RADAR_STATUSES = [...RANK_RADAR_STATES, "ALL"];
|
|
338
356
|
var ALERT_STATUSES = ["active", "resolved", "all"];
|
|
339
357
|
var BILLABLE_FEATURE_TYPES = [
|
|
340
358
|
"DIVED_ASINS",
|
|
@@ -346,25 +364,32 @@ var CATALOG_STATUSES = ["Active", "all"];
|
|
|
346
364
|
var LISTING_CHANGE_TYPES = ["Price", "Content", "Image"];
|
|
347
365
|
var LISTING_CHANGE_SORT_BY = ["date", "type"];
|
|
348
366
|
var SORT_ORDER = ["ASC", "DESC"];
|
|
367
|
+
var ADD_SEARCH_TERMS_MAX = 1e3;
|
|
368
|
+
var LISTING_COPY_STRATEGIES = ["cosmo", "ranking-juice", "nlp", "cosmo-rufus"];
|
|
349
369
|
|
|
350
370
|
// src/tools/list-rank-radars.ts
|
|
371
|
+
var LIST_RANK_RADARS_MAX_PAGE_SIZE = 50;
|
|
351
372
|
var inputSchema6 = {
|
|
352
373
|
currentPage: z6.number().int().min(1).optional().describe("Page number, 1-indexed. Defaults to 1."),
|
|
353
|
-
pageSize: z6.number().int().min(1).max(
|
|
374
|
+
pageSize: z6.number().int().min(1).max(LIST_RANK_RADARS_MAX_PAGE_SIZE).optional().describe(`Items per page (max ${LIST_RANK_RADARS_MAX_PAGE_SIZE}). Defaults to 20.`),
|
|
354
375
|
nicheId: z6.string().min(1).optional().describe("Filter Rank Radars by Niche identifier. Use after `list_niches`."),
|
|
355
376
|
status: z6.enum(RANK_RADAR_STATUSES).optional().describe(
|
|
356
|
-
"
|
|
377
|
+
"Which Rank Radars to return. ACTIVE (the default) are tracking; PAUSED have been stopped but keep their history and can be resumed; ARCHIVED have been deleted; ALL means active and paused together. Archived Rank Radars are returned only by an explicit ARCHIVED."
|
|
357
378
|
),
|
|
358
379
|
searchText: z6.string().optional().describe("Filter Rank Radars by ASIN or product title.")
|
|
359
380
|
};
|
|
381
|
+
function minimize(item) {
|
|
382
|
+
const { asin, ...rest } = item;
|
|
383
|
+
return { ...rest, asin: asin?.asin };
|
|
384
|
+
}
|
|
360
385
|
var listRankRadarsTool = {
|
|
361
386
|
name: "list_rank_radars",
|
|
362
387
|
title: "List Rank Radars",
|
|
363
|
-
description:
|
|
388
|
+
description: `Use this to find a \`rankRadarId\` before calling \`get_rank_radar_data\`. Filter by \`nicheId\` if the user has already identified a niche. Retrieves a paginated list of Rank Radars \u2014 keyword-rank trackers monitoring organic and sponsored positions for specific ASINs over time. Each item includes id, status (ACTIVE, PAUSED or ARCHIVED), asin, marketplace, keywordCount, title, imageUrl, and summary metrics: top10KW, top10SV, top50KW, top50SV. Supports pagination metadata (currentPage, pageSize, total, lastPage, hasNext, hasPrev); a page holds at most ${LIST_RANK_RADARS_MAX_PAGE_SIZE} Rank Radars, so a large account needs several calls.`,
|
|
364
389
|
inputSchema: inputSchema6,
|
|
365
390
|
annotations: { readOnlyHint: true },
|
|
366
391
|
handler: async (args, ctx) => {
|
|
367
|
-
|
|
392
|
+
const page = await httpGet(
|
|
368
393
|
{ config: ctx.config, toolName: "list_rank_radars" },
|
|
369
394
|
"/v1/niches/rank-radars",
|
|
370
395
|
{
|
|
@@ -375,6 +400,7 @@ var listRankRadarsTool = {
|
|
|
375
400
|
searchText: args.searchText
|
|
376
401
|
}
|
|
377
402
|
);
|
|
403
|
+
return { ...page, data: (page.data ?? []).map(minimize) };
|
|
378
404
|
}
|
|
379
405
|
};
|
|
380
406
|
|
|
@@ -426,12 +452,12 @@ var inputSchema8 = {
|
|
|
426
452
|
var createRankRadarTool = {
|
|
427
453
|
name: "create_rank_radar",
|
|
428
454
|
title: "Create a Rank Radar",
|
|
429
|
-
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. Returns the new `rankRadarId`; read its data later with `get_rank_radar_data`. Requires `asin`, `numberOfKeywords` (min 1), and a `nicheId` from `list_niches`.",
|
|
455
|
+
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. Returns the new `rankRadarId`; read its data later with `get_rank_radar_data`. Requires `asin`, `numberOfKeywords` (min 1), and a `nicheId` from `list_niches`.",
|
|
430
456
|
inputSchema: inputSchema8,
|
|
431
457
|
// destructiveHint is technically "additive" here (this creates a new Rank Radar, it
|
|
432
458
|
// doesn't destroy data), but we flag it destructive so clients prompt before the
|
|
433
459
|
// irreversible token spend. The confirm gate enforces this server-side regardless.
|
|
434
|
-
annotations: { readOnlyHint: false, destructiveHint: true },
|
|
460
|
+
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: false },
|
|
435
461
|
handler: async (args, ctx) => {
|
|
436
462
|
const pending = requireConfirmation(
|
|
437
463
|
args.confirm,
|
|
@@ -464,12 +490,12 @@ var inputSchema9 = {
|
|
|
464
490
|
var createNicheDiveTool = {
|
|
465
491
|
name: "create_niche_dive",
|
|
466
492
|
title: "Create a Niche Dive",
|
|
467
|
-
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. 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).",
|
|
493
|
+
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).",
|
|
468
494
|
inputSchema: inputSchema9,
|
|
469
495
|
// destructiveHint is technically "additive" here (a dive creates a new niche, it
|
|
470
496
|
// doesn't destroy data), but we flag it destructive so clients prompt before the
|
|
471
497
|
// irreversible token spend. The confirm gate enforces this server-side regardless.
|
|
472
|
-
annotations: { readOnlyHint: false, destructiveHint: true },
|
|
498
|
+
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: false },
|
|
473
499
|
handler: async (args, ctx) => {
|
|
474
500
|
const pending = requireConfirmation(
|
|
475
501
|
args.confirm,
|
|
@@ -513,11 +539,11 @@ var inputSchema10 = {
|
|
|
513
539
|
var rediveNicheTool = {
|
|
514
540
|
name: "redive_niche",
|
|
515
541
|
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.",
|
|
542
|
+
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.",
|
|
517
543
|
inputSchema: inputSchema10,
|
|
518
544
|
// Same reasoning as create_niche_dive: a re-dive is additive rather than destructive, but the
|
|
519
545
|
// irreversible token spend is what clients need to prompt on. The confirm gate enforces it regardless.
|
|
520
|
-
annotations: { readOnlyHint: false, destructiveHint: true },
|
|
546
|
+
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: false },
|
|
521
547
|
handler: async (args, ctx) => {
|
|
522
548
|
if (args.mode === "discover" && args.numberOfCompetitors === void 0) {
|
|
523
549
|
throw new ApiError(
|
|
@@ -565,17 +591,251 @@ var getDiveStatusTool = {
|
|
|
565
591
|
}
|
|
566
592
|
};
|
|
567
593
|
|
|
568
|
-
// src/tools/
|
|
594
|
+
// src/tools/delete-niche.ts
|
|
569
595
|
import { z as z12 } from "zod";
|
|
570
596
|
var inputSchema12 = {
|
|
571
|
-
|
|
572
|
-
|
|
597
|
+
nicheId: z12.string().min(1).describe("The niche to delete. Get one from `list_niches`."),
|
|
598
|
+
confirm: z12.boolean().optional().describe(
|
|
599
|
+
"Must be true to proceed \u2014 deleting a niche destroys its keywords, competitors and dive history permanently. Confirm with the user first."
|
|
600
|
+
)
|
|
601
|
+
};
|
|
602
|
+
var deleteNicheTool = {
|
|
603
|
+
name: "delete_niche",
|
|
604
|
+
title: "Delete a Niche",
|
|
605
|
+
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).",
|
|
606
|
+
inputSchema: inputSchema12,
|
|
607
|
+
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: false },
|
|
608
|
+
handler: async (args, ctx) => {
|
|
609
|
+
const pending = requireConfirmation(
|
|
610
|
+
args.confirm,
|
|
611
|
+
ctx,
|
|
612
|
+
"Deleting this niche removes its keywords, competitors and all dive history permanently. The dive tokens already spent on it are not refunded."
|
|
613
|
+
);
|
|
614
|
+
if (pending) return pending;
|
|
615
|
+
await httpDelete(
|
|
616
|
+
{ config: ctx.config, toolName: "delete_niche" },
|
|
617
|
+
`/v1/niches/${encodeURIComponent(args.nicheId)}`
|
|
618
|
+
);
|
|
619
|
+
return { status: "deleted", nicheId: args.nicheId };
|
|
620
|
+
}
|
|
621
|
+
};
|
|
622
|
+
|
|
623
|
+
// src/tools/pause-rank-radar.ts
|
|
624
|
+
import { z as z13 } from "zod";
|
|
625
|
+
var inputSchema13 = {
|
|
626
|
+
rankRadarId: z13.string().uuid().describe("The Rank Radar UUID to pause (from `list_rank_radars`).")
|
|
627
|
+
};
|
|
628
|
+
var pauseRankRadarTool = {
|
|
629
|
+
name: "pause_rank_radar",
|
|
630
|
+
title: "Pause a Rank Radar",
|
|
631
|
+
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.",
|
|
632
|
+
inputSchema: inputSchema13,
|
|
633
|
+
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: false },
|
|
634
|
+
handler: async (args, ctx) => {
|
|
635
|
+
await httpPost(
|
|
636
|
+
{ config: ctx.config, toolName: "pause_rank_radar" },
|
|
637
|
+
`/v1/niches/rank-radars/${encodeURIComponent(args.rankRadarId)}/archive`,
|
|
638
|
+
{}
|
|
639
|
+
);
|
|
640
|
+
return { status: "paused", rankRadarId: args.rankRadarId };
|
|
641
|
+
}
|
|
642
|
+
};
|
|
643
|
+
|
|
644
|
+
// src/tools/resume-rank-radar.ts
|
|
645
|
+
import { z as z14 } from "zod";
|
|
646
|
+
var inputSchema14 = {
|
|
647
|
+
rankRadarId: z14.string().uuid().describe("The Rank Radar UUID to resume (from `list_rank_radars`).")
|
|
648
|
+
};
|
|
649
|
+
var resumeRankRadarTool = {
|
|
650
|
+
name: "resume_rank_radar",
|
|
651
|
+
title: "Resume a Paused Rank Radar",
|
|
652
|
+
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.",
|
|
653
|
+
inputSchema: inputSchema14,
|
|
654
|
+
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: false },
|
|
655
|
+
handler: async (args, ctx) => {
|
|
656
|
+
await httpPost(
|
|
657
|
+
{ config: ctx.config, toolName: "resume_rank_radar" },
|
|
658
|
+
`/v1/niches/rank-radars/${encodeURIComponent(args.rankRadarId)}/resume`,
|
|
659
|
+
{}
|
|
660
|
+
);
|
|
661
|
+
return { status: "resumed", rankRadarId: args.rankRadarId };
|
|
662
|
+
}
|
|
663
|
+
};
|
|
664
|
+
|
|
665
|
+
// src/tools/delete-rank-radar.ts
|
|
666
|
+
import { z as z15 } from "zod";
|
|
667
|
+
var inputSchema15 = {
|
|
668
|
+
rankRadarId: z15.string().uuid().describe("The Rank Radar UUID to delete (from `list_rank_radars`)."),
|
|
669
|
+
confirm: z15.boolean().optional().describe(
|
|
670
|
+
"Must be true to proceed \u2014 deleting a Rank Radar destroys its ranking history permanently. Confirm with the user first."
|
|
671
|
+
)
|
|
672
|
+
};
|
|
673
|
+
var deleteRankRadarTool = {
|
|
674
|
+
name: "delete_rank_radar",
|
|
675
|
+
title: "Delete a Rank Radar",
|
|
676
|
+
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`.",
|
|
677
|
+
inputSchema: inputSchema15,
|
|
678
|
+
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: false },
|
|
679
|
+
handler: async (args, ctx) => {
|
|
680
|
+
const pending = requireConfirmation(
|
|
681
|
+
args.confirm,
|
|
682
|
+
ctx,
|
|
683
|
+
"Deleting this Rank Radar removes its keyword ranking history permanently. It frees the Daily Tracked Keywords quota, but the history cannot be recovered \u2014 `pause_rank_radar` frees the same quota and is reversible."
|
|
684
|
+
);
|
|
685
|
+
if (pending) return pending;
|
|
686
|
+
await httpDelete(
|
|
687
|
+
{ config: ctx.config, toolName: "delete_rank_radar" },
|
|
688
|
+
`/v1/niches/rank-radars/${encodeURIComponent(args.rankRadarId)}`
|
|
689
|
+
);
|
|
690
|
+
return { status: "deleted", rankRadarId: args.rankRadarId };
|
|
691
|
+
}
|
|
692
|
+
};
|
|
693
|
+
|
|
694
|
+
// src/tools/add-rank-radar-search-terms.ts
|
|
695
|
+
import { z as z16 } from "zod";
|
|
696
|
+
var inputSchema16 = {
|
|
697
|
+
rankRadarId: z16.string().uuid().describe("The Rank Radar UUID to add the search terms to (from `list_rank_radars`)."),
|
|
698
|
+
searchTerms: z16.array(z16.string().min(1)).min(1).max(ADD_SEARCH_TERMS_MAX).describe(
|
|
699
|
+
`The keywords to start tracking, 1\u2013${ADD_SEARCH_TERMS_MAX} per call. Must be unique. Amazon-ignored special characters (@, #, _, parentheses, \u2026) are rejected.`
|
|
700
|
+
)
|
|
701
|
+
};
|
|
702
|
+
var addRankRadarSearchTermsTool = {
|
|
703
|
+
name: "add_rank_radar_search_terms",
|
|
704
|
+
title: "Add Search Terms to a Rank Radar",
|
|
705
|
+
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.",
|
|
706
|
+
inputSchema: inputSchema16,
|
|
707
|
+
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: false },
|
|
708
|
+
handler: async (args, ctx) => {
|
|
709
|
+
return await httpPost(
|
|
710
|
+
{ config: ctx.config, toolName: "add_rank_radar_search_terms" },
|
|
711
|
+
`/v1/niches/rank-radars/${encodeURIComponent(args.rankRadarId)}/search-terms`,
|
|
712
|
+
{ searchTerms: args.searchTerms }
|
|
713
|
+
);
|
|
714
|
+
}
|
|
715
|
+
};
|
|
716
|
+
|
|
717
|
+
// src/tools/pause-rank-radar-search-terms.ts
|
|
718
|
+
import { z as z17 } from "zod";
|
|
719
|
+
var inputSchema17 = {
|
|
720
|
+
rankRadarId: z17.string().uuid().describe("The Rank Radar UUID the search terms belong to."),
|
|
721
|
+
rankRadarKeywordIds: z17.array(z17.string().uuid()).min(1).describe(
|
|
722
|
+
"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."
|
|
723
|
+
)
|
|
724
|
+
};
|
|
725
|
+
var pauseRankRadarSearchTermsTool = {
|
|
726
|
+
name: "pause_rank_radar_search_terms",
|
|
727
|
+
title: "Pause Search Terms of a Rank Radar",
|
|
728
|
+
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.",
|
|
729
|
+
inputSchema: inputSchema17,
|
|
730
|
+
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: false },
|
|
731
|
+
handler: async (args, ctx) => {
|
|
732
|
+
await httpPost(
|
|
733
|
+
{ config: ctx.config, toolName: "pause_rank_radar_search_terms" },
|
|
734
|
+
`/v1/niches/rank-radars/${encodeURIComponent(args.rankRadarId)}/search-terms/archive`,
|
|
735
|
+
{ rankRadarKeywordIds: args.rankRadarKeywordIds }
|
|
736
|
+
);
|
|
737
|
+
return {
|
|
738
|
+
status: "paused",
|
|
739
|
+
rankRadarId: args.rankRadarId,
|
|
740
|
+
rankRadarKeywordIds: args.rankRadarKeywordIds
|
|
741
|
+
};
|
|
742
|
+
}
|
|
743
|
+
};
|
|
744
|
+
|
|
745
|
+
// src/tools/resume-rank-radar-search-terms.ts
|
|
746
|
+
import { z as z18 } from "zod";
|
|
747
|
+
var inputSchema18 = {
|
|
748
|
+
rankRadarId: z18.string().uuid().describe("The Rank Radar UUID the search terms belong to."),
|
|
749
|
+
rankRadarKeywordIds: z18.array(z18.string().uuid()).min(1).describe(
|
|
750
|
+
"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."
|
|
751
|
+
)
|
|
752
|
+
};
|
|
753
|
+
var resumeRankRadarSearchTermsTool = {
|
|
754
|
+
name: "resume_rank_radar_search_terms",
|
|
755
|
+
title: "Resume Paused Search Terms of a Rank Radar",
|
|
756
|
+
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.",
|
|
757
|
+
inputSchema: inputSchema18,
|
|
758
|
+
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: false },
|
|
759
|
+
handler: async (args, ctx) => {
|
|
760
|
+
await httpPost(
|
|
761
|
+
{ config: ctx.config, toolName: "resume_rank_radar_search_terms" },
|
|
762
|
+
`/v1/niches/rank-radars/${encodeURIComponent(args.rankRadarId)}/search-terms/resume`,
|
|
763
|
+
{ rankRadarKeywordIds: args.rankRadarKeywordIds }
|
|
764
|
+
);
|
|
765
|
+
return {
|
|
766
|
+
status: "resumed",
|
|
767
|
+
rankRadarId: args.rankRadarId,
|
|
768
|
+
rankRadarKeywordIds: args.rankRadarKeywordIds
|
|
769
|
+
};
|
|
770
|
+
}
|
|
771
|
+
};
|
|
772
|
+
|
|
773
|
+
// src/tools/generate-listing-copy.ts
|
|
774
|
+
import { z as z19 } from "zod";
|
|
775
|
+
var inputSchema19 = {
|
|
776
|
+
nicheId: z19.string().min(1).describe("The niche whose keyword data the copy is written from. Get one from `list_niches`."),
|
|
777
|
+
strategy: z19.enum(LISTING_COPY_STRATEGIES).describe(
|
|
778
|
+
"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."
|
|
779
|
+
),
|
|
780
|
+
currentListing: z19.record(z19.union([z19.string(), z19.array(z19.string())])).describe(
|
|
781
|
+
'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.'
|
|
782
|
+
),
|
|
783
|
+
confirm: z19.boolean().optional().describe(
|
|
784
|
+
"Must be true to proceed \u2014 each generation spends one AI Copywriter prompt from the quota. Confirm the cost with the user first."
|
|
785
|
+
)
|
|
786
|
+
};
|
|
787
|
+
var generateListingCopyTool = {
|
|
788
|
+
name: "generate_listing_copy",
|
|
789
|
+
title: "Generate Listing Copy for a Niche",
|
|
790
|
+
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`.",
|
|
791
|
+
inputSchema: inputSchema19,
|
|
792
|
+
annotations: { readOnlyHint: false, destructiveHint: true, openWorldHint: false },
|
|
793
|
+
handler: async (args, ctx) => {
|
|
794
|
+
const pending = requireConfirmation(
|
|
795
|
+
args.confirm,
|
|
796
|
+
ctx,
|
|
797
|
+
"Generating listing copy consumes one AI Copywriter prompt from the organization's quota. Check the remaining balance with `get_quota` if the user needs it."
|
|
798
|
+
);
|
|
799
|
+
if (pending) return pending;
|
|
800
|
+
return await httpPost(
|
|
801
|
+
{ config: ctx.config, toolName: "generate_listing_copy" },
|
|
802
|
+
`/v1/niches/${encodeURIComponent(args.nicheId)}/ai-copywriter`,
|
|
803
|
+
{ prompt: args.strategy, listingToInclude: args.currentListing }
|
|
804
|
+
);
|
|
805
|
+
}
|
|
806
|
+
};
|
|
807
|
+
|
|
808
|
+
// src/tools/get-listing-copy-generation-status.ts
|
|
809
|
+
import { z as z20 } from "zod";
|
|
810
|
+
var inputSchema20 = {
|
|
811
|
+
nicheId: z20.string().min(1).describe("The niche the generation was started for."),
|
|
812
|
+
generationId: z20.string().min(1).describe("The `generationId` returned by `generate_listing_copy`.")
|
|
813
|
+
};
|
|
814
|
+
var getListingCopyGenerationStatusTool = {
|
|
815
|
+
name: "get_listing_copy_generation_status",
|
|
816
|
+
title: "Get Listing Copy Generation Status",
|
|
817
|
+
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`.",
|
|
818
|
+
inputSchema: inputSchema20,
|
|
819
|
+
annotations: { readOnlyHint: true },
|
|
820
|
+
handler: async (args, ctx) => {
|
|
821
|
+
return await httpGet(
|
|
822
|
+
{ config: ctx.config, toolName: "get_listing_copy_generation_status" },
|
|
823
|
+
`/v1/niches/${encodeURIComponent(args.nicheId)}/ai-copywriter/${encodeURIComponent(args.generationId)}`
|
|
824
|
+
);
|
|
825
|
+
}
|
|
826
|
+
};
|
|
827
|
+
|
|
828
|
+
// src/tools/list-seller-profiles.ts
|
|
829
|
+
import { z as z21 } from "zod";
|
|
830
|
+
var inputSchema21 = {
|
|
831
|
+
currentPage: z21.number().int().min(1).optional().describe("Page number, 1-indexed. Defaults to 1."),
|
|
832
|
+
pageSize: z21.number().int().min(1).max(50).optional().describe("Items per page (max 50). Defaults to 20.")
|
|
573
833
|
};
|
|
574
834
|
var listSellerProfilesTool = {
|
|
575
835
|
name: "list_seller_profiles",
|
|
576
836
|
title: "List Connected Amazon Seller Profiles",
|
|
577
837
|
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).',
|
|
578
|
-
inputSchema:
|
|
838
|
+
inputSchema: inputSchema21,
|
|
579
839
|
annotations: { readOnlyHint: true },
|
|
580
840
|
handler: async (args, ctx) => {
|
|
581
841
|
return await httpGet(
|
|
@@ -590,15 +850,15 @@ var listSellerProfilesTool = {
|
|
|
590
850
|
};
|
|
591
851
|
|
|
592
852
|
// src/tools/get-seller-catalog.ts
|
|
593
|
-
import { z as
|
|
853
|
+
import { z as z23 } from "zod";
|
|
594
854
|
|
|
595
855
|
// src/tools/seller-scoped.ts
|
|
596
|
-
import { z as
|
|
856
|
+
import { z as z22 } from "zod";
|
|
597
857
|
var sellerScopedInputSchema = {
|
|
598
|
-
sellerId:
|
|
858
|
+
sellerId: z22.string().min(1).describe(
|
|
599
859
|
"Amazon seller account ID. Get it from `list_seller_profiles`, or find it on the Connections page at https://2.datadive.tools."
|
|
600
860
|
),
|
|
601
|
-
marketplace:
|
|
861
|
+
marketplace: z22.enum(SUPPORTED_MARKETPLACES).describe('Amazon marketplace code, e.g. "com" for amazon.com or "co.uk" for amazon.co.uk.')
|
|
602
862
|
};
|
|
603
863
|
function sellerMarketplacePath(sellerId, marketplace, suffix) {
|
|
604
864
|
return `/v1/seller_profiles/${encodeURIComponent(sellerId)}/marketplaces/${encodeURIComponent(
|
|
@@ -607,19 +867,19 @@ function sellerMarketplacePath(sellerId, marketplace, suffix) {
|
|
|
607
867
|
}
|
|
608
868
|
|
|
609
869
|
// src/tools/get-seller-catalog.ts
|
|
610
|
-
var
|
|
870
|
+
var inputSchema22 = {
|
|
611
871
|
...sellerScopedInputSchema,
|
|
612
|
-
search:
|
|
613
|
-
brand:
|
|
614
|
-
status:
|
|
615
|
-
currentPage:
|
|
616
|
-
pageSize:
|
|
872
|
+
search: z23.string().min(1).optional().describe("Case-insensitive partial match on product title or brand."),
|
|
873
|
+
brand: z23.string().min(1).optional().describe("Case-insensitive partial match on brand name."),
|
|
874
|
+
status: z23.enum(CATALOG_STATUSES).optional().describe('Listing status filter. "Active" (default) or "all".'),
|
|
875
|
+
currentPage: z23.number().int().min(1).optional().describe("Page number, 1-indexed. Defaults to 1."),
|
|
876
|
+
pageSize: z23.number().int().min(1).max(50).optional().describe("Items per page (max 50). Defaults to 20.")
|
|
617
877
|
};
|
|
618
878
|
var getSellerCatalogTool = {
|
|
619
879
|
name: "get_seller_catalog",
|
|
620
880
|
title: "List Catalog ASINs for a Seller",
|
|
621
881
|
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).",
|
|
622
|
-
inputSchema:
|
|
882
|
+
inputSchema: inputSchema22,
|
|
623
883
|
annotations: { readOnlyHint: true },
|
|
624
884
|
handler: async (args, ctx) => {
|
|
625
885
|
return await httpGet(
|
|
@@ -637,28 +897,28 @@ var getSellerCatalogTool = {
|
|
|
637
897
|
};
|
|
638
898
|
|
|
639
899
|
// src/tools/get-seller-listing-changes.ts
|
|
640
|
-
import { z as
|
|
641
|
-
var
|
|
900
|
+
import { z as z24 } from "zod";
|
|
901
|
+
var inputSchema23 = {
|
|
642
902
|
...sellerScopedInputSchema,
|
|
643
|
-
types:
|
|
644
|
-
asin:
|
|
645
|
-
brand:
|
|
646
|
-
search:
|
|
647
|
-
startDate:
|
|
648
|
-
endDate:
|
|
649
|
-
sortBy:
|
|
650
|
-
sortOrder:
|
|
651
|
-
includeCorrelations:
|
|
903
|
+
types: z24.array(z24.enum(LISTING_CHANGE_TYPES)).min(1).optional().describe('Filter to specific change types. Omit for all. Any of "Price", "Content", "Image".'),
|
|
904
|
+
asin: z24.string().min(1).optional().describe("Filter to an exact ASIN or parent ASIN."),
|
|
905
|
+
brand: z24.string().min(1).optional().describe("Case-insensitive partial match on brand name."),
|
|
906
|
+
search: z24.string().min(1).optional().describe("Case-insensitive partial match on product title or brand."),
|
|
907
|
+
startDate: z24.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."),
|
|
908
|
+
endDate: z24.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."),
|
|
909
|
+
sortBy: z24.enum(LISTING_CHANGE_SORT_BY).optional().describe('Sort field. "date" (default) or "type".'),
|
|
910
|
+
sortOrder: z24.enum(SORT_ORDER).optional().describe('Sort direction. "DESC" (default) or "ASC".'),
|
|
911
|
+
includeCorrelations: z24.boolean().optional().describe(
|
|
652
912
|
"When true, include the ranking/conversion `correlation` object per change (CVR and search-term movement before vs after). Defaults to false."
|
|
653
913
|
),
|
|
654
|
-
currentPage:
|
|
655
|
-
pageSize:
|
|
914
|
+
currentPage: z24.number().int().min(1).optional().describe("Page number, 1-indexed. Defaults to 1."),
|
|
915
|
+
pageSize: z24.number().int().min(1).max(50).optional().describe("Items per page (max 50). Defaults to 20.")
|
|
656
916
|
};
|
|
657
917
|
var getSellerListingChangesTool = {
|
|
658
918
|
name: "get_seller_listing_changes",
|
|
659
919
|
title: "List Listing Changes for a Seller",
|
|
660
920
|
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).",
|
|
661
|
-
inputSchema:
|
|
921
|
+
inputSchema: inputSchema23,
|
|
662
922
|
annotations: { readOnlyHint: true },
|
|
663
923
|
handler: async (args, ctx) => {
|
|
664
924
|
return await httpGet(
|
|
@@ -683,13 +943,13 @@ var getSellerListingChangesTool = {
|
|
|
683
943
|
};
|
|
684
944
|
|
|
685
945
|
// src/tools/get-asin-inventory-distribution.ts
|
|
686
|
-
import { z as
|
|
687
|
-
var
|
|
688
|
-
sellerId:
|
|
946
|
+
import { z as z25 } from "zod";
|
|
947
|
+
var inputSchema24 = {
|
|
948
|
+
sellerId: z25.string().min(1).describe(
|
|
689
949
|
"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."
|
|
690
950
|
),
|
|
691
|
-
marketplace:
|
|
692
|
-
asin:
|
|
951
|
+
marketplace: z25.enum(SUPPORTED_MARKETPLACES).describe('Amazon marketplace code, e.g. "com" for amazon.com or "co.uk" for amazon.co.uk.'),
|
|
952
|
+
asin: z25.string().regex(/^[A-Z0-9]{10}$/, "ASIN must be 10 uppercase alphanumeric characters (e.g. B08XYZ1234).").describe(
|
|
693
953
|
"Amazon Standard Identification Number (10 uppercase alphanumeric characters, e.g. B08XYZ1234)."
|
|
694
954
|
)
|
|
695
955
|
};
|
|
@@ -697,7 +957,7 @@ var getAsinInventoryDistributionTool = {
|
|
|
697
957
|
name: "get_asin_inventory_distribution",
|
|
698
958
|
title: "Get Per-Fulfillment-Center Inventory Distribution for an ASIN",
|
|
699
959
|
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.",
|
|
700
|
-
inputSchema:
|
|
960
|
+
inputSchema: inputSchema24,
|
|
701
961
|
annotations: { readOnlyHint: true },
|
|
702
962
|
handler: async (args, ctx) => {
|
|
703
963
|
return await httpGet(
|
|
@@ -710,18 +970,18 @@ var getAsinInventoryDistributionTool = {
|
|
|
710
970
|
};
|
|
711
971
|
|
|
712
972
|
// src/tools/alert-query.ts
|
|
713
|
-
import { z as
|
|
973
|
+
import { z as z26 } from "zod";
|
|
714
974
|
var alertsQueryInputSchema = {
|
|
715
|
-
sellerId:
|
|
716
|
-
marketplace:
|
|
717
|
-
status:
|
|
975
|
+
sellerId: z26.string().min(1).max(50).optional().describe('Filter to a single connected Amazon seller account ID, e.g. "A1B2C3D4E5".'),
|
|
976
|
+
marketplace: z26.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.'),
|
|
977
|
+
status: z26.enum(ALERT_STATUSES).optional().describe(
|
|
718
978
|
"Lifecycle filter. `active` (default) returns unresolved alerts, `resolved` returns resolved alerts, `all` returns both. Dismissed alerts are never returned."
|
|
719
979
|
),
|
|
720
|
-
updatedSince:
|
|
980
|
+
updatedSince: z26.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(
|
|
721
981
|
"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."
|
|
722
982
|
),
|
|
723
|
-
currentPage:
|
|
724
|
-
pageSize:
|
|
983
|
+
currentPage: z26.number().int().min(1).optional().describe("Page number, 1-indexed. Defaults to 1."),
|
|
984
|
+
pageSize: z26.number().int().min(1).max(50).optional().describe("Items per page (max 50). Defaults to 20.")
|
|
725
985
|
};
|
|
726
986
|
|
|
727
987
|
// src/tools/list-indexing-issue-alerts.ts
|
|
@@ -771,12 +1031,12 @@ var listBlindSpendAlertsTool = {
|
|
|
771
1031
|
};
|
|
772
1032
|
|
|
773
1033
|
// src/tools/get-quota.ts
|
|
774
|
-
var
|
|
1034
|
+
var inputSchema25 = {};
|
|
775
1035
|
var getQuotaTool = {
|
|
776
1036
|
name: "get_quota",
|
|
777
1037
|
title: "Get Quota Usage",
|
|
778
1038
|
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.",
|
|
779
|
-
inputSchema:
|
|
1039
|
+
inputSchema: inputSchema25,
|
|
780
1040
|
annotations: { readOnlyHint: true },
|
|
781
1041
|
handler: async (_args, ctx) => {
|
|
782
1042
|
return await httpGet({ config: ctx.config, toolName: "get_quota" }, "/v1/quota");
|
|
@@ -784,20 +1044,20 @@ var getQuotaTool = {
|
|
|
784
1044
|
};
|
|
785
1045
|
|
|
786
1046
|
// src/tools/list-usage.ts
|
|
787
|
-
import { z as
|
|
788
|
-
var
|
|
789
|
-
type:
|
|
790
|
-
search:
|
|
791
|
-
startDate:
|
|
792
|
-
endDate:
|
|
793
|
-
currentPage:
|
|
794
|
-
pageSize:
|
|
1047
|
+
import { z as z27 } from "zod";
|
|
1048
|
+
var inputSchema26 = {
|
|
1049
|
+
type: z27.enum(BILLABLE_FEATURE_TYPES).optional().describe("Filter to a single billable feature type. Omit to return all types."),
|
|
1050
|
+
search: z27.string().min(1).optional().describe("Case-insensitive partial match on the user's name or email."),
|
|
1051
|
+
startDate: z27.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."),
|
|
1052
|
+
endDate: z27.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."),
|
|
1053
|
+
currentPage: z27.number().int().min(1).optional().describe("Page number, 1-indexed. Defaults to 1."),
|
|
1054
|
+
pageSize: z27.number().int().min(1).max(200).optional().describe("Items per page (max 200). Defaults to 50.")
|
|
795
1055
|
};
|
|
796
1056
|
var listUsageTool = {
|
|
797
1057
|
name: "list_usage",
|
|
798
1058
|
title: "List Billable Usage Logs",
|
|
799
1059
|
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).",
|
|
800
|
-
inputSchema:
|
|
1060
|
+
inputSchema: inputSchema26,
|
|
801
1061
|
annotations: { readOnlyHint: true },
|
|
802
1062
|
handler: async (args, ctx) => {
|
|
803
1063
|
return await httpGet(
|
|
@@ -828,6 +1088,15 @@ var allTools = [
|
|
|
828
1088
|
createNicheDiveTool,
|
|
829
1089
|
rediveNicheTool,
|
|
830
1090
|
getDiveStatusTool,
|
|
1091
|
+
addRankRadarSearchTermsTool,
|
|
1092
|
+
pauseRankRadarSearchTermsTool,
|
|
1093
|
+
resumeRankRadarSearchTermsTool,
|
|
1094
|
+
pauseRankRadarTool,
|
|
1095
|
+
resumeRankRadarTool,
|
|
1096
|
+
deleteRankRadarTool,
|
|
1097
|
+
deleteNicheTool,
|
|
1098
|
+
generateListingCopyTool,
|
|
1099
|
+
getListingCopyGenerationStatusTool,
|
|
831
1100
|
listSellerProfilesTool,
|
|
832
1101
|
getSellerCatalogTool,
|
|
833
1102
|
getSellerListingChangesTool,
|