mcp-scraper 0.74.0 → 0.75.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.
@@ -32,7 +32,7 @@ import {
32
32
  } from "./chunk-VXLU74YZ.js";
33
33
  import {
34
34
  PACKAGE_VERSION
35
- } from "./chunk-O5IRADYV.js";
35
+ } from "./chunk-RDPWFAR3.js";
36
36
  import {
37
37
  createPrivateArtifact,
38
38
  privateArtifactOwnerId,
@@ -45,7 +45,7 @@ import {
45
45
  PAA_QUESTION_CREDITS,
46
46
  PAGE_SCRAPE_CREDITS,
47
47
  SERP_SEARCH_CREDITS
48
- } from "./chunk-EQJRPDUS.js";
48
+ } from "./chunk-6W4ADSWE.js";
49
49
  import {
50
50
  PUBLIC_ERROR_CODES,
51
51
  buildPublicErrorEnvelope,
@@ -640,6 +640,18 @@ var FIELD_DESCRIPTIONS = {
640
640
  eventName: "Optional normalized analytics event-name filter.",
641
641
  eventId: "Caller-owned canonical event identifier used for end-to-end deduplication.",
642
642
  eventKind: "Canonical event family used for journey storage and conversion-rule evaluation.",
643
+ definitionId: "Browser event-definition identifier returned by analytics_list_event_definitions.",
644
+ timeoutMs: "Bounded server wait in milliseconds before returning a not-observed result.",
645
+ maxAgeSeconds: "Maximum age in seconds for a persisted matching event to count as live verification.",
646
+ operatingAccountId: "Google Ads operating account identifier required for Google Data Manager destinations.",
647
+ destinationId: "Activation destination identifier returned by analytics_list_activation_destinations.",
648
+ previewFingerprint: "Exact SHA-256 fingerprint returned by analytics_preview_crm_import.",
649
+ acknowledgedPurpose: "Explicit governed purpose acknowledgement required for advertising identifiers or activation exports.",
650
+ mappings: "Bounded typed event-mapping rows for this activation destination.",
651
+ providerEvent: "Exact provider event or conversion-action name receiving the confirmed X-Ray event.",
652
+ role: "Primary conversion or supporting observation role for this enabled mapping.",
653
+ valueMode: "Whether the provider event receives no value, the confirmed event value, or a fixed configured value.",
654
+ fixedValue: "Non-negative fixed major-unit value used only when valueMode is fixed.",
643
655
  occurredAt: "ISO 8601 timestamp when the source event actually occurred.",
644
656
  sourceEventId: "Stable identifier assigned by the source system for idempotent ingestion.",
645
657
  sourceAccountRef: "Stable non-secret account identifier at the phone, CRM, or event source.",
@@ -11516,15 +11528,17 @@ var AnalyticsReportTypeSchema = z8.enum([
11516
11528
  "sessions",
11517
11529
  "funnel"
11518
11530
  ]);
11519
- var AnalyticsAttributionModelSchema = z8.enum([
11531
+ var AnalyticsAttributionModelInputSchema = z8.enum([
11520
11532
  "first_touch",
11521
11533
  "last_touch",
11522
11534
  "last_non_direct",
11523
11535
  "linear",
11524
11536
  "time_decay",
11525
11537
  "position_based",
11538
+ "position_40_20_40",
11526
11539
  "custom_weighted"
11527
11540
  ]);
11541
+ var AnalyticsAttributionModelSchema = AnalyticsAttributionModelInputSchema.transform((model) => model === "position_40_20_40" ? "position_based" : model);
11528
11542
  var AnalyticsAttributionWindowSchema = z8.union([
11529
11543
  z8.literal(7),
11530
11544
  z8.literal(14),
@@ -11780,6 +11794,46 @@ var AnalyticsSavedViewSchema = z8.object({
11780
11794
  createdAt: z8.string().datetime().optional(),
11781
11795
  updatedAt: z8.string().datetime().optional()
11782
11796
  }).strict();
11797
+ var AnalyticsAttributionQuerySchema = z8.object({
11798
+ model: AnalyticsAttributionModelSchema.default("position_based"),
11799
+ clickWindow: z8.union([z8.coerce.number().int(), z8.literal("lifetime")]).pipe(AnalyticsAttributionWindowSchema).default(90),
11800
+ viewWindow: z8.union([z8.coerce.number().int(), z8.literal("lifetime")]).pipe(AnalyticsAttributionWindowSchema).default(30),
11801
+ journeyTier: AnalyticsJourneyTierSchema.default("confirmed"),
11802
+ compareModels: z8.array(AnalyticsAttributionModelSchema).max(2).default([]),
11803
+ customWeights: z8.object({
11804
+ first: z8.number().finite().min(0),
11805
+ middle: z8.number().finite().min(0),
11806
+ last: z8.number().finite().min(0)
11807
+ }).strict().optional()
11808
+ }).strict().superRefine((query, ctx) => {
11809
+ const usesCustomWeights = query.model === "custom_weighted" || query.compareModels.includes("custom_weighted");
11810
+ if (usesCustomWeights && !query.customWeights) {
11811
+ ctx.addIssue({ code: "custom", path: ["customWeights"], message: "custom_weighted requires first, middle, and last weights." });
11812
+ }
11813
+ if (!usesCustomWeights && query.customWeights) {
11814
+ ctx.addIssue({ code: "custom", path: ["customWeights"], message: "customWeights is only valid for custom_weighted." });
11815
+ }
11816
+ if (query.customWeights && query.customWeights.first + query.customWeights.middle + query.customWeights.last <= 0) {
11817
+ ctx.addIssue({ code: "custom", path: ["customWeights"], message: "Custom weights must have a positive total." });
11818
+ }
11819
+ if (query.compareModels.includes(query.model)) {
11820
+ ctx.addIssue({ code: "custom", path: ["compareModels"], message: "Comparison models must differ from the primary model." });
11821
+ }
11822
+ if (new Set(query.compareModels).size !== query.compareModels.length) {
11823
+ ctx.addIssue({ code: "custom", path: ["compareModels"], message: "Comparison models must be unique." });
11824
+ }
11825
+ });
11826
+ function parseAnalyticsAttributionQuery(input) {
11827
+ const weights = input.customWeights?.split(",").map((value) => Number(value.trim()));
11828
+ return AnalyticsAttributionQuerySchema.parse({
11829
+ model: input.attributionModel || void 0,
11830
+ clickWindow: input.clickWindow || void 0,
11831
+ viewWindow: input.viewWindow || void 0,
11832
+ journeyTier: input.journeyTier || void 0,
11833
+ compareModels: input.compareModels ?? [],
11834
+ customWeights: weights ? { first: weights[0], middle: weights[1], last: weights[2] } : void 0
11835
+ });
11836
+ }
11783
11837
  function parseAnalyticsReportView(input) {
11784
11838
  return AnalyticsReportViewSchema.parse(input);
11785
11839
  }
@@ -12062,6 +12116,7 @@ var AnalyticsCrmOutboundReceiptSchema = z10.object({
12062
12116
  }).strict();
12063
12117
 
12064
12118
  // src/mcp/analytics-mcp-schemas.ts
12119
+ var AnalyticsLegacyIdempotencyKey = z11.string().trim().min(8).max(160).describe("Retry key; reuse only for this exact mutation.");
12065
12120
  var AnalyticsListSitesInputSchema = {};
12066
12121
  var AnalyticsGetEntitlementInputSchema = {};
12067
12122
  var AnalyticsReportInputSchema = {
@@ -12113,7 +12168,8 @@ var AnalyticsCreateCampaignLinkInputSchema = {
12113
12168
  content: z11.string().max(240).optional(),
12114
12169
  adGroup: z11.string().max(240).optional(),
12115
12170
  adName: z11.string().max(240).optional(),
12116
- creativeId: z11.string().max(240).optional()
12171
+ creativeId: z11.string().max(240).optional(),
12172
+ idempotencyKey: AnalyticsLegacyIdempotencyKey
12117
12173
  };
12118
12174
  var AnalyticsCreateFormInputSchema = {
12119
12175
  siteId: z11.string().uuid(),
@@ -12135,14 +12191,17 @@ var AnalyticsCreateFormInputSchema = {
12135
12191
  submitLabel: z11.string().min(1).max(80).optional(),
12136
12192
  successMessage: z11.string().min(1).max(500).optional(),
12137
12193
  consentText: z11.string().max(1e3).optional(),
12138
- publish: z11.boolean().default(true)
12194
+ publish: z11.boolean().default(true),
12195
+ idempotencyKey: AnalyticsLegacyIdempotencyKey
12139
12196
  };
12140
12197
  var AnalyticsCreateActivationInputSchema = {
12141
12198
  siteId: z11.string().uuid(),
12142
12199
  platform: z11.enum(["meta", "google", "tiktok", "reddit"]),
12143
12200
  name: z11.string().min(1).max(120),
12144
12201
  connectionRef: z11.string().trim().min(1).max(240),
12145
- externalDatasetId: z11.string().trim().min(1).max(240)
12202
+ externalDatasetId: z11.string().trim().min(1).max(240),
12203
+ operatingAccountId: z11.string().trim().min(1).max(256).optional(),
12204
+ idempotencyKey: AnalyticsLegacyIdempotencyKey
12146
12205
  };
12147
12206
  var AnalyticsCreateConnectionInputSchema = {
12148
12207
  siteId: z11.string().uuid(),
@@ -12151,7 +12210,8 @@ var AnalyticsCreateConnectionInputSchema = {
12151
12210
  sourceAccountRef: z11.string().min(1).max(240),
12152
12211
  serviceConnectionRef: z11.string().max(240).optional(),
12153
12212
  webhookSecret: z11.string().min(8).max(1e3).optional(),
12154
- config: z11.record(z11.string(), z11.unknown()).optional()
12213
+ config: z11.record(z11.string(), z11.unknown()).optional(),
12214
+ idempotencyKey: AnalyticsLegacyIdempotencyKey
12155
12215
  };
12156
12216
  var AnalyticsCreateRuleInputSchema = {
12157
12217
  siteId: z11.string().uuid(),
@@ -12170,7 +12230,8 @@ var AnalyticsCreateRuleInputSchema = {
12170
12230
  }),
12171
12231
  defaultValueMinor: z11.number().int().min(0).max(Number.MAX_SAFE_INTEGER).optional(),
12172
12232
  defaultCurrency: z11.string().length(3).default("USD"),
12173
- enabled: z11.boolean().default(true)
12233
+ enabled: z11.boolean().default(true),
12234
+ idempotencyKey: AnalyticsLegacyIdempotencyKey
12174
12235
  };
12175
12236
  var AnalyticsEventDefinitionFields = {
12176
12237
  name: z11.string().min(1).max(120).describe("Human-readable definition name unique within the Site."),
@@ -12192,7 +12253,8 @@ var AnalyticsEventDefinitionFields = {
12192
12253
  };
12193
12254
  var AnalyticsCreateEventDefinitionInputSchema = {
12194
12255
  siteId: z11.string().uuid(),
12195
- ...AnalyticsEventDefinitionFields
12256
+ ...AnalyticsEventDefinitionFields,
12257
+ idempotencyKey: AnalyticsLegacyIdempotencyKey
12196
12258
  };
12197
12259
  var AnalyticsUpdateEventDefinitionInputSchema = {
12198
12260
  siteId: z11.string().uuid(),
@@ -12206,11 +12268,13 @@ var AnalyticsUpdateEventDefinitionInputSchema = {
12206
12268
  hostnames: z11.array(z11.string().min(1).max(253)).max(25).optional().describe("Replacement approved bare-hostname scope."),
12207
12269
  metadata: AnalyticsEventDefinitionFields.metadata.unwrap().nullable().optional().describe("Replacement safe metadata; null clears it."),
12208
12270
  oncePerSession: z11.boolean().optional().describe("Replacement once-per-browser-session behavior."),
12209
- enabled: z11.boolean().optional().describe("Replacement enabled state.")
12271
+ enabled: z11.boolean().optional().describe("Replacement enabled state."),
12272
+ idempotencyKey: AnalyticsLegacyIdempotencyKey
12210
12273
  };
12211
12274
  var AnalyticsArchiveEventDefinitionInputSchema = {
12212
12275
  siteId: z11.string().uuid(),
12213
- definitionId: z11.string().uuid().describe("Event definition id returned by analytics_list_event_definitions.")
12276
+ definitionId: z11.string().uuid().describe("Event definition id returned by analytics_list_event_definitions."),
12277
+ idempotencyKey: AnalyticsLegacyIdempotencyKey
12214
12278
  };
12215
12279
  var AnalyticsTestEventDefinitionInputSchema = {
12216
12280
  siteId: z11.string().uuid(),
@@ -12221,11 +12285,18 @@ var AnalyticsTestEventDefinitionInputSchema = {
12221
12285
  tagEventName: z11.string().regex(/^[a-z][a-z0-9_]{1,79}$/).optional().describe("Validated data-xray-event name observed by the browser."),
12222
12286
  selectorMatched: z11.boolean().optional().describe("The browser-reported match result. The server never receives HTML or evaluates a selector.")
12223
12287
  };
12288
+ var AnalyticsVerifyLiveEventDefinitionInputSchema = {
12289
+ siteId: z11.string().uuid(),
12290
+ definitionId: z11.string().uuid(),
12291
+ timeoutMs: z11.number().int().min(0).max(15e3).default(0).describe("Bounded wait for a newly persisted matching event."),
12292
+ maxAgeSeconds: z11.number().int().min(1).max(86400).default(300).describe("Maximum accepted age of the persisted matching event.")
12293
+ };
12224
12294
  var AnalyticsTestActivationDestinationInputSchema = {
12225
12295
  siteId: z11.string().uuid(),
12226
12296
  destinationId: z11.string().uuid().describe("Activation destination id returned by analytics_list_activation_destinations."),
12227
12297
  testEventCode: z11.string().trim().min(1).max(128).optional().describe("Provider test event code required by Meta and TikTok. Obtain it from the authorized provider test-events screen; it is sent only to that configured destination."),
12228
- testId: z11.string().trim().min(1).max(255).optional().describe("Provider test ID required by Reddit Conversions API. It is sent only to that configured destination.")
12298
+ testId: z11.string().trim().min(1).max(255).optional().describe("Provider test ID required by Reddit Conversions API. It is sent only to that configured destination."),
12299
+ idempotencyKey: AnalyticsLegacyIdempotencyKey
12229
12300
  };
12230
12301
  var AnalyticsListActivationReceiptsInputSchema = {
12231
12302
  siteId: z11.string().uuid(),
@@ -12235,11 +12306,13 @@ var AnalyticsListActivationReceiptsInputSchema = {
12235
12306
  };
12236
12307
  var AnalyticsRetryActivationDeliveryInputSchema = {
12237
12308
  siteId: z11.string().uuid(),
12238
- jobId: z11.string().uuid().describe("Failed activation job id returned by analytics_list_activation_receipts.")
12309
+ jobId: z11.string().uuid().describe("Failed activation job id returned by analytics_list_activation_receipts."),
12310
+ idempotencyKey: AnalyticsLegacyIdempotencyKey
12239
12311
  };
12240
12312
  var AnalyticsReconcileConnectionInputSchema = {
12241
12313
  siteId: z11.string().uuid(),
12242
- connectionId: z11.string().uuid().describe("Phone or CRM connection id returned by analytics_list_connections.")
12314
+ connectionId: z11.string().uuid().describe("Phone or CRM connection id returned by analytics_list_connections."),
12315
+ idempotencyKey: AnalyticsLegacyIdempotencyKey
12243
12316
  };
12244
12317
  var AnalyticsRecordExternalEventInputSchema = {
12245
12318
  siteId: z11.string().uuid(),
@@ -12277,7 +12350,8 @@ var AnalyticsRecordExternalEventInputSchema = {
12277
12350
  li_fat_id: z11.string().max(500).optional(),
12278
12351
  snapclid: z11.string().max(500).optional()
12279
12352
  }).optional(),
12280
- properties: z11.record(z11.string(), z11.unknown()).optional()
12353
+ properties: z11.record(z11.string(), z11.unknown()).optional(),
12354
+ idempotencyKey: AnalyticsLegacyIdempotencyKey
12281
12355
  };
12282
12356
  var AnalyticsJourneyInputSchema = {
12283
12357
  siteId: z11.string().uuid(),
@@ -12296,7 +12370,68 @@ var AnalyticsCrmImportInputSchema = {
12296
12370
  phone: z11.string().optional(),
12297
12371
  company: z11.string().optional(),
12298
12372
  externalId: z11.string().optional()
12299
- })
12373
+ }),
12374
+ idempotencyKey: AnalyticsLegacyIdempotencyKey
12375
+ };
12376
+ var AnalyticsManualImportMapping = z11.record(z11.enum([
12377
+ "email",
12378
+ "firstName",
12379
+ "lastName",
12380
+ "name",
12381
+ "phone",
12382
+ "company",
12383
+ "externalId",
12384
+ "stage",
12385
+ "outcome",
12386
+ "occurredAt",
12387
+ "value",
12388
+ "currency",
12389
+ "gclid",
12390
+ "gbraid",
12391
+ "wbraid",
12392
+ "fbclid"
12393
+ ]), z11.string().trim().min(1).max(240));
12394
+ var AnalyticsManualImportFields = {
12395
+ siteId: z11.string().uuid(),
12396
+ sourceSystem: z11.enum(["hubspot", "salesforce", "gohighlevel", "zoho", "pipedrive", "keap", "other"]),
12397
+ filename: z11.string().trim().min(1).max(240),
12398
+ csv: z11.string().min(1).max(8e6),
12399
+ mapping: AnalyticsManualImportMapping
12400
+ };
12401
+ var AnalyticsPreviewCrmImportInputSchema = AnalyticsManualImportFields;
12402
+ var AnalyticsCommitCrmImportInputSchema = {
12403
+ ...AnalyticsManualImportFields,
12404
+ previewFingerprint: z11.string().regex(/^[a-f0-9]{64}$/),
12405
+ idempotencyKey: AnalyticsLegacyIdempotencyKey
12406
+ };
12407
+ var AnalyticsCrmExportField = z11.enum([
12408
+ "person_id",
12409
+ "crm_person_ref",
12410
+ "journey_url",
12411
+ "first_seen_at",
12412
+ "last_seen_at",
12413
+ "signal_count",
12414
+ "form_submission_count",
12415
+ "conversion_count",
12416
+ "revenue_minor",
12417
+ "currency",
12418
+ "stage",
12419
+ "outcome",
12420
+ "gclid",
12421
+ "gbraid",
12422
+ "wbraid",
12423
+ "fbclid"
12424
+ ]);
12425
+ var AnalyticsCrmManualExportInputSchema = {
12426
+ siteId: z11.string().uuid(),
12427
+ fields: z11.array(AnalyticsCrmExportField).min(1).max(16).optional(),
12428
+ acknowledgedPurpose: z11.enum(["business_operations", "advertising_measurement"]).optional(),
12429
+ idempotencyKey: AnalyticsLegacyIdempotencyKey
12430
+ };
12431
+ var AnalyticsAdManualExportInputSchema = {
12432
+ siteId: z11.string().uuid(),
12433
+ acknowledgedPurpose: z11.literal("advertising_measurement"),
12434
+ idempotencyKey: AnalyticsLegacyIdempotencyKey
12300
12435
  };
12301
12436
  var AnalyticsCreateExportInputSchema = {
12302
12437
  ...AnalyticsReportInputSchema,
@@ -12589,7 +12724,31 @@ var AnalyticsActivationMappingInputSchema = {
12589
12724
  journeyTier: z11.literal("confirmed").default("confirmed").describe("External activation is confirmed-only. Best-guess and candidate-assisted journey evidence is schema-invalid."),
12590
12725
  platform: z11.enum(["meta", "google", "tiktok", "reddit"]).describe("Destination provider."),
12591
12726
  externalDatasetId: z11.string().min(1).max(500).describe("Authorized dataset, Pixel, or conversion-action id."),
12592
- eventMapping: z11.record(z11.string().regex(/^[a-z][a-z0-9_]{1,79}$/), z11.string().min(1).max(160)).describe("Confirmed X-Ray event to provider event mapping. Candidate-assisted events are ineligible.")
12727
+ eventMapping: z11.record(z11.string().regex(/^[a-z][a-z0-9_]{1,79}$/), z11.string().min(1).max(160)).describe("Confirmed X-Ray event to provider event mapping.")
12728
+ };
12729
+ var AnalyticsSaveActivationMappingInputSchema = {
12730
+ siteId: z11.string().uuid(),
12731
+ destinationId: z11.string().uuid(),
12732
+ journeyTier: z11.literal("confirmed").default("confirmed"),
12733
+ eventMapping: z11.object({
12734
+ schemaVersion: z11.literal(1),
12735
+ mappings: z11.array(z11.object({
12736
+ source: z11.string().min(1).max(160),
12737
+ providerEvent: z11.string().min(1).max(160),
12738
+ enabled: z11.boolean(),
12739
+ role: z11.enum(["primary", "observation"]),
12740
+ valueMode: z11.enum(["none", "event", "fixed"]),
12741
+ fixedValue: z11.number().finite().min(0).max(1e9).optional(),
12742
+ currency: z11.string().length(3).optional()
12743
+ }).strict()).max(200)
12744
+ }).strict().describe("Typed confirmed-event mapping; enabled rows require exactly one primary event."),
12745
+ idempotencyKey: AnalyticsLegacyIdempotencyKey
12746
+ };
12747
+ var AnalyticsSetActivationAutomationInputSchema = {
12748
+ siteId: z11.string().uuid(),
12749
+ destinationId: z11.string().uuid(),
12750
+ enabled: z11.boolean().describe("Explicitly enable or disable automatic delivery. Enabling requires a verified destination."),
12751
+ idempotencyKey: AnalyticsLegacyIdempotencyKey
12593
12752
  };
12594
12753
  var AnalyticsListSitesOutputSchema = {
12595
12754
  ok: z11.boolean(),
@@ -12641,9 +12800,103 @@ var AnalyticsReportOutputSchema = {
12641
12800
  };
12642
12801
  var AnalyticsGenericOutputSchema = { ok: z11.boolean() };
12643
12802
  var AnalyticsSafeOutputRecord = z11.record(z11.string(), z11.unknown());
12644
- var AnalyticsSafeOutputRecords = z11.array(AnalyticsSafeOutputRecord);
12803
+ var AnalyticsSafeOutputRecords = z11.array(AnalyticsSafeOutputRecord).max(500);
12645
12804
  var analyticsRecordOutput = (field) => ({ ok: z11.boolean(), [field]: AnalyticsSafeOutputRecord });
12646
12805
  var analyticsRecordsOutput = (field) => ({ ok: z11.boolean(), [field]: AnalyticsSafeOutputRecords });
12806
+ var AnalyticsManualImportPreviewOutputSchema = {
12807
+ ok: z11.boolean(),
12808
+ preview: z11.object({
12809
+ schemaVersion: z11.literal(1),
12810
+ fingerprint: z11.string().regex(/^[a-f0-9]{64}$/),
12811
+ headers: z11.array(z11.string().max(240)).max(240),
12812
+ totalRows: z11.number().int().min(0).max(2500),
12813
+ acceptedRows: z11.number().int().min(0).max(2500),
12814
+ rejectedRows: z11.number().int().min(0).max(2500),
12815
+ sample: z11.array(AnalyticsSafeOutputRecord).max(5),
12816
+ errors: z11.array(AnalyticsSafeOutputRecord).max(100),
12817
+ errorReceipt: AnalyticsSafeOutputRecord.nullable()
12818
+ }).strict()
12819
+ };
12820
+ var AnalyticsManualImportCommitOutputSchema = {
12821
+ ok: z11.boolean(),
12822
+ import: AnalyticsSafeOutputRecord,
12823
+ receipt: AnalyticsSafeOutputRecord
12824
+ };
12825
+ var AnalyticsManualExportOutputSchema = {
12826
+ ok: z11.boolean(),
12827
+ artifact: z11.object({
12828
+ schemaVersion: z11.string().min(1).max(120),
12829
+ kind: z11.enum(["crm_csv", "google_ads_offline_csv", "meta_conversions_api_jsonl"]),
12830
+ filename: z11.string().min(1).max(500),
12831
+ mediaType: z11.string().min(1).max(160),
12832
+ nativeUploadSupported: z11.boolean(),
12833
+ label: z11.string().min(1).max(500),
12834
+ content: z11.string().max(65536),
12835
+ rowCount: z11.number().int().min(0).max(2500),
12836
+ omittedForConsent: z11.number().int().min(0)
12837
+ }).strict()
12838
+ };
12839
+ var AnalyticsActivationDestinationOutputSchema = analyticsRecordOutput("destination");
12840
+ var AnalyticsLiveEventVerificationOutputSchema = {
12841
+ ok: z11.boolean(),
12842
+ verification: z11.object({
12843
+ status: z11.enum(["observed_live_match", "not_observed"]),
12844
+ definitionId: z11.string().uuid(),
12845
+ definitionVersion: z11.number().int().positive(),
12846
+ eventId: z11.string().min(8).max(200).nullable(),
12847
+ observedAt: z11.string().datetime().nullable(),
12848
+ maxAgeSeconds: z11.number().int().min(1).max(86400)
12849
+ }).strict()
12850
+ };
12851
+ var AnalyticsLegacyOperationOutputSchemas = {
12852
+ analytics_get_timeseries: AnalyticsReportOutputSchema,
12853
+ analytics_get_events: AnalyticsReportOutputSchema,
12854
+ analytics_get_dimensions: AnalyticsReportOutputSchema,
12855
+ analytics_get_business_metrics: AnalyticsReportOutputSchema,
12856
+ analytics_get_forecast: analyticsRecordOutput("data"),
12857
+ analytics_list_pixels: analyticsRecordsOutput("pixels"),
12858
+ analytics_list_campaign_links: analyticsRecordOutput("data"),
12859
+ analytics_list_forms: analyticsRecordOutput("data"),
12860
+ analytics_list_crm_imports: analyticsRecordOutput("data"),
12861
+ analytics_list_activation_destinations: analyticsRecordsOutput("destinations"),
12862
+ analytics_list_connections: analyticsRecordsOutput("connections"),
12863
+ analytics_list_conversion_rules: analyticsRecordsOutput("rules"),
12864
+ analytics_list_event_definitions: analyticsRecordsOutput("definitions"),
12865
+ analytics_get_coverage: analyticsRecordOutput("coverage"),
12866
+ analytics_get_person_journey: analyticsRecordOutput("journey"),
12867
+ analytics_create_campaign_link: analyticsRecordOutput("link"),
12868
+ analytics_create_form: analyticsRecordOutput("form"),
12869
+ analytics_create_activation_destination: analyticsRecordOutput("destination"),
12870
+ analytics_create_connection: {
12871
+ ok: z11.boolean(),
12872
+ connection: AnalyticsSafeOutputRecord,
12873
+ webhookUrl: z11.string().url().max(3e3)
12874
+ },
12875
+ analytics_create_conversion_rule: analyticsRecordOutput("rule"),
12876
+ analytics_create_event_definition: analyticsRecordOutput("definition"),
12877
+ analytics_record_external_event: {
12878
+ ok: z11.boolean(),
12879
+ id: z11.string().uuid().nullable(),
12880
+ created: z11.boolean(),
12881
+ personId: z11.string().uuid().nullable(),
12882
+ identityTier: z11.enum(["confirmed", "unlinked"]),
12883
+ namespaceId: z11.string().uuid().nullable(),
12884
+ conversionIds: z11.array(z11.string().uuid()).max(500),
12885
+ consentEligibility: AnalyticsSafeOutputRecord,
12886
+ valueProvenance: z11.record(z11.string(), AnalyticsSafeOutputRecord),
12887
+ scoreEvaluationIds: z11.array(z11.string().min(1).max(240)).max(500),
12888
+ predictionEvidence: z11.unknown(),
12889
+ candidatePromotion: AnalyticsSafeOutputRecord.nullable()
12890
+ },
12891
+ analytics_import_crm_csv: analyticsRecordOutput("import"),
12892
+ analytics_update_event_definition: analyticsRecordOutput("definition"),
12893
+ analytics_archive_event_definition: analyticsRecordOutput("definition"),
12894
+ analytics_test_event_definition: analyticsRecordOutput("test"),
12895
+ analytics_test_activation_destination: analyticsRecordOutput("test"),
12896
+ analytics_list_activation_receipts: analyticsRecordsOutput("receipts"),
12897
+ analytics_retry_activation_delivery: analyticsRecordOutput("job"),
12898
+ analytics_reconcile_connection: analyticsRecordOutput("reconciliation")
12899
+ };
12647
12900
  var AnalyticsJourneyRevenueSchema = z11.object({
12648
12901
  valueMinor: z11.number().int().min(0).max(Number.MAX_SAFE_INTEGER),
12649
12902
  currency: z11.string().length(3).nullable()
@@ -13063,7 +13316,15 @@ var productionOutputSchemas = {
13063
13316
  analytics_export_privacy_subject: AnalyticsPrivacyExportOutputSchema,
13064
13317
  analytics_delete_privacy_subject: AnalyticsPrivacyDeleteOutputSchema,
13065
13318
  analytics_discover_activation_assets: AnalyticsActivationAssetsOutputSchema,
13066
- analytics_validate_activation_mapping: AnalyticsActivationMappingOutputSchema
13319
+ analytics_validate_activation_mapping: AnalyticsActivationMappingOutputSchema,
13320
+ analytics_preview_crm_import: AnalyticsManualImportPreviewOutputSchema,
13321
+ analytics_commit_crm_import: AnalyticsManualImportCommitOutputSchema,
13322
+ analytics_export_crm_csv: AnalyticsManualExportOutputSchema,
13323
+ analytics_export_google_ads_csv: AnalyticsManualExportOutputSchema,
13324
+ analytics_export_meta_technical: AnalyticsManualExportOutputSchema,
13325
+ analytics_save_activation_mapping: AnalyticsActivationDestinationOutputSchema,
13326
+ analytics_set_activation_automation: AnalyticsActivationDestinationOutputSchema,
13327
+ analytics_verify_live_event_definition: AnalyticsLiveEventVerificationOutputSchema
13067
13328
  };
13068
13329
  var ANALYTICS_MCP_RESULT_MAX_BYTES = 65536;
13069
13330
  var ANALYTICS_RESTRICTED_RESULT_KEY = /^(?:email|emailAddress|phone|phoneNumber|contact|contactInfo|rawIp|ipAddress|deviceId|userAgent|gclid|fbclid|ttclid|msclkid|accessToken|refreshToken|authorization|cookie|password|secret)$/i;
@@ -13073,18 +13334,31 @@ function redactAnalyticsResult(value, depth = 0) {
13073
13334
  if (!value || typeof value !== "object") return value;
13074
13335
  return Object.fromEntries(Object.entries(value).map(([key, item]) => [
13075
13336
  key,
13076
- ANALYTICS_RESTRICTED_RESULT_KEY.test(key) ? "[redacted]" : redactAnalyticsResult(item, depth + 1)
13337
+ ANALYTICS_RESTRICTED_RESULT_KEY.test(key.replace(/[-_\s]/g, "")) ? "[redacted]" : redactAnalyticsResult(item, depth + 1)
13077
13338
  ]));
13078
13339
  }
13079
13340
  function safeAnalyticsResult(result) {
13080
13341
  const textPart = result.content.find((part) => part.type === "text");
13081
- if (!textPart || textPart.type !== "text") return result;
13082
- let parsed;
13083
- try {
13084
- parsed = JSON.parse(textPart.text);
13085
- } catch {
13086
- if (new TextEncoder().encode(textPart.text).byteLength <= ANALYTICS_MCP_RESULT_MAX_BYTES) return result;
13087
- parsed = null;
13342
+ let parsed = result.structuredContent;
13343
+ if (parsed === void 0 && textPart?.type === "text") {
13344
+ try {
13345
+ parsed = JSON.parse(textPart.text);
13346
+ } catch {
13347
+ const bounded = {
13348
+ ok: false,
13349
+ error: "analytics_result_invalid",
13350
+ message: "The analytics service returned a non-JSON result. Retry once; if it persists, inspect X-Ray health."
13351
+ };
13352
+ return { content: [{ type: "text", text: JSON.stringify(bounded) }], structuredContent: bounded, isError: true };
13353
+ }
13354
+ }
13355
+ if (parsed === void 0) {
13356
+ const bounded = {
13357
+ ok: false,
13358
+ error: "analytics_result_invalid",
13359
+ message: "The analytics service returned no structured result. Retry once; if it persists, inspect X-Ray health."
13360
+ };
13361
+ return { content: [{ type: "text", text: JSON.stringify(bounded) }], structuredContent: bounded, isError: true };
13088
13362
  }
13089
13363
  const sanitized = redactAnalyticsResult(parsed);
13090
13364
  const serialized = JSON.stringify(sanitized);
@@ -13101,25 +13375,25 @@ function safeAnalyticsResult(result) {
13101
13375
  }
13102
13376
  return {
13103
13377
  ...result,
13104
- content: result.content.map((part) => part === textPart ? { type: "text", text: serialized } : part),
13378
+ content: textPart ? result.content.map((part) => part === textPart ? { type: "text", text: serialized } : part) : [{ type: "text", text: serialized }, ...result.content],
13105
13379
  structuredContent: sanitized
13106
13380
  };
13107
13381
  }
13108
13382
  function registerAnalyticsMcpTools(server, executor) {
13109
13383
  server.registerTool("analytics_get_entitlement", {
13110
13384
  title: "Get X-Ray Pixel Access",
13111
- description: "Check whether Thorbit X-Ray Pixel is connected and entitled for this MCP Scraper account. X-Ray Pixel is owned and billed by Thorbit, requires an active $50+ Thorbit subscription after its 30-day trial, and does not consume MCP Scraper Credits. Call this before analytics_list_sites when access may not be configured. Account linking must be completed in the MCP Scraper dashboard; never ask a user to paste a Thorbit API key into an AI conversation.",
13385
+ description: "Check X-Ray access before analytics_list_sites. X-Ray is billed by Thorbit and uses no MCP Scraper Credits. Link only in the dashboard; never request its API key.",
13112
13386
  inputSchema: AnalyticsGetEntitlementInputSchema,
13113
13387
  outputSchema: recordOutputSchema("analytics_get_entitlement", AnalyticsGetEntitlementOutputSchema),
13114
13388
  annotations: readAnnotations("Get X-Ray Pixel Access")
13115
- }, async (input) => executor.analyticsGetEntitlement(input));
13389
+ }, async (input) => safeAnalyticsResult(await executor.analyticsGetEntitlement(input)));
13116
13390
  server.registerTool("analytics_list_sites", {
13117
13391
  title: "List Analytics Businesses",
13118
- description: "List the authenticated account's analytics Businesses, roles, Pixel counts, and latest activity. Call this first to obtain the siteId used by every analytics report tool. Tenant access is enforced by the analytics API.",
13392
+ description: "List authorized analytics Businesses, roles, Pixel counts, and activity. Call first to obtain the siteId required by analytics tools.",
13119
13393
  inputSchema: AnalyticsListSitesInputSchema,
13120
13394
  outputSchema: recordOutputSchema("analytics_list_sites", AnalyticsListSitesOutputSchema),
13121
13395
  annotations: readAnnotations("List Analytics Businesses")
13122
- }, async (input) => executor.analyticsListSites(input));
13396
+ }, async (input) => safeAnalyticsResult(await executor.analyticsListSites(input)));
13123
13397
  const reports = [
13124
13398
  ["analytics_get_overview", "Analytics Overview", "overview", "analyticsGetOverview"],
13125
13399
  ["analytics_get_acquisition", "Analytics Acquisition", "acquisition", "analyticsGetAcquisition"],
@@ -13131,54 +13405,54 @@ function registerAnalyticsMcpTools(server, executor) {
13131
13405
  for (const [name, title, report, handler] of reports) {
13132
13406
  server.registerTool(name, {
13133
13407
  title,
13134
- description: `Read the ${report} report for one analytics Business. Use analytics_list_sites first. Filters use the same normalized Site, Pixel, hostname, date, source, medium, campaign, and event contract as the dashboard, REST API, and exports.`,
13408
+ description: `Read the ${report} report. Get siteId with analytics_list_sites; filters match dashboard, REST, and exports.`,
13135
13409
  inputSchema: AnalyticsReportInputSchema,
13136
13410
  outputSchema: recordOutputSchema(name, AnalyticsReportOutputSchema),
13137
13411
  annotations: readAnnotations(title)
13138
- }, async (input) => executor[handler](input));
13412
+ }, async (input) => safeAnalyticsResult(await executor[handler](input)));
13139
13413
  }
13140
13414
  const reads = [
13141
- ["analytics_get_timeseries", "Analytics Timeseries", "Read daily time-series rows for an AI-selected line, area, or comparative visualization.", AnalyticsReportInputSchema, "analyticsGetTimeseries"],
13142
- ["analytics_get_events", "Analytics Events", "Read paginated event counts. Follow pageInfo cursors instead of requesting an unbounded result.", AnalyticsPaginatedReportInputSchema, "analyticsGetEvents"],
13143
- ["analytics_get_dimensions", "Analytics Dimensions", "Read visualization-ready device, source, country, region, or weekday-hour rows. Chart recommendations are advisory.", AnalyticsDimensionInputSchema, "analyticsGetDimensions"],
13144
- ["analytics_get_business_metrics", "Analytics Business Metrics", "Read the configured lead-generation, SaaS, or e-commerce metric pack with explicit missing-input signals.", AnalyticsReportInputSchema, "analyticsGetBusinessMetrics"],
13145
- ["analytics_get_forecast", "Analytics Forecast", "Read historical monthly revenue and spend plus bounded forward scenarios and ROAS when enough evidence exists.", AnalyticsSiteResourceInputSchema, "analyticsGetForecast"],
13146
- ["analytics_list_pixels", "List Analytics Pixels", "List Site Pixels, installation snippets, detected domains, approval states, and health.", AnalyticsSiteResourceInputSchema, "analyticsListPixels"],
13147
- ["analytics_list_campaign_links", "List Campaign Links", "List paginated tracked links and canonical UTM and ad hierarchy fields.", AnalyticsSiteResourceInputSchema, "analyticsListCampaignLinks"],
13148
- ["analytics_list_forms", "List Analytics Forms", "List paginated Pixel-linked forms, embed snippets, fields, versions, and submission counts.", AnalyticsSiteResourceInputSchema, "analyticsListForms"],
13149
- ["analytics_list_crm_imports", "List CRM Imports", "List paginated encrypted CSV import receipts without exposing contact PII in analytics.", AnalyticsSiteResourceInputSchema, "analyticsListCrmImports"],
13150
- ["analytics_list_activation_destinations", "List Ad Activation Destinations", "List Meta, Google, TikTok, and Reddit destinations with pending, delivered, and failed conversion counts.", AnalyticsSiteResourceInputSchema, "analyticsListActivationDestinations"],
13151
- ["analytics_list_connections", "List X-Ray Connections", "List phone, CRM, and webhook connections with honest readiness, receipt, and error state.", AnalyticsSiteResourceInputSchema, "analyticsListConnections"],
13152
- ["analytics_list_conversion_rules", "List Conversion Rules", "List deterministic versioned rules that turn canonical phone, CRM, transaction, and server events into conversions.", AnalyticsSiteResourceInputSchema, "analyticsListConversionRules"],
13153
- ["analytics_list_event_definitions", "List Browser Event Definitions", "List declarative page, click, and form-submit tags applied by the first-party X-Ray Pixel.", AnalyticsSiteResourceInputSchema, "analyticsListEventDefinitions"],
13154
- ["analytics_get_coverage", "Get Attribution Coverage", "Measure click-ID coverage and call/CRM journey join rates. Null rates mean there is not yet a denominator.", AnalyticsSiteResourceInputSchema, "analyticsGetCoverage"],
13155
- ["analytics_get_person_journey", "Get Person Journey", "Read CRM-oriented identified-person history: touches, calls, CRM stages, conversions, and delivery receipts. For analytics chronology use analytics_get_visitor_journey.", AnalyticsJourneyInputSchema, "analyticsGetPersonJourney"]
13415
+ ["analytics_get_timeseries", "Analytics Timeseries", "Read bounded daily rows for line, area, or comparison charts.", AnalyticsReportInputSchema, "analyticsGetTimeseries"],
13416
+ ["analytics_get_events", "Analytics Events", "Read paginated event counts; follow pageInfo cursors.", AnalyticsPaginatedReportInputSchema, "analyticsGetEvents"],
13417
+ ["analytics_get_dimensions", "Analytics Dimensions", "Read chart-ready device, source, country, region, or weekday-hour rows.", AnalyticsDimensionInputSchema, "analyticsGetDimensions"],
13418
+ ["analytics_get_business_metrics", "Analytics Business Metrics", "Read the configured business metric pack with explicit missing inputs.", AnalyticsReportInputSchema, "analyticsGetBusinessMetrics"],
13419
+ ["analytics_get_forecast", "Analytics Forecast", "Read historical revenue and spend plus evidence-bounded scenarios.", AnalyticsSiteResourceInputSchema, "analyticsGetForecast"],
13420
+ ["analytics_list_pixels", "List Analytics Pixels", "List Pixels, install snippets, approved domains, and health.", AnalyticsSiteResourceInputSchema, "analyticsListPixels"],
13421
+ ["analytics_list_campaign_links", "List Campaign Links", "List paginated tracked links with UTM and ad hierarchy fields.", AnalyticsSiteResourceInputSchema, "analyticsListCampaignLinks"],
13422
+ ["analytics_list_forms", "List Analytics Forms", "List paginated Pixel-linked forms, embeds, versions, and submission counts.", AnalyticsSiteResourceInputSchema, "analyticsListForms"],
13423
+ ["analytics_list_crm_imports", "List CRM Imports", "List encrypted CSV import receipts without contact PII.", AnalyticsSiteResourceInputSchema, "analyticsListCrmImports"],
13424
+ ["analytics_list_activation_destinations", "List Ad Activation Destinations", "List ad destinations with delivery counts and readiness.", AnalyticsSiteResourceInputSchema, "analyticsListActivationDestinations"],
13425
+ ["analytics_list_connections", "List X-Ray Connections", "List phone, CRM, and webhook connections with readiness and errors.", AnalyticsSiteResourceInputSchema, "analyticsListConnections"],
13426
+ ["analytics_list_conversion_rules", "List Conversion Rules", "List versioned rules that turn canonical events into conversions.", AnalyticsSiteResourceInputSchema, "analyticsListConversionRules"],
13427
+ ["analytics_list_event_definitions", "List Browser Event Definitions", "List declarative page, click, and form-submit Pixel tags.", AnalyticsSiteResourceInputSchema, "analyticsListEventDefinitions"],
13428
+ ["analytics_get_coverage", "Get Attribution Coverage", "Measure click-ID coverage and call/CRM joins; null means no denominator.", AnalyticsSiteResourceInputSchema, "analyticsGetCoverage"],
13429
+ ["analytics_get_person_journey", "Get Person Journey", "Read CRM-oriented identified-person history: touches, calls, stages, conversions, and receipts. For chronology use analytics_get_visitor_journey.", AnalyticsJourneyInputSchema, "analyticsGetPersonJourney"]
13156
13430
  ];
13157
13431
  for (const [name, title, description, inputSchema, handler] of reads) {
13158
13432
  server.registerTool(name, {
13159
13433
  title,
13160
13434
  description,
13161
13435
  inputSchema,
13162
- outputSchema: recordOutputSchema(name, name.startsWith("analytics_get_") ? AnalyticsReportOutputSchema : AnalyticsGenericOutputSchema),
13436
+ outputSchema: recordOutputSchema(name, AnalyticsLegacyOperationOutputSchemas[name]),
13163
13437
  annotations: readAnnotations(title)
13164
- }, async (input) => executor[handler](input));
13438
+ }, async (input) => safeAnalyticsResult(await executor[handler](input)));
13165
13439
  }
13166
13440
  const writes = [
13167
13441
  ["analytics_create_campaign_link", "Create Campaign Link", "Create one tracked campaign URL with canonical UTMs and optional ad-group, ad, and creative identifiers.", AnalyticsCreateCampaignLinkInputSchema, "analyticsCreateCampaignLink", false],
13168
13442
  ["analytics_create_form", "Create Pixel-linked Form", "Create and optionally publish a branded form that inherits the parent Pixel identity and session.", AnalyticsCreateFormInputSchema, "analyticsCreateForm", false],
13169
13443
  ["analytics_create_activation_destination", "Create Ad Activation Destination", "Create a Meta, Google, TikTok, or Reddit conversion destination using an existing provider connection reference.", AnalyticsCreateActivationInputSchema, "analyticsCreateActivation", false],
13170
- ["analytics_create_connection", "Create X-Ray Connection", "Create a CallRail, CallTrackingMetrics, Twilio, HubSpot, HighLevel, or generic CRM connection. Creation is configured-unverified until a signed receipt succeeds.", AnalyticsCreateConnectionInputSchema, "analyticsCreateConnection", false],
13444
+ ["analytics_create_connection", "Create X-Ray Connection", "Create a phone or CRM connection. It remains configured-unverified until a signed receipt succeeds.", AnalyticsCreateConnectionInputSchema, "analyticsCreateConnection", false],
13171
13445
  ["analytics_create_conversion_rule", "Create Conversion Rule", "Create a versioned declarative conversion rule. This is a safe event-routing layer, not arbitrary JavaScript like Google Tag Manager.", AnalyticsCreateRuleInputSchema, "analyticsCreateConversionRule", false],
13172
13446
  ["analytics_create_event_definition", "Create Browser Event Definition", "Create a declarative page, click, or third-party form-submit event tag without injecting arbitrary JavaScript or capturing form fields.", AnalyticsCreateEventDefinitionInputSchema, "analyticsCreateEventDefinition", false],
13173
13447
  ["analytics_record_external_event", "Record Server Event", "Idempotently record a canonical server-side call, CRM, transaction, or custom event and evaluate conversion rules.", AnalyticsRecordExternalEventInputSchema, "analyticsRecordExternalEvent", true],
13174
- ["analytics_import_crm_csv", "Import CRM CSV", "Map and stage a bounded CRM CSV import. Contact fields are encrypted and analytics retains only opaque person references and identity signals.", AnalyticsCrmImportInputSchema, "analyticsImportCrmCsv", false]
13448
+ ["analytics_import_crm_csv", "Legacy CRM CSV Import", "Legacy direct CRM CSV import; prefer preview then commit.", AnalyticsCrmImportInputSchema, "analyticsImportCrmCsv", false]
13175
13449
  ];
13176
13450
  for (const [name, title, description, inputSchema, handler, idempotent] of writes) {
13177
13451
  server.registerTool(name, {
13178
13452
  title,
13179
13453
  description,
13180
13454
  inputSchema,
13181
- outputSchema: recordOutputSchema(name, AnalyticsGenericOutputSchema),
13455
+ outputSchema: recordOutputSchema(name, AnalyticsLegacyOperationOutputSchemas[name]),
13182
13456
  annotations: {
13183
13457
  title,
13184
13458
  readOnlyHint: false,
@@ -13186,12 +13460,12 @@ function registerAnalyticsMcpTools(server, executor) {
13186
13460
  idempotentHint: idempotent,
13187
13461
  openWorldHint: false
13188
13462
  }
13189
- }, async (input) => executor[handler](input));
13463
+ }, async (input) => safeAnalyticsResult(await executor[handler](input)));
13190
13464
  }
13191
13465
  const operations = [
13192
13466
  ["analytics_update_event_definition", "Update Browser Event Definition", "Update a versioned declarative browser event definition. Null path, selector, or metadata clears that optional field.", AnalyticsUpdateEventDefinitionInputSchema, "analyticsUpdateEventDefinition", false, false, false, false],
13193
13467
  ["analytics_archive_event_definition", "Archive Browser Event Definition", "Idempotently archive a browser event definition so the Pixel no longer receives it.", AnalyticsArchiveEventDefinitionInputSchema, "analyticsArchiveEventDefinition", false, true, true, false],
13194
- ["analytics_test_event_definition", "Test Browser Event Definition", "Preview a definition against validated hostname, path, trigger, tag, and browser-reported selector-match facts. This never accepts HTML or executes selectors server-side.", AnalyticsTestEventDefinitionInputSchema, "analyticsTestEventDefinition", true, true, false, false],
13468
+ ["analytics_test_event_definition", "Preview Browser Event Definition", "Preview supplied browser match facts. This is not live event verification: it does not open a site, run selectors, or prove Pixel delivery.", AnalyticsTestEventDefinitionInputSchema, "analyticsTestEventDefinition", true, true, false, false],
13195
13469
  ["analytics_test_activation_destination", "Test Ad Activation Destination", "Send the provider-specific verification test for a configured activation destination and return its safe receipt. Meta and TikTok require testEventCode; Reddit requires testId.", AnalyticsTestActivationDestinationInputSchema, "analyticsTestActivationDestination", false, false, false, true],
13196
13470
  ["analytics_list_activation_receipts", "List Ad Activation Receipts", "List bounded provider delivery receipts for one activation destination.", AnalyticsListActivationReceiptsInputSchema, "analyticsListActivationReceipts", true, true, false, false],
13197
13471
  ["analytics_retry_activation_delivery", "Retry Ad Activation Delivery", "Requeue one failed or dead-lettered activation job. This may cause an external provider delivery.", AnalyticsRetryActivationDeliveryInputSchema, "analyticsRetryActivationDelivery", false, false, false, true],
@@ -13202,7 +13476,7 @@ function registerAnalyticsMcpTools(server, executor) {
13202
13476
  title,
13203
13477
  description,
13204
13478
  inputSchema,
13205
- outputSchema: recordOutputSchema(name, AnalyticsGenericOutputSchema),
13479
+ outputSchema: recordOutputSchema(name, AnalyticsLegacyOperationOutputSchemas[name]),
13206
13480
  annotations: {
13207
13481
  title,
13208
13482
  readOnlyHint: readOnly,
@@ -13210,7 +13484,7 @@ function registerAnalyticsMcpTools(server, executor) {
13210
13484
  idempotentHint: idempotent,
13211
13485
  openWorldHint: openWorld
13212
13486
  }
13213
- }, async (input) => executor[handler](input));
13487
+ }, async (input) => safeAnalyticsResult(await executor[handler](input)));
13214
13488
  }
13215
13489
  server.registerTool("analytics_get_health", {
13216
13490
  title: "Analytics Pixel Health",
@@ -13218,7 +13492,7 @@ function registerAnalyticsMcpTools(server, executor) {
13218
13492
  inputSchema: AnalyticsReportInputSchema,
13219
13493
  outputSchema: recordOutputSchema("analytics_get_health", AnalyticsHealthOutputSchema),
13220
13494
  annotations: readAnnotations("Analytics Pixel Health")
13221
- }, async (input) => executor.analyticsGetHealth(input));
13495
+ }, async (input) => safeAnalyticsResult(await executor.analyticsGetHealth(input)));
13222
13496
  server.registerTool("analytics_create_export", {
13223
13497
  title: "Create Analytics Export",
13224
13498
  description: "Create a persisted, versioned CSV, JSON, or Markdown analytics artifact. Supply a caller-owned idempotencyKey and reuse it only when retrying the same logical export.",
@@ -13231,7 +13505,7 @@ function registerAnalyticsMcpTools(server, executor) {
13231
13505
  idempotentHint: true,
13232
13506
  openWorldHint: false
13233
13507
  }
13234
- }, async (input) => executor.analyticsCreateExport(input));
13508
+ }, async (input) => safeAnalyticsResult(await executor.analyticsCreateExport(input)));
13235
13509
  const productionReads = [
13236
13510
  ["analytics_get_onboarding_state", "Get X-Ray Setup State", "Read evidence-derived setup milestones. Client input cannot mark evidence milestones complete.", AnalyticsSiteResourceInputSchema, "analyticsGetOnboardingState"],
13237
13511
  ["analytics_list_sessions", "List X-Ray Sessions", "Read bounded sessions using opaque references. Raw visitor/session/device identifiers, contact data, IP, and click IDs are omitted.", AnalyticsExplorerInputSchema, "analyticsListSessions"],
@@ -13254,7 +13528,8 @@ function registerAnalyticsMcpTools(server, executor) {
13254
13528
  ["analytics_list_lead_scores", "List Lead Scores", "List transparent versioned fit, engagement, and combined scores. Scores are neither probabilities nor currency values.", AnalyticsNamespaceResourceInputSchema, "analyticsListLeadScores"],
13255
13529
  ["analytics_list_prediction_targets", "List Prediction Targets", "List namespace-local outcome targets and horizons without claiming a model is eligible.", AnalyticsNamespaceResourceInputSchema, "analyticsListPredictionTargets"],
13256
13530
  ["analytics_get_prediction_eligibility", "Get Prediction Eligibility", "Read evidence gates, model state, target horizon, calibration, and safe unavailable reasons. No probability is synthesized from a lead score.", AnalyticsPredictionEligibilityInputSchema, "analyticsGetPredictionEligibility"],
13257
- ["analytics_discover_activation_assets", "Discover Ad Destination Assets", "Read bounded authorized provider datasets/conversion actions through an existing connection. Credentials and unrestricted provider bodies are omitted.", AnalyticsActivationAssetsInputSchema, "analyticsDiscoverActivationAssets"]
13531
+ ["analytics_discover_activation_assets", "Discover Ad Destination Assets", "Read bounded authorized provider datasets/conversion actions through an existing connection. Credentials and unrestricted provider bodies are omitted.", AnalyticsActivationAssetsInputSchema, "analyticsDiscoverActivationAssets"],
13532
+ ["analytics_verify_live_event_definition", "Verify Live Browser Event", "Wait briefly for a persisted event matching this definition; returns observed or not observed.", AnalyticsVerifyLiveEventDefinitionInputSchema, "analyticsVerifyLiveEventDefinition"]
13258
13533
  ];
13259
13534
  for (const [name, title, description, inputSchema, handler] of productionReads) {
13260
13535
  const outputSchema = productionOutputSchemas[name];
@@ -13277,21 +13552,28 @@ function registerAnalyticsMcpTools(server, executor) {
13277
13552
  ["analytics_delete_saved_view", "Delete Saved Analytics View", "Delete one account-scoped saved report view.", AnalyticsSavedViewResourceInputSchema, "analyticsDeleteSavedView", true, true, false],
13278
13553
  ["analytics_withdraw_consent", "Withdraw Analytics Consent", "Record a purpose-scoped withdrawal for an opaque subject. Necessary processing cannot be withdrawn here, and MCP can never grant visitor consent.", AnalyticsConsentWithdrawalInputSchema, "analyticsWithdrawConsent", true, true, false],
13279
13554
  ["analytics_plan_crm_provisioning", "Plan CRM Provisioning", "Preview existing mappings and missing namespaced fields. This read-like plan does not mutate provider schema.", AnalyticsCrmPlanInputSchema, "analyticsPlanCrmProvisioning", true, false, true],
13280
- ["analytics_approve_crm_provisioning", "Approve CRM Provisioning", "Create the exact approved namespaced fields in the connected CRM. Provider field creation may be irreversible and cleanup is manual; inspect analytics_plan_crm_provisioning before approving.", AnalyticsCrmApprovalInputSchema, "analyticsApproveCrmProvisioning", true, true, true],
13555
+ ["analytics_approve_crm_provisioning", "Approve CRM Provisioning", "Create the planned CRM fields. Creation may be irreversible; inspect analytics_plan_crm_provisioning first.", AnalyticsCrmApprovalInputSchema, "analyticsApproveCrmProvisioning", true, true, true],
13281
13556
  ["analytics_test_crm_provisioning", "Test CRM Provisioning", "Perform the authorized reversible test write/readback/cleanup and return a redacted receipt.", AnalyticsCrmPlanResourceInputSchema, "analyticsTestCrmProvisioning", true, false, true],
13282
- ["analytics_start_crm_sync", "Start Inbound CRM Synchronization", "Pull inbound CRM objects and stages into X-Ray through a capability-gated idempotent synchronization. This does not push X-Ray people or deals to the CRM; candidate identities and evidence are excluded.", AnalyticsCrmSyncInputSchema, "analyticsStartCrmSync", true, false, true],
13557
+ ["analytics_start_crm_sync", "Start Inbound CRM Synchronization", "Pull supported CRM objects into X-Ray. This does not push people or deals; candidate evidence is excluded.", AnalyticsCrmSyncInputSchema, "analyticsStartCrmSync", true, false, true],
13283
13558
  ["analytics_update_crm_sync_schedule", "Update CRM Sync Schedule", "Enable or disable a bounded CRM synchronization schedule.", AnalyticsCrmScheduleInputSchema, "analyticsUpdateCrmSyncSchedule", true, false, true],
13284
13559
  ["analytics_discover_crm_sync_objects", "Discover CRM Sync Objects", "Discover bounded provider objects for an explicit mapping. Credentials and unrestricted records are omitted.", AnalyticsCrmSyncDiscoverInputSchema, "analyticsDiscoverCrmSyncObjects", true, false, true],
13285
13560
  ["analytics_test_crm_sync_mapping", "Test CRM Sync Mapping", "Validate a typed CRM mapping without starting synchronization.", AnalyticsCrmMappingTestInputSchema, "analyticsTestCrmSyncMapping", true, false, false],
13286
- ["analytics_sync_crm_person", "Push Confirmed Person to CRM", "Push one confirmed-person projection from X-Ray to the connected CRM after provisioning approval. This is not the inbound analytics_start_crm_sync lane; candidate identity or evidence is schema-invalid.", AnalyticsCrmPersonSyncInputSchema, "analyticsSyncCrmPerson", true, false, true],
13561
+ ["analytics_sync_crm_person", "Push Confirmed Person to CRM", "Push one confirmed person after CRM provisioning. This is not inbound sync; candidate evidence is invalid.", AnalyticsCrmPersonSyncInputSchema, "analyticsSyncCrmPerson", true, false, true],
13287
13562
  ["analytics_apply_crm_pipeline_mapping", "Push CRM Pipeline Event", "Push an explicit versioned pipeline event for a confirmed person from X-Ray to the connected CRM. This is the only MCP lane that may create or update a deal/opportunity.", AnalyticsPipelineApplyInputSchema, "analyticsApplyCrmPipelineMapping", true, false, true],
13288
13563
  ["analytics_cancel_crm_sync", "Cancel CRM Synchronization", "Cancel one synchronization and disable its active work.", AnalyticsCrmSyncStatusInputSchema, "analyticsCancelCrmSync", true, true, true],
13289
- ["analytics_upsert_crm_outbound_policy", "Configure CRM Outbound Policy", "Create or update one immutable-version CRM outbound policy. Policies are disabled unless explicitly enabled, cannot grant visitor consent, and reject candidate identity, raw IP/device signals, and unrestricted journey data.", AnalyticsCrmOutboundPolicyInputSchema, "analyticsUpsertCrmOutboundPolicy", true, false, false],
13564
+ ["analytics_upsert_crm_outbound_policy", "Configure CRM Outbound Policy", "Version a CRM outbound policy. It cannot grant consent or send candidate identity, raw IP/device signals, or full journeys.", AnalyticsCrmOutboundPolicyInputSchema, "analyticsUpsertCrmOutboundPolicy", true, false, false],
13290
13565
  ["analytics_create_lead_score", "Create Lead Score", "Create a bounded declarative score. Arbitrary code, raw HTML, candidate CRM projection, dollars, and probability labels are forbidden.", AnalyticsCreateLeadScoreInputSchema, "analyticsCreateLeadScore", true, false, false],
13291
13566
  ["analytics_create_prediction_target", "Create Prediction Target", "Register a namespace-local confirmed outcome and horizon. This begins evidence collection and does not claim model eligibility.", AnalyticsPredictionTargetInputSchema, "analyticsCreatePredictionTarget", true, false, false],
13292
13567
  ["analytics_export_privacy_subject", "Export Privacy Subject", "Create a governed export for one opaque Site-scoped subject without accepting email or phone lookup.", AnalyticsPrivacyExportInputSchema, "analyticsExportPrivacySubject", true, false, false],
13293
13568
  ["analytics_delete_privacy_subject", "Delete Privacy Subject", "Irreversibly delete one opaque subject and related deterministic/candidate/model data according to lifecycle policy.", AnalyticsPrivacySubjectInputSchema, "analyticsDeletePrivacySubject", true, true, false],
13294
- ["analytics_validate_activation_mapping", "Validate Activation Event Mapping", "Validate explicit confirmed-event mappings against an authorized destination. Candidate-assisted events are rejected; this does not enable delivery.", AnalyticsActivationMappingInputSchema, "analyticsValidateActivationMapping", true, false, false]
13569
+ ["analytics_validate_activation_mapping", "Validate Activation Event Mapping", "Validate confirmed-event mappings. This cannot save mappings or enable delivery.", AnalyticsActivationMappingInputSchema, "analyticsValidateActivationMapping", true, false, false],
13570
+ ["analytics_preview_crm_import", "Preview CRM CSV Import", "Validate mappings and return bounded row/error counts without importing.", AnalyticsPreviewCrmImportInputSchema, "analyticsPreviewCrmImport", true, false, false],
13571
+ ["analytics_commit_crm_import", "Commit CRM CSV Import", "Commit the exact preview fingerprint with a caller retry key.", AnalyticsCommitCrmImportInputSchema, "analyticsCommitCrmImport", true, false, false],
13572
+ ["analytics_export_crm_csv", "Export CRM CSV", "Create a governed CRM CSV; advertising fields require purpose acknowledgement.", AnalyticsCrmManualExportInputSchema, "analyticsExportCrmCsv", true, false, false],
13573
+ ["analytics_export_google_ads_csv", "Export Google Ads CSV", "Create a consent-gated native offline-conversion upload CSV.", AnalyticsAdManualExportInputSchema, "analyticsExportGoogleAdsCsv", true, false, false],
13574
+ ["analytics_export_meta_technical", "Export Meta Technical JSONL", "Create a consent-gated technical JSONL relay artifact; Meta does not accept it as a native upload.", AnalyticsAdManualExportInputSchema, "analyticsExportMetaTechnical", true, false, false],
13575
+ ["analytics_save_activation_mapping", "Save Activation Event Mapping", "Save a typed confirmed-event mapping on an existing destination without enabling delivery.", AnalyticsSaveActivationMappingInputSchema, "analyticsSaveActivationMapping", true, false, false],
13576
+ ["analytics_set_activation_automation", "Set Activation Automation", "Explicitly enable or disable automatic delivery; enablement requires verified readiness.", AnalyticsSetActivationAutomationInputSchema, "analyticsSetActivationAutomation", true, false, false]
13295
13577
  ];
13296
13578
  for (const [name, title, description, inputSchema, handler, idempotent, destructive, openWorld] of productionWrites) {
13297
13579
  const outputSchema = productionOutputSchemas[name];
@@ -13302,7 +13584,7 @@ function registerAnalyticsMcpTools(server, executor) {
13302
13584
  outputSchema: recordOutputSchema(name, outputSchema),
13303
13585
  annotations: {
13304
13586
  title,
13305
- readOnlyHint: name === "analytics_plan_crm_provisioning" || name === "analytics_test_funnel" || name === "analytics_discover_crm_sync_objects" || name === "analytics_test_crm_sync_mapping" || name === "analytics_validate_activation_mapping",
13587
+ readOnlyHint: name === "analytics_plan_crm_provisioning" || name === "analytics_test_funnel" || name === "analytics_discover_crm_sync_objects" || name === "analytics_test_crm_sync_mapping" || name === "analytics_validate_activation_mapping" || name === "analytics_preview_crm_import" || name === "analytics_export_crm_csv" || name === "analytics_export_google_ads_csv" || name === "analytics_export_meta_technical",
13306
13588
  destructiveHint: destructive,
13307
13589
  idempotentHint: idempotent,
13308
13590
  openWorldHint: openWorld
@@ -14527,8 +14809,9 @@ function analyticsReportPath(input, report) {
14527
14809
  function analyticsSitePath(siteId, suffix) {
14528
14810
  return `/analytics/sites/${encodeURIComponent(siteId)}/${suffix}`;
14529
14811
  }
14530
- function analyticsIdempotencyHeaders(scope, key) {
14531
- return { "Idempotency-Key": `${scope}-${createHash4("sha256").update(key).digest("hex")}` };
14812
+ function analyticsIdempotencyHeaders(scope, key, deterministicFallback) {
14813
+ const resolved = key ?? JSON.stringify(deterministicFallback ?? { scope });
14814
+ return { "Idempotency-Key": `${scope}-${createHash4("sha256").update(resolved).digest("hex")}` };
14532
14815
  }
14533
14816
  var HttpMcpToolExecutor = class {
14534
14817
  baseUrl;
@@ -15093,43 +15376,43 @@ var HttpMcpToolExecutor = class {
15093
15376
  return this.getJson(`/analytics/sites/${encodeURIComponent(input.siteId)}/people/${encodeURIComponent(input.personId)}/journey`);
15094
15377
  }
15095
15378
  analyticsCreateCampaignLink(input) {
15096
- const { siteId, ...body } = input;
15097
- return this.call(`/analytics/sites/${encodeURIComponent(siteId)}/campaign-links`, body, this.timeoutMs, "POST");
15379
+ const { siteId, idempotencyKey, ...body } = input;
15380
+ return this.call(`/analytics/sites/${encodeURIComponent(siteId)}/campaign-links`, body, this.timeoutMs, "POST", analyticsIdempotencyHeaders("analytics-campaign-link", idempotencyKey));
15098
15381
  }
15099
15382
  analyticsCreateForm(input) {
15100
- const { siteId, ...body } = input;
15101
- return this.call(`/analytics/sites/${encodeURIComponent(siteId)}/forms`, body, this.timeoutMs, "POST");
15383
+ const { siteId, idempotencyKey, ...body } = input;
15384
+ return this.call(`/analytics/sites/${encodeURIComponent(siteId)}/forms`, body, this.timeoutMs, "POST", analyticsIdempotencyHeaders("analytics-form", idempotencyKey));
15102
15385
  }
15103
15386
  analyticsCreateActivation(input) {
15104
- const { siteId, ...body } = input;
15105
- return this.call(`/analytics/sites/${encodeURIComponent(siteId)}/activation-destinations`, body, this.timeoutMs, "POST");
15387
+ const { siteId, idempotencyKey, ...body } = input;
15388
+ return this.call(`/analytics/sites/${encodeURIComponent(siteId)}/activation-destinations`, body, this.timeoutMs, "POST", analyticsIdempotencyHeaders("analytics-activation-destination", idempotencyKey));
15106
15389
  }
15107
15390
  analyticsCreateConnection(input) {
15108
- const { siteId, ...body } = input;
15109
- return this.call(`/analytics/sites/${encodeURIComponent(siteId)}/connections`, body, this.timeoutMs, "POST");
15391
+ const { siteId, idempotencyKey, ...body } = input;
15392
+ return this.call(`/analytics/sites/${encodeURIComponent(siteId)}/connections`, body, this.timeoutMs, "POST", analyticsIdempotencyHeaders("analytics-connection", idempotencyKey));
15110
15393
  }
15111
15394
  analyticsCreateConversionRule(input) {
15112
- const { siteId, ...body } = input;
15113
- return this.call(`/analytics/sites/${encodeURIComponent(siteId)}/conversion-rules`, body, this.timeoutMs, "POST");
15395
+ const { siteId, idempotencyKey, ...body } = input;
15396
+ return this.call(`/analytics/sites/${encodeURIComponent(siteId)}/conversion-rules`, body, this.timeoutMs, "POST", analyticsIdempotencyHeaders("analytics-conversion-rule", idempotencyKey));
15114
15397
  }
15115
15398
  analyticsCreateEventDefinition(input) {
15116
- const { siteId, ...body } = input;
15117
- return this.call(`/analytics/sites/${encodeURIComponent(siteId)}/event-definitions`, body, this.timeoutMs, "POST");
15399
+ const { siteId, idempotencyKey, ...body } = input;
15400
+ return this.call(`/analytics/sites/${encodeURIComponent(siteId)}/event-definitions`, body, this.timeoutMs, "POST", analyticsIdempotencyHeaders("analytics-event-definition", idempotencyKey));
15118
15401
  }
15119
15402
  analyticsUpdateEventDefinition(input) {
15120
- const { siteId, definitionId, ...body } = input;
15121
- return this.call(`/analytics/sites/${encodeURIComponent(siteId)}/event-definitions/${encodeURIComponent(definitionId)}`, body, this.timeoutMs, "PATCH");
15403
+ const { siteId, definitionId, idempotencyKey, ...body } = input;
15404
+ return this.call(`/analytics/sites/${encodeURIComponent(siteId)}/event-definitions/${encodeURIComponent(definitionId)}`, body, this.timeoutMs, "PATCH", analyticsIdempotencyHeaders("analytics-event-definition-update", idempotencyKey));
15122
15405
  }
15123
15406
  analyticsArchiveEventDefinition(input) {
15124
- return this.call(`/analytics/sites/${encodeURIComponent(input.siteId)}/event-definitions/${encodeURIComponent(input.definitionId)}`, {}, this.timeoutMs, "DELETE");
15407
+ return this.call(`/analytics/sites/${encodeURIComponent(input.siteId)}/event-definitions/${encodeURIComponent(input.definitionId)}`, {}, this.timeoutMs, "DELETE", analyticsIdempotencyHeaders("analytics-event-definition-archive", input.idempotencyKey));
15125
15408
  }
15126
15409
  analyticsTestEventDefinition(input) {
15127
15410
  const { siteId, definitionId, ...body } = input;
15128
15411
  return this.call(`/analytics/sites/${encodeURIComponent(siteId)}/event-definitions/${encodeURIComponent(definitionId)}/test`, body, this.timeoutMs, "POST");
15129
15412
  }
15130
15413
  analyticsTestActivationDestination(input) {
15131
- const { siteId, destinationId, ...body } = input;
15132
- return this.call(`/analytics/sites/${encodeURIComponent(siteId)}/activation-destinations/${encodeURIComponent(destinationId)}/test`, body, this.timeoutMs, "POST");
15414
+ const { siteId, destinationId, idempotencyKey, ...body } = input;
15415
+ return this.call(`/analytics/sites/${encodeURIComponent(siteId)}/activation-destinations/${encodeURIComponent(destinationId)}/test`, body, this.timeoutMs, "POST", analyticsIdempotencyHeaders("analytics-activation-test", idempotencyKey, { siteId, destinationId, body }));
15133
15416
  }
15134
15417
  analyticsListActivationReceipts(input) {
15135
15418
  const query = new URLSearchParams({ limit: String(input.limit) });
@@ -15137,18 +15420,18 @@ var HttpMcpToolExecutor = class {
15137
15420
  return this.getJson(`/analytics/sites/${encodeURIComponent(input.siteId)}/activation-destinations/${encodeURIComponent(input.destinationId)}/receipts?${query}`);
15138
15421
  }
15139
15422
  analyticsRetryActivationDelivery(input) {
15140
- return this.call(`/analytics/sites/${encodeURIComponent(input.siteId)}/activation-jobs/${encodeURIComponent(input.jobId)}/retry`, {}, this.timeoutMs, "POST");
15423
+ return this.call(`/analytics/sites/${encodeURIComponent(input.siteId)}/activation-jobs/${encodeURIComponent(input.jobId)}/retry`, {}, this.timeoutMs, "POST", analyticsIdempotencyHeaders("analytics-activation-retry", input.idempotencyKey));
15141
15424
  }
15142
15425
  analyticsReconcileConnection(input) {
15143
- return this.call(`/analytics/sites/${encodeURIComponent(input.siteId)}/connections/${encodeURIComponent(input.connectionId)}/reconcile`, {}, this.timeoutMs, "POST");
15426
+ return this.call(`/analytics/sites/${encodeURIComponent(input.siteId)}/connections/${encodeURIComponent(input.connectionId)}/reconcile`, {}, this.timeoutMs, "POST", analyticsIdempotencyHeaders("analytics-connection-reconcile", input.idempotencyKey));
15144
15427
  }
15145
15428
  analyticsRecordExternalEvent(input) {
15146
- const { siteId, ...body } = input;
15147
- return this.call(`/analytics/sites/${encodeURIComponent(siteId)}/external-events`, body, this.timeoutMs, "POST");
15429
+ const { siteId, idempotencyKey, ...body } = input;
15430
+ return this.call(`/analytics/sites/${encodeURIComponent(siteId)}/external-events`, body, this.timeoutMs, "POST", analyticsIdempotencyHeaders("analytics-external-event", idempotencyKey));
15148
15431
  }
15149
15432
  analyticsImportCrmCsv(input) {
15150
- const { siteId, ...body } = input;
15151
- return this.call(`/analytics/sites/${encodeURIComponent(siteId)}/crm-imports`, body, this.timeoutMs, "POST");
15433
+ const { siteId, idempotencyKey, ...body } = input;
15434
+ return this.call(`/analytics/sites/${encodeURIComponent(siteId)}/crm-imports`, body, this.timeoutMs, "POST", analyticsIdempotencyHeaders("analytics-crm-import", idempotencyKey));
15152
15435
  }
15153
15436
  analyticsGetHealth(input) {
15154
15437
  return this.getJson(`/analytics/sites/${encodeURIComponent(input.siteId)}/health`);
@@ -15358,6 +15641,38 @@ var HttpMcpToolExecutor = class {
15358
15641
  const { siteId, journeyTier: _journeyTier, ...body } = input;
15359
15642
  return this.call(analyticsSitePath(siteId, "activation-mappings/validate"), body, this.timeoutMs, "POST");
15360
15643
  }
15644
+ analyticsPreviewCrmImport(input) {
15645
+ const { siteId, ...body } = input;
15646
+ return this.call(analyticsSitePath(siteId, "manual-imports/preview"), body, this.timeoutMs, "POST");
15647
+ }
15648
+ analyticsCommitCrmImport(input) {
15649
+ const { siteId, ...body } = input;
15650
+ return this.call(analyticsSitePath(siteId, "manual-imports/commit"), body, this.timeoutMs, "POST", analyticsIdempotencyHeaders("analytics-manual-import", input.idempotencyKey));
15651
+ }
15652
+ analyticsExportCrmCsv(input) {
15653
+ const { siteId, idempotencyKey, ...body } = input;
15654
+ return this.call(analyticsSitePath(siteId, "manual-exports"), { kind: "crm_csv", ...body }, this.timeoutMs, "POST", analyticsIdempotencyHeaders("analytics-crm-export", idempotencyKey));
15655
+ }
15656
+ analyticsExportGoogleAdsCsv(input) {
15657
+ const { siteId, idempotencyKey, ...body } = input;
15658
+ return this.call(analyticsSitePath(siteId, "manual-exports"), { kind: "google_ads_offline_csv", ...body }, this.timeoutMs, "POST", analyticsIdempotencyHeaders("analytics-google-export", idempotencyKey));
15659
+ }
15660
+ analyticsExportMetaTechnical(input) {
15661
+ const { siteId, idempotencyKey, ...body } = input;
15662
+ return this.call(analyticsSitePath(siteId, "manual-exports"), { kind: "meta_conversions_api_jsonl", ...body }, this.timeoutMs, "POST", analyticsIdempotencyHeaders("analytics-meta-export", idempotencyKey));
15663
+ }
15664
+ analyticsSaveActivationMapping(input) {
15665
+ const { siteId, destinationId, journeyTier: _journeyTier, idempotencyKey, ...body } = input;
15666
+ return this.call(analyticsSitePath(siteId, `activation-destinations/${encodeURIComponent(destinationId)}`), body, this.timeoutMs, "PATCH", analyticsIdempotencyHeaders("analytics-activation-mapping", idempotencyKey));
15667
+ }
15668
+ analyticsSetActivationAutomation(input) {
15669
+ const { siteId, destinationId, idempotencyKey, ...body } = input;
15670
+ return this.call(analyticsSitePath(siteId, `activation-destinations/${encodeURIComponent(destinationId)}`), body, this.timeoutMs, "PATCH", analyticsIdempotencyHeaders("analytics-activation-automation", idempotencyKey));
15671
+ }
15672
+ analyticsVerifyLiveEventDefinition(input) {
15673
+ const query = new URLSearchParams({ timeoutMs: String(input.timeoutMs), maxAgeSeconds: String(input.maxAgeSeconds) });
15674
+ return this.getJson(analyticsSitePath(input.siteId, `event-definitions/${encodeURIComponent(input.definitionId)}/verification?${query}`));
15675
+ }
15361
15676
  commonsSearchEntities(input) {
15362
15677
  return this.call("/commons/entities/search", input);
15363
15678
  }
@@ -21987,7 +22302,9 @@ export {
21987
22302
  isLoopbackBaseUrl,
21988
22303
  permitsLocalNetworkAccess,
21989
22304
  handleMcpTasksHttpRequest,
22305
+ parseAnalyticsAttributionQuery,
21990
22306
  parseAnalyticsReportView,
22307
+ XrayCrmOutcomePageSchema,
21991
22308
  parseXrayCrmOutcomePage,
21992
22309
  AnalyticsCrmProviderIdSchema,
21993
22310
  AnalyticsResolvedCrmCapabilitySchema,