growtics-mcp 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -29,6 +29,7 @@ import * as getFunnels from './tools/get-funnels.js';
29
29
  import * as getReleases from './tools/get-releases.js';
30
30
  import * as getSeoSuggestions from './tools/get-seo-suggestions.js';
31
31
  import * as analyzeTrafficDrop from './tools/analyze-traffic-drop.js';
32
+ import * as getGrowActions from './tools/get-grow-actions.js';
32
33
 
33
34
  // ── Configuration ─────────────────────────────────────────────────────────────
34
35
  const API_KEY = process.env.GROWTICS_API_KEY;
@@ -79,6 +80,7 @@ const TOOLS = [
79
80
  getReleases,
80
81
  getSeoSuggestions,
81
82
  analyzeTrafficDrop,
83
+ getGrowActions,
82
84
  ];
83
85
 
84
86
  const TOOL_MAP = Object.fromEntries(TOOLS.map(t => [t.definition.name, t]));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "growtics-mcp",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "MCP server for Growtics Analytics — ask your AI assistant questions about your website traffic, SEO, conversions, and releases.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -0,0 +1,83 @@
1
+ /**
2
+ * get-grow-actions tool
3
+ * Returns active and past Grow Actions (daily marketing checklist items) from Growtics.
4
+ */
5
+ export const definition = {
6
+ name: 'get-grow-actions',
7
+ description:
8
+ 'Get active (today\'s) and past Grow Actions (daily marketing tasks, social posts, directories) ' +
9
+ 'configured for a site, including statuses and completion metrics. Use this to answer ' +
10
+ '"What marketing actions should I take today?", "What is my marketing task history?", ' +
11
+ 'or "How many grow actions have I completed this week?"',
12
+ inputSchema: {
13
+ type: 'object',
14
+ properties: {
15
+ siteId: {
16
+ type: 'string',
17
+ description: 'The Growtics site UUID (get it from list-sites)',
18
+ },
19
+ status: {
20
+ type: 'string',
21
+ enum: ['pending', 'done', 'skipped', 'expired'],
22
+ description: 'Filter by status. Leave empty to get all.',
23
+ },
24
+ },
25
+ required: ['siteId'],
26
+ },
27
+ };
28
+
29
+ const STATUS_EMOJI = {
30
+ pending: '⏳ Pending',
31
+ done: '✅ Done',
32
+ skipped: '🚫 Skipped',
33
+ expired: '🛑 Expired',
34
+ };
35
+
36
+ export async function run({ args, apiClient }) {
37
+ const { siteId, status } = args;
38
+
39
+ const params = new URLSearchParams({ siteId });
40
+ if (status) params.set('status', status);
41
+
42
+ const data = await apiClient.get(`/api/v1/grow-actions?${params.toString()}`);
43
+ const { activeActions, history, metrics } = data.data;
44
+ const meta = data.meta;
45
+
46
+ const lines = [
47
+ `## Grow Actions — ${meta.siteName}`,
48
+ `**Domain:** ${meta.domain} | **Done (All Time):** ${metrics.totalDone} | **Done (This Week):** ${metrics.doneThisWeek}\n`,
49
+ ];
50
+
51
+ // 1. Active Actions
52
+ lines.push('### 🎯 Active Actions (Today & Outstanding)');
53
+ if (!activeActions?.length) {
54
+ lines.push('_No active actions at the moment._\n');
55
+ } else {
56
+ activeActions.forEach((act) => {
57
+ const statusText = STATUS_EMOJI[act.status] || act.status;
58
+ lines.push(`\n**• ${act.title}** (${statusText})`);
59
+ lines.push(` > ${act.description}`);
60
+ if (act.completedAt) {
61
+ lines.push(` _Completed at: ${new Date(act.completedAt).toLocaleDateString()}_`);
62
+ }
63
+ });
64
+ lines.push('');
65
+ }
66
+
67
+ // 2. History
68
+ lines.push('### 📜 Action History (Last 30 Days)');
69
+ if (!history?.length) {
70
+ lines.push('_No history records found._');
71
+ } else {
72
+ history.forEach((act) => {
73
+ const statusText = STATUS_EMOJI[act.status] || act.status;
74
+ lines.push(`\n**• ${act.title}** (${statusText})`);
75
+ lines.push(` > ${act.description}`);
76
+ if (act.completedAt) {
77
+ lines.push(` _Completed at: ${new Date(act.completedAt).toLocaleDateString()}_`);
78
+ }
79
+ });
80
+ }
81
+
82
+ return { text: lines.join('\n') };
83
+ }