@sealmetrics/mcp 0.1.0 → 1.3.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.
Files changed (103) hide show
  1. package/README.md +173 -0
  2. package/dist/client.d.ts +68 -0
  3. package/dist/client.d.ts.map +1 -0
  4. package/dist/client.js +225 -0
  5. package/dist/client.js.map +1 -0
  6. package/dist/embedded.d.ts +29 -0
  7. package/dist/embedded.d.ts.map +1 -0
  8. package/dist/embedded.js +37 -0
  9. package/dist/embedded.js.map +1 -0
  10. package/dist/errors.d.ts +10 -0
  11. package/dist/errors.d.ts.map +1 -0
  12. package/dist/errors.js +55 -0
  13. package/dist/errors.js.map +1 -0
  14. package/dist/index.d.ts +1 -6
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +3809 -780
  17. package/dist/index.js.map +1 -0
  18. package/dist/resources/tracking-guide.d.ts +13 -0
  19. package/dist/resources/tracking-guide.d.ts.map +1 -0
  20. package/dist/resources/tracking-guide.js +479 -0
  21. package/dist/resources/tracking-guide.js.map +1 -0
  22. package/dist/sealmetrics.mcpb +0 -0
  23. package/dist/server.d.ts +38 -0
  24. package/dist/server.d.ts.map +1 -0
  25. package/dist/server.js +132 -0
  26. package/dist/server.js.map +1 -0
  27. package/dist/tools/alerts.d.ts +5 -0
  28. package/dist/tools/alerts.d.ts.map +1 -0
  29. package/dist/tools/alerts.js +80 -0
  30. package/dist/tools/alerts.js.map +1 -0
  31. package/dist/tools/audience.d.ts +7 -0
  32. package/dist/tools/audience.d.ts.map +1 -0
  33. package/dist/tools/audience.js +146 -0
  34. package/dist/tools/audience.js.map +1 -0
  35. package/dist/tools/bots.d.ts +4 -0
  36. package/dist/tools/bots.d.ts.map +1 -0
  37. package/dist/tools/bots.js +52 -0
  38. package/dist/tools/bots.js.map +1 -0
  39. package/dist/tools/channels.d.ts +5 -0
  40. package/dist/tools/channels.d.ts.map +1 -0
  41. package/dist/tools/channels.js +88 -0
  42. package/dist/tools/channels.js.map +1 -0
  43. package/dist/tools/content.d.ts +3 -0
  44. package/dist/tools/content.d.ts.map +1 -0
  45. package/dist/tools/content.js +47 -0
  46. package/dist/tools/content.js.map +1 -0
  47. package/dist/tools/conversions.d.ts +9 -0
  48. package/dist/tools/conversions.d.ts.map +1 -0
  49. package/dist/tools/conversions.js +427 -0
  50. package/dist/tools/conversions.js.map +1 -0
  51. package/dist/tools/funnel.d.ts +3 -0
  52. package/dist/tools/funnel.d.ts.map +1 -0
  53. package/dist/tools/funnel.js +27 -0
  54. package/dist/tools/funnel.js.map +1 -0
  55. package/dist/tools/index.d.ts +16 -0
  56. package/dist/tools/index.d.ts.map +1 -0
  57. package/dist/tools/index.js +83 -0
  58. package/dist/tools/index.js.map +1 -0
  59. package/dist/tools/overview.d.ts +3 -0
  60. package/dist/tools/overview.d.ts.map +1 -0
  61. package/dist/tools/overview.js +26 -0
  62. package/dist/tools/overview.js.map +1 -0
  63. package/dist/tools/pages.d.ts +7 -0
  64. package/dist/tools/pages.d.ts.map +1 -0
  65. package/dist/tools/pages.js +307 -0
  66. package/dist/tools/pages.js.map +1 -0
  67. package/dist/tools/properties.d.ts +5 -0
  68. package/dist/tools/properties.d.ts.map +1 -0
  69. package/dist/tools/properties.js +107 -0
  70. package/dist/tools/properties.js.map +1 -0
  71. package/dist/tools/segments.d.ts +4 -0
  72. package/dist/tools/segments.d.ts.map +1 -0
  73. package/dist/tools/segments.js +49 -0
  74. package/dist/tools/segments.js.map +1 -0
  75. package/dist/tools/setup.d.ts +49 -0
  76. package/dist/tools/setup.d.ts.map +1 -0
  77. package/dist/tools/setup.js +347 -0
  78. package/dist/tools/setup.js.map +1 -0
  79. package/dist/tools/shared.d.ts +33 -0
  80. package/dist/tools/shared.d.ts.map +1 -0
  81. package/dist/tools/shared.js +40 -0
  82. package/dist/tools/shared.js.map +1 -0
  83. package/dist/tools/sites.d.ts +4 -0
  84. package/dist/tools/sites.d.ts.map +1 -0
  85. package/dist/tools/sites.js +36 -0
  86. package/dist/tools/sites.js.map +1 -0
  87. package/dist/tools/tracking.d.ts +3 -0
  88. package/dist/tools/tracking.d.ts.map +1 -0
  89. package/dist/tools/tracking.js +220 -0
  90. package/dist/tools/tracking.js.map +1 -0
  91. package/dist/tools/traffic.d.ts +10 -0
  92. package/dist/tools/traffic.d.ts.map +1 -0
  93. package/dist/tools/traffic.js +273 -0
  94. package/dist/tools/traffic.js.map +1 -0
  95. package/dist/tools/webhooks.d.ts +5 -0
  96. package/dist/tools/webhooks.d.ts.map +1 -0
  97. package/dist/tools/webhooks.js +101 -0
  98. package/dist/tools/webhooks.js.map +1 -0
  99. package/dist/types.d.ts +118 -0
  100. package/dist/types.d.ts.map +1 -0
  101. package/dist/types.js +22 -0
  102. package/dist/types.js.map +1 -0
  103. package/package.json +44 -27
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversions.d.ts","sourceRoot":"","sources":["../../src/tools/conversions.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,eAAO,MAAM,kBAAkB,EAAE,OAoDhC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,OAyCrC,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,OAoB1C,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,OAkE3C,CAAC;AA2KF,eAAO,MAAM,qBAAqB,EAAE,OAwCnC,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,OAuCxC,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,OA+BvC,CAAC"}
@@ -0,0 +1,427 @@
1
+ import { PERIOD_SCHEMA, COMPARE_SCHEMA, LIMIT_SCHEMA, SORT_ORDER_SCHEMA, PAGE_SCHEMA, resolveSiteId, } from "./shared.js";
2
+ export const getConversionsTool = {
3
+ name: "get_conversions",
4
+ description: "Get conversions broken down by type (e.g. purchase, signup). Shows count, revenue, and average order value per conversion type. " +
5
+ "Use for aggregated counts/revenue by conversion type. " +
6
+ "**For per-event detail or per-product analysis use `get_conversions_raw` or `get_conversion_items_raw`.**",
7
+ inputSchema: {
8
+ type: "object",
9
+ properties: {
10
+ site_id: {
11
+ type: "string",
12
+ description: "Site ID. Optional if SEALMETRICS_SITE_ID env var is set.",
13
+ },
14
+ period: PERIOD_SCHEMA,
15
+ compare: COMPARE_SCHEMA,
16
+ limit: LIMIT_SCHEMA,
17
+ sort_by: {
18
+ type: "string",
19
+ description: "Field to sort by.",
20
+ enum: ["count", "revenue", "avg_value"],
21
+ default: "count",
22
+ },
23
+ sort_order: SORT_ORDER_SCHEMA,
24
+ page: PAGE_SCHEMA,
25
+ utm_source: {
26
+ type: "string",
27
+ description: "Filter by traffic source.",
28
+ },
29
+ utm_medium: {
30
+ type: "string",
31
+ description: "Filter by traffic medium.",
32
+ },
33
+ country: {
34
+ type: "string",
35
+ description: "Filter by country code (e.g. 'ES', 'US').",
36
+ },
37
+ },
38
+ },
39
+ handler: async (client, args) => {
40
+ return client.requestPaginated("/stats/conversions", {
41
+ site_id: resolveSiteId(args),
42
+ period: args.period ?? "30d",
43
+ compare: args.compare,
44
+ page_size: String(args.limit ?? 20),
45
+ page: args.page != null ? String(args.page) : undefined,
46
+ sort_by: args.sort_by ?? "count",
47
+ sort_order: args.sort_order ?? "desc",
48
+ utm_source: args.utm_source,
49
+ utm_medium: args.utm_medium,
50
+ country: args.country,
51
+ });
52
+ },
53
+ };
54
+ export const getMicroconversionsTool = {
55
+ name: "get_microconversions",
56
+ description: "Get microconversions (smaller engagement events) broken down by type: add_to_cart, newsletter_signup, pdf_download, etc. Shows count and trends per event type. " +
57
+ "**For per-event detail use `get_microconversions_raw`.**",
58
+ inputSchema: {
59
+ type: "object",
60
+ properties: {
61
+ site_id: {
62
+ type: "string",
63
+ description: "Site ID. Optional if SEALMETRICS_SITE_ID env var is set.",
64
+ },
65
+ period: PERIOD_SCHEMA,
66
+ compare: COMPARE_SCHEMA,
67
+ limit: LIMIT_SCHEMA,
68
+ sort_by: {
69
+ type: "string",
70
+ description: "Field to sort by.",
71
+ enum: ["count", "revenue", "avg_value"],
72
+ default: "count",
73
+ },
74
+ sort_order: SORT_ORDER_SCHEMA,
75
+ page: PAGE_SCHEMA,
76
+ conversion_type: {
77
+ type: "string",
78
+ description: "Filter by specific microconversion type.",
79
+ },
80
+ },
81
+ },
82
+ handler: async (client, args) => {
83
+ return client.requestPaginated("/stats/microconversions", {
84
+ site_id: resolveSiteId(args),
85
+ period: args.period ?? "30d",
86
+ compare: args.compare,
87
+ page_size: String(args.limit ?? 20),
88
+ page: args.page != null ? String(args.page) : undefined,
89
+ sort_by: args.sort_by ?? "count",
90
+ sort_order: args.sort_order ?? "desc",
91
+ conversion_type: args.conversion_type,
92
+ });
93
+ },
94
+ };
95
+ export const listMicroconversionTypesTool = {
96
+ name: "list_microconversion_types",
97
+ description: "Get the list of available microconversion type names for a site. Use this to discover what microconversion types exist before querying details.",
98
+ inputSchema: {
99
+ type: "object",
100
+ properties: {
101
+ site_id: {
102
+ type: "string",
103
+ description: "Site ID. Optional if SEALMETRICS_SITE_ID env var is set.",
104
+ },
105
+ period: PERIOD_SCHEMA,
106
+ },
107
+ },
108
+ handler: async (client, args) => {
109
+ return client.request("/stats/microconversions-types", {
110
+ site_id: resolveSiteId(args),
111
+ period: args.period ?? "30d",
112
+ });
113
+ },
114
+ };
115
+ export const getMicroconversionDetailsTool = {
116
+ name: "get_microconversion_details",
117
+ description: "Get detailed breakdown for a specific microconversion type. Shows metrics segmented by source, medium, campaign, country, device, browser, and OS.",
118
+ inputSchema: {
119
+ type: "object",
120
+ properties: {
121
+ site_id: {
122
+ type: "string",
123
+ description: "Site ID. Optional if SEALMETRICS_SITE_ID env var is set.",
124
+ },
125
+ conversion_type: {
126
+ type: "string",
127
+ description: "The microconversion type to get details for (e.g. 'add_to_cart', 'newsletter_signup').",
128
+ },
129
+ period: PERIOD_SCHEMA,
130
+ utm_source: {
131
+ type: "string",
132
+ description: "Filter by UTM source.",
133
+ },
134
+ utm_medium: {
135
+ type: "string",
136
+ description: "Filter by UTM medium.",
137
+ },
138
+ utm_campaign: {
139
+ type: "string",
140
+ description: "Filter by UTM campaign.",
141
+ },
142
+ utm_term: {
143
+ type: "string",
144
+ description: "Filter by UTM term.",
145
+ },
146
+ country: {
147
+ type: "string",
148
+ description: "Filter by country code (e.g. 'ES', 'US').",
149
+ },
150
+ device_type: {
151
+ type: "string",
152
+ description: "Filter by device type (e.g. 'desktop', 'mobile', 'tablet').",
153
+ },
154
+ browser: {
155
+ type: "string",
156
+ description: "Filter by browser name.",
157
+ },
158
+ os: {
159
+ type: "string",
160
+ description: "Filter by operating system name.",
161
+ },
162
+ },
163
+ required: ["conversion_type"],
164
+ },
165
+ handler: async (client, args) => {
166
+ const conversionType = args.conversion_type;
167
+ return client.request(`/stats/microconversions/${encodeURIComponent(conversionType)}`, {
168
+ site_id: resolveSiteId(args),
169
+ period: args.period ?? "30d",
170
+ utm_source: args.utm_source,
171
+ utm_medium: args.utm_medium,
172
+ utm_campaign: args.utm_campaign,
173
+ utm_term: args.utm_term,
174
+ country: args.country,
175
+ device_type: args.device_type,
176
+ browser: args.browser,
177
+ os: args.os,
178
+ });
179
+ },
180
+ };
181
+ // =============================================================================
182
+ // Raw event-level tools (PRD 08 — extends PRD 03 raw endpoints to MCP).
183
+ // =============================================================================
184
+ //
185
+ // LLM context budget guardrails:
186
+ // - `limit` capped at 100 (API allows up to 10000 — we cap to avoid burning
187
+ // tokens). Validated by JSON Schema; oversized requests fail before reaching
188
+ // the API.
189
+ // - `include_properties` defaults to false on conversions/microconversions —
190
+ // custom properties are noisy metadata that rarely help answer questions.
191
+ // Pass `include_properties=true` to receive the full `properties` object.
192
+ // - `get_conversion_items_raw` always returns properties (sku/price/qty live there).
193
+ const RAW_LIMIT_SCHEMA = {
194
+ type: "number",
195
+ description: "Maximum number of rows to return (default: 10, max: 100). MCP-side cap to control token usage.",
196
+ default: 10,
197
+ minimum: 1,
198
+ maximum: 100,
199
+ };
200
+ const RAW_FILTER_KEYS = [
201
+ "conversion_type",
202
+ "country",
203
+ "device_type",
204
+ "browser",
205
+ "os",
206
+ "channel_group",
207
+ "utm_source",
208
+ "utm_medium",
209
+ "utm_campaign",
210
+ "utm_term",
211
+ "utm_content",
212
+ ];
213
+ function pickRawFilters(args) {
214
+ const out = {};
215
+ for (const key of RAW_FILTER_KEYS) {
216
+ const value = args[key];
217
+ if (Array.isArray(value) && value.length > 0) {
218
+ out[key] = value;
219
+ }
220
+ }
221
+ return out;
222
+ }
223
+ function buildRawDates(args) {
224
+ const startDate = args.start_date;
225
+ const endDate = args.end_date;
226
+ if (startDate && endDate) {
227
+ return { start_date: startDate, end_date: endDate };
228
+ }
229
+ return { period: args.period ?? "30d" };
230
+ }
231
+ const RAW_DATE_SCHEMA = {
232
+ period: PERIOD_SCHEMA,
233
+ start_date: {
234
+ type: "string",
235
+ description: "Custom start date (YYYY-MM-DD). Use together with end_date as an alternative to period. Date range capped at 31 days by the API.",
236
+ },
237
+ end_date: {
238
+ type: "string",
239
+ description: "Custom end date (YYYY-MM-DD). Use together with start_date.",
240
+ },
241
+ };
242
+ const RAW_MULTI_FILTER_SCHEMA = {
243
+ conversion_type: {
244
+ type: "array",
245
+ items: { type: "string", minLength: 1 },
246
+ minItems: 1,
247
+ description: "Filter by conversion type (e.g. ['purchase']).",
248
+ },
249
+ country: {
250
+ type: "array",
251
+ items: { type: "string", minLength: 1 },
252
+ minItems: 1,
253
+ description: "Filter by country code (e.g. ['ES', 'US']).",
254
+ },
255
+ device_type: {
256
+ type: "array",
257
+ items: { type: "string", minLength: 1 },
258
+ minItems: 1,
259
+ description: "Filter by device type (e.g. ['mobile']).",
260
+ },
261
+ browser: {
262
+ type: "array",
263
+ items: { type: "string", minLength: 1 },
264
+ minItems: 1,
265
+ description: "Filter by browser.",
266
+ },
267
+ os: {
268
+ type: "array",
269
+ items: { type: "string", minLength: 1 },
270
+ minItems: 1,
271
+ description: "Filter by operating system.",
272
+ },
273
+ channel_group: {
274
+ type: "array",
275
+ items: { type: "string", minLength: 1 },
276
+ minItems: 1,
277
+ description: "Filter by channel group.",
278
+ },
279
+ utm_source: {
280
+ type: "array",
281
+ items: { type: "string", minLength: 1 },
282
+ minItems: 1,
283
+ description: "Filter by UTM source.",
284
+ },
285
+ utm_medium: {
286
+ type: "array",
287
+ items: { type: "string", minLength: 1 },
288
+ minItems: 1,
289
+ description: "Filter by UTM medium.",
290
+ },
291
+ utm_campaign: {
292
+ type: "array",
293
+ items: { type: "string", minLength: 1 },
294
+ minItems: 1,
295
+ description: "Filter by UTM campaign.",
296
+ },
297
+ utm_term: {
298
+ type: "array",
299
+ items: { type: "string", minLength: 1 },
300
+ minItems: 1,
301
+ description: "Filter by UTM term.",
302
+ },
303
+ utm_content: {
304
+ type: "array",
305
+ items: { type: "string", minLength: 1 },
306
+ minItems: 1,
307
+ description: "Filter by UTM content.",
308
+ },
309
+ };
310
+ function stripProperties(result) {
311
+ return {
312
+ ...result,
313
+ data: result.data.map((row) => {
314
+ const { properties: _omit, ...rest } = row;
315
+ return rest;
316
+ }),
317
+ };
318
+ }
319
+ export const getConversionsRawTool = {
320
+ name: "get_conversions_raw",
321
+ description: "Returns raw conversion rows from /stats/conversions/raw (one row per event, with timestamp_utc and timestamp_local). " +
322
+ "Use for one-row-per-event detail. " +
323
+ "**For per-product/SKU analysis prefer `get_conversion_items_raw` (always includes item properties like sku, price, quantity).** " +
324
+ "Custom `properties` are excluded by default — pass `include_properties=true` to receive them. " +
325
+ "Date range capped at 31 days; page_size capped at 100 to control token usage.",
326
+ inputSchema: {
327
+ type: "object",
328
+ properties: {
329
+ site_id: {
330
+ type: "string",
331
+ description: "Site ID. Optional if SEALMETRICS_SITE_ID env var is set.",
332
+ },
333
+ ...RAW_DATE_SCHEMA,
334
+ page: PAGE_SCHEMA,
335
+ limit: RAW_LIMIT_SCHEMA,
336
+ include_properties: {
337
+ type: "boolean",
338
+ description: "If true, include the custom `properties` object in each row. Default false to keep responses compact.",
339
+ default: false,
340
+ },
341
+ ...RAW_MULTI_FILTER_SCHEMA,
342
+ },
343
+ },
344
+ handler: async (client, args) => {
345
+ const limit = args.limit ?? 10;
346
+ const includeProperties = args.include_properties === true;
347
+ const dates = buildRawDates(args);
348
+ const result = await client.requestPaginated("/stats/conversions/raw", {
349
+ site_id: resolveSiteId(args),
350
+ ...dates,
351
+ page_size: String(limit),
352
+ page: args.page != null ? String(args.page) : undefined,
353
+ ...pickRawFilters(args),
354
+ });
355
+ return includeProperties ? result : stripProperties(result);
356
+ },
357
+ };
358
+ export const getMicroconversionsRawTool = {
359
+ name: "get_microconversions_raw",
360
+ description: "Returns raw microconversion rows from /stats/microconversions/raw (one row per event, with timestamp_utc and timestamp_local). " +
361
+ "Use for one-row-per-event detail of microconversions (add_to_cart, newsletter_signup, etc.). " +
362
+ "Custom `properties` are excluded by default — pass `include_properties=true` to receive them. " +
363
+ "Date range capped at 31 days; page_size capped at 100 to control token usage.",
364
+ inputSchema: {
365
+ type: "object",
366
+ properties: {
367
+ site_id: {
368
+ type: "string",
369
+ description: "Site ID. Optional if SEALMETRICS_SITE_ID env var is set.",
370
+ },
371
+ ...RAW_DATE_SCHEMA,
372
+ page: PAGE_SCHEMA,
373
+ limit: RAW_LIMIT_SCHEMA,
374
+ include_properties: {
375
+ type: "boolean",
376
+ description: "If true, include the custom `properties` object in each row. Default false to keep responses compact.",
377
+ default: false,
378
+ },
379
+ ...RAW_MULTI_FILTER_SCHEMA,
380
+ },
381
+ },
382
+ handler: async (client, args) => {
383
+ const limit = args.limit ?? 10;
384
+ const includeProperties = args.include_properties === true;
385
+ const dates = buildRawDates(args);
386
+ const result = await client.requestPaginated("/stats/microconversions/raw", {
387
+ site_id: resolveSiteId(args),
388
+ ...dates,
389
+ page_size: String(limit),
390
+ page: args.page != null ? String(args.page) : undefined,
391
+ ...pickRawFilters(args),
392
+ });
393
+ return includeProperties ? result : stripProperties(result);
394
+ },
395
+ };
396
+ export const getConversionItemsRawTool = {
397
+ name: "get_conversion_items_raw",
398
+ description: "Returns one row per item inside a conversion (e.g. one row per product in a purchase) from /stats/conversion-items/raw. " +
399
+ "`properties` always included — that's where product_id, sku, price, quantity live. " +
400
+ "**Best tool for per-product analytics.** " +
401
+ "Date range capped at 31 days; page_size capped at 100 to control token usage.",
402
+ inputSchema: {
403
+ type: "object",
404
+ properties: {
405
+ site_id: {
406
+ type: "string",
407
+ description: "Site ID. Optional if SEALMETRICS_SITE_ID env var is set.",
408
+ },
409
+ ...RAW_DATE_SCHEMA,
410
+ page: PAGE_SCHEMA,
411
+ limit: RAW_LIMIT_SCHEMA,
412
+ ...RAW_MULTI_FILTER_SCHEMA,
413
+ },
414
+ },
415
+ handler: async (client, args) => {
416
+ const limit = args.limit ?? 10;
417
+ const dates = buildRawDates(args);
418
+ return client.requestPaginated("/stats/conversion-items/raw", {
419
+ site_id: resolveSiteId(args),
420
+ ...dates,
421
+ page_size: String(limit),
422
+ page: args.page != null ? String(args.page) : undefined,
423
+ ...pickRawFilters(args),
424
+ });
425
+ },
426
+ };
427
+ //# sourceMappingURL=conversions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversions.js","sourceRoot":"","sources":["../../src/tools/conversions.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,aAAa,GACd,MAAM,aAAa,CAAC;AAGrB,MAAM,CAAC,MAAM,kBAAkB,GAAY;IACzC,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,kIAAkI;QAClI,wDAAwD;QACxD,2GAA2G;IAC7G,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0DAA0D;aACxE;YACD,MAAM,EAAE,aAAa;YACrB,OAAO,EAAE,cAAc;YACvB,KAAK,EAAE,YAAY;YACnB,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ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KAAK;YACR,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC;YACxB,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAc,CAAC,CAAC,CAAC,CAAC,SAAS;YACjE,GAAG,cAAc,CAAC,IAAI,CAAC;SACxB,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { ToolDef } from "./index.js";
2
+ export declare const getFunnelTool: ToolDef;
3
+ //# sourceMappingURL=funnel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"funnel.d.ts","sourceRoot":"","sources":["../../src/tools/funnel.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,eAAO,MAAM,aAAa,EAAE,OAyB3B,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { PERIOD_SCHEMA, resolveSiteId } from "./shared.js";
2
+ export const getFunnelTool = {
3
+ name: "get_funnel",
4
+ description: "Get funnel analysis showing conversion rates between steps. Returns step-by-step data including visitor count, conversion rate, and dropoff at each stage. Useful for finding where users drop off in multi-step flows.",
5
+ inputSchema: {
6
+ type: "object",
7
+ properties: {
8
+ site_id: {
9
+ type: "string",
10
+ description: "Site ID. Optional if SEALMETRICS_SITE_ID env var is set.",
11
+ },
12
+ period: PERIOD_SCHEMA,
13
+ country: {
14
+ type: "string",
15
+ description: "Filter by country code (e.g. 'ES').",
16
+ },
17
+ },
18
+ },
19
+ handler: async (client, args) => {
20
+ return client.request("/stats/funnel", {
21
+ site_id: resolveSiteId(args),
22
+ period: args.period ?? "30d",
23
+ country: args.country,
24
+ });
25
+ },
26
+ };
27
+ //# sourceMappingURL=funnel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"funnel.js","sourceRoot":"","sources":["../../src/tools/funnel.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG3D,MAAM,CAAC,MAAM,aAAa,GAAY;IACpC,IAAI,EAAE,YAAY;IAClB,WAAW,EACT,yNAAyN;IAC3N,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0DAA0D;aACxE;YACD,MAAM,EAAE,aAAa;YACrB,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,qCAAqC;aACnD;SACF;KACF;IACD,OAAO,EAAE,KAAK,EAAE,MAAyB,EAAE,IAA6B,EAAE,EAAE;QAC1E,OAAO,MAAM,CAAC,OAAO,CAAe,eAAe,EAAE;YACnD,OAAO,EAAE,aAAa,CAAC,IAAI,CAAC;YAC5B,MAAM,EAAG,IAAI,CAAC,MAAiB,IAAI,KAAK;YACxC,OAAO,EAAE,IAAI,CAAC,OAA6B;SAC5C,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { SealMetricsClient } from "../client.js";
2
+ export { PERIOD_SCHEMA, COMPARE_SCHEMA, LIMIT_SCHEMA, SORT_ORDER_SCHEMA, PAGE_SCHEMA, resolveSiteId, } from "./shared.js";
3
+ /** Tool definition with name, description, schema, and handler. */
4
+ export interface ToolDef {
5
+ name: string;
6
+ description: string;
7
+ inputSchema: {
8
+ type: "object";
9
+ properties: Record<string, unknown>;
10
+ required?: string[];
11
+ };
12
+ handler: (client: SealMetricsClient, args: Record<string, unknown>) => Promise<unknown>;
13
+ }
14
+ /** All registered tools. */
15
+ export declare const ALL_TOOLS: ToolDef[];
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAmDtD,OAAO,EACL,aAAa,EACb,cAAc,EACd,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,aAAa,GACd,MAAM,aAAa,CAAC;AAErB,mEAAmE;AACnE,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ,CAAC;QACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACpC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;KACrB,CAAC;IACF,OAAO,EAAE,CACP,MAAM,EAAE,iBAAiB,EACzB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC1B,OAAO,CAAC,OAAO,CAAC,CAAC;CACvB;AAED,4BAA4B;AAC5B,eAAO,MAAM,SAAS,EAAE,OAAO,EA+D9B,CAAC"}
@@ -0,0 +1,83 @@
1
+ import { listSitesTool, getSiteTool } from "./sites.js";
2
+ import { getOverviewTool } from "./overview.js";
3
+ import { getTrafficSourcesTool, getTrafficMediumsTool, getCampaignsTool, getTermsTool, getTopSourcesTool, getTopCampaignsTool, getTopTermsTool, getTopReferrersTool, } from "./traffic.js";
4
+ import { getPagesTool, getLandingPagesTool, getTopPagesTool, getTopLandingPagesTool, getLandingPagesByContentGroupTool, } from "./pages.js";
5
+ import { getConversionsTool, getMicroconversionsTool, listMicroconversionTypesTool, getMicroconversionDetailsTool, getConversionsRawTool, getMicroconversionsRawTool, getConversionItemsRawTool, } from "./conversions.js";
6
+ import { getCountriesTool, getDevicesTool, getBrowsersTool, getOperatingSystemsTool, getDeviceTypesTool, } from "./audience.js";
7
+ import { getFunnelTool } from "./funnel.js";
8
+ import { getContentGroupsTool } from "./content.js";
9
+ import { getChannelsTool, getTopChannelsTool, listChannelRulesTool } from "./channels.js";
10
+ import { getBotStatsTool, getSuspiciousSessionsTool } from "./bots.js";
11
+ import { listSegmentsTool, getSegmentTool } from "./segments.js";
12
+ import { listAlertsTool, getAlertHistoryTool, getAlertStatsTool } from "./alerts.js";
13
+ import { listWebhooksTool, listWebhookDeliveriesTool, getWebhookStatsTool } from "./webhooks.js";
14
+ import { getTrackingCodeTool } from "./tracking.js";
15
+ import { listPropertyKeysTool, getPropertyValuesTool, getPropertyBreakdownTool, } from "./properties.js";
16
+ // Re-export shared utilities for convenience
17
+ export { PERIOD_SCHEMA, COMPARE_SCHEMA, LIMIT_SCHEMA, SORT_ORDER_SCHEMA, PAGE_SCHEMA, resolveSiteId, } from "./shared.js";
18
+ /** All registered tools. */
19
+ export const ALL_TOOLS = [
20
+ // Sites
21
+ listSitesTool,
22
+ getSiteTool,
23
+ // Overview
24
+ getOverviewTool,
25
+ // Traffic
26
+ getTrafficSourcesTool,
27
+ getTrafficMediumsTool,
28
+ getCampaignsTool,
29
+ getTermsTool,
30
+ getTopSourcesTool,
31
+ getTopCampaignsTool,
32
+ getTopTermsTool,
33
+ getTopReferrersTool,
34
+ // Pages & Content
35
+ getPagesTool,
36
+ getLandingPagesTool,
37
+ getTopPagesTool,
38
+ getTopLandingPagesTool,
39
+ getLandingPagesByContentGroupTool,
40
+ getContentGroupsTool,
41
+ // Conversions
42
+ getConversionsTool,
43
+ getMicroconversionsTool,
44
+ listMicroconversionTypesTool,
45
+ getMicroconversionDetailsTool,
46
+ // Conversions — raw event-level (PRD 08)
47
+ getConversionsRawTool,
48
+ getMicroconversionsRawTool,
49
+ getConversionItemsRawTool,
50
+ // Audience
51
+ getCountriesTool,
52
+ getDevicesTool,
53
+ getDeviceTypesTool,
54
+ getBrowsersTool,
55
+ getOperatingSystemsTool,
56
+ // Channels
57
+ getChannelsTool,
58
+ getTopChannelsTool,
59
+ listChannelRulesTool,
60
+ // Properties
61
+ listPropertyKeysTool,
62
+ getPropertyValuesTool,
63
+ getPropertyBreakdownTool,
64
+ // Funnel
65
+ getFunnelTool,
66
+ // Bot Detection
67
+ getBotStatsTool,
68
+ getSuspiciousSessionsTool,
69
+ // Segments
70
+ listSegmentsTool,
71
+ getSegmentTool,
72
+ // Alerts
73
+ listAlertsTool,
74
+ getAlertHistoryTool,
75
+ getAlertStatsTool,
76
+ // Webhooks
77
+ listWebhooksTool,
78
+ listWebhookDeliveriesTool,
79
+ getWebhookStatsTool,
80
+ // Tracking
81
+ getTrackingCodeTool,
82
+ ];
83
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,mBAAmB,GACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,sBAAsB,EACtB,iCAAiC,GAClC,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,4BAA4B,EAC5B,6BAA6B,EAC7B,qBAAqB,EACrB,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,WAAW,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,cAAc,EA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IACX,mBAAmB;CACpB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { ToolDef } from "./index.js";
2
+ export declare const getOverviewTool: ToolDef;
3
+ //# sourceMappingURL=overview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overview.d.ts","sourceRoot":"","sources":["../../src/tools/overview.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,eAAO,MAAM,eAAe,EAAE,OA4B7B,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { PERIOD_SCHEMA, COMPARE_SCHEMA, resolveSiteId } from "./shared.js";
2
+ export const getOverviewTool = {
3
+ name: "get_overview",
4
+ description: "Get dashboard KPIs: pageviews, entrances, bounce rate, conversions, revenue. Includes time series data and optional period-over-period comparison. This is the best starting point for understanding a site's performance.",
5
+ inputSchema: {
6
+ type: "object",
7
+ properties: {
8
+ site_id: {
9
+ type: "string",
10
+ description: "Site ID. Optional if SEALMETRICS_SITE_ID env var is set.",
11
+ },
12
+ period: PERIOD_SCHEMA,
13
+ compare: COMPARE_SCHEMA,
14
+ },
15
+ },
16
+ handler: async (client, args) => {
17
+ const siteId = resolveSiteId(args);
18
+ const params = {
19
+ site_id: siteId,
20
+ period: args.period ?? "30d",
21
+ compare: args.compare,
22
+ };
23
+ return client.request("/stats/overview", params);
24
+ },
25
+ };
26
+ //# sourceMappingURL=overview.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overview.js","sourceRoot":"","sources":["../../src/tools/overview.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG3E,MAAM,CAAC,MAAM,eAAe,GAAY;IACtC,IAAI,EAAE,cAAc;IACpB,WAAW,EACT,4NAA4N;IAC9N,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,0DAA0D;aAC7D;YACD,MAAM,EAAE,aAAa;YACrB,OAAO,EAAE,cAAc;SACxB;KACF;IACD,OAAO,EAAE,KAAK,EACZ,MAAyB,EACzB,IAA6B,EAC7B,EAAE;QACF,MAAM,MAAM,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;QACnC,MAAM,MAAM,GAAuC;YACjD,OAAO,EAAE,MAAM;YACf,MAAM,EAAG,IAAI,CAAC,MAAiB,IAAI,KAAK;YACxC,OAAO,EAAE,IAAI,CAAC,OAA6B;SAC5C,CAAC;QACF,OAAO,MAAM,CAAC,OAAO,CAAgB,iBAAiB,EAAE,MAAM,CAAC,CAAC;IAClE,CAAC;CACF,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { ToolDef } from "./index.js";
2
+ export declare const getPagesTool: ToolDef;
3
+ export declare const getLandingPagesTool: ToolDef;
4
+ export declare const getTopPagesTool: ToolDef;
5
+ export declare const getTopLandingPagesTool: ToolDef;
6
+ export declare const getLandingPagesByContentGroupTool: ToolDef;
7
+ //# sourceMappingURL=pages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pages.d.ts","sourceRoot":"","sources":["../../src/tools/pages.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAiG1C,eAAO,MAAM,YAAY,EAAE,OA8C1B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,OA6CjC,CAAC;AAIF,eAAO,MAAM,eAAe,EAAE,OA+C7B,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,OA0CpC,CAAC;AAEF,eAAO,MAAM,iCAAiC,EAAE,OAmC/C,CAAC"}