@tomaspavlin/rohlik-mcp 2.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +185 -3
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -1
- package/dist/rohlik-api.d.ts +4 -0
- package/dist/rohlik-api.d.ts.map +1 -1
- package/dist/rohlik-api.js +75 -10
- package/dist/rohlik-api.js.map +1 -1
- package/dist/tools/frequent-items.d.ts +34 -0
- package/dist/tools/frequent-items.d.ts.map +1 -0
- package/dist/tools/frequent-items.js +184 -0
- package/dist/tools/frequent-items.js.map +1 -0
- package/dist/tools/meal-suggestions.d.ts +36 -0
- package/dist/tools/meal-suggestions.d.ts.map +1 -0
- package/dist/tools/meal-suggestions.js +243 -0
- package/dist/tools/meal-suggestions.js.map +1 -0
- package/dist/tools/order-detail.d.ts +28 -0
- package/dist/tools/order-detail.d.ts.map +1 -0
- package/dist/tools/order-detail.js +78 -0
- package/dist/tools/order-detail.js.map +1 -0
- package/dist/tools/shopping-scenarios.d.ts +15 -0
- package/dist/tools/shopping-scenarios.d.ts.map +1 -0
- package/dist/tools/shopping-scenarios.js +143 -0
- package/dist/tools/shopping-scenarios.js.map +1 -0
- package/dist/types.d.ts +22 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +8 -3
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
export function createShoppingScenariosTool() {
|
|
2
|
+
return {
|
|
3
|
+
name: "get_shopping_scenarios",
|
|
4
|
+
definition: {
|
|
5
|
+
title: "Get Shopping Scenarios",
|
|
6
|
+
description: "Shows example scenarios and use cases for the Rohlik MCP - helps users understand what's possible",
|
|
7
|
+
inputSchema: {}
|
|
8
|
+
},
|
|
9
|
+
handler: async () => {
|
|
10
|
+
const output = `🛒 ROHLIK MCP - WHAT YOU CAN DO
|
|
11
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
12
|
+
|
|
13
|
+
📋 SMART SHOPPING SCENARIOS:
|
|
14
|
+
|
|
15
|
+
1️⃣ MEAL-BASED SHOPPING
|
|
16
|
+
💬 "Add breakfast items I typically order"
|
|
17
|
+
💬 "Show me lunch suggestions for this week"
|
|
18
|
+
💬 "I need dinner ingredients - suggest what I usually buy"
|
|
19
|
+
💬 "Add my usual snacks to the cart"
|
|
20
|
+
🔧 Tool: get_meal_suggestions
|
|
21
|
+
|
|
22
|
+
2️⃣ QUICK REORDERING
|
|
23
|
+
💬 "Show my 20 most frequently purchased items"
|
|
24
|
+
💬 "What do I buy most often?"
|
|
25
|
+
💬 "Add my top 10 frequent items to cart"
|
|
26
|
+
🔧 Tool: get_frequent_items
|
|
27
|
+
|
|
28
|
+
3️⃣ CATEGORY-BASED SHOPPING
|
|
29
|
+
💬 "What dairy products do I usually buy?"
|
|
30
|
+
💬 "Show my top bakery purchases"
|
|
31
|
+
💬 "Add my usual fruits and vegetables"
|
|
32
|
+
🔧 Tool: get_frequent_items (with categories)
|
|
33
|
+
|
|
34
|
+
4️⃣ SPECIFIC PRODUCT SEARCH
|
|
35
|
+
💬 "Find organic milk and add to cart"
|
|
36
|
+
💬 "Search for gluten-free bread"
|
|
37
|
+
💬 "Show me all chocolates on sale"
|
|
38
|
+
🔧 Tool: search_products + add_to_cart
|
|
39
|
+
|
|
40
|
+
5️⃣ WEEKLY PLANNING
|
|
41
|
+
💬 "I need groceries for the whole week - suggest based on my history"
|
|
42
|
+
💬 "Show what I typically buy for breakfast, lunch, and dinner"
|
|
43
|
+
💬 "Help me plan my weekly shopping"
|
|
44
|
+
🔧 Combination of meal suggestions
|
|
45
|
+
|
|
46
|
+
6️⃣ ORDER MANAGEMENT
|
|
47
|
+
💬 "What's in my cart?"
|
|
48
|
+
💬 "Show my last 5 orders"
|
|
49
|
+
💬 "What did I order last week?"
|
|
50
|
+
💬 "Show details of order #1234567"
|
|
51
|
+
🔧 Tools: get_cart_content, get_order_history, get_order_detail
|
|
52
|
+
|
|
53
|
+
7️⃣ DELIVERY PLANNING
|
|
54
|
+
💬 "When is my next delivery?"
|
|
55
|
+
💬 "What delivery slots are available tomorrow?"
|
|
56
|
+
💬 "Show the cheapest delivery slots this week"
|
|
57
|
+
🔧 Tools: get_upcoming_orders, get_delivery_slots
|
|
58
|
+
|
|
59
|
+
8️⃣ ACCOUNT & SAVINGS
|
|
60
|
+
💬 "How much have I saved with Premium?"
|
|
61
|
+
💬 "What are my Premium benefits?"
|
|
62
|
+
💬 "Check my reusable bags count"
|
|
63
|
+
🔧 Tools: get_premium_info, get_reusable_bags_info
|
|
64
|
+
|
|
65
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
66
|
+
|
|
67
|
+
🎯 MEAL TYPES AVAILABLE:
|
|
68
|
+
• breakfast 🍳 - Morning essentials (bread, milk, cereals, fruits)
|
|
69
|
+
• lunch 🍽️ - Midday meal ingredients (meat, vegetables, pasta, rice)
|
|
70
|
+
• dinner 🍴 - Evening meal items (meat, fish, vegetables, sides)
|
|
71
|
+
• snack 🍿 - Quick bites (sweets, fruits, nuts, yogurt)
|
|
72
|
+
• baking 🧁 - Baking supplies (flour, sugar, chocolate, butter)
|
|
73
|
+
• drinks 🥤 - Beverages (coffee, tea, juices, water, alcohol)
|
|
74
|
+
• healthy 🥗 - Health-focused (bio, vegan, gluten-free, vegetables)
|
|
75
|
+
|
|
76
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
77
|
+
|
|
78
|
+
💡 POWER TIPS:
|
|
79
|
+
|
|
80
|
+
✨ Combine suggestions with actions:
|
|
81
|
+
"Show breakfast suggestions and add top 5 to cart"
|
|
82
|
+
|
|
83
|
+
✨ Use natural language:
|
|
84
|
+
"I forgot to buy milk last time, add it to my cart"
|
|
85
|
+
|
|
86
|
+
✨ Ask for alternatives:
|
|
87
|
+
"Find cheaper alternative to product #123456"
|
|
88
|
+
|
|
89
|
+
✨ Plan ahead:
|
|
90
|
+
"What should I order for weekend breakfast?"
|
|
91
|
+
|
|
92
|
+
✨ Be specific:
|
|
93
|
+
"Add ingredients for apple pie - only gluten-free"
|
|
94
|
+
|
|
95
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
96
|
+
|
|
97
|
+
🔧 AVAILABLE TOOLS (${16}):
|
|
98
|
+
|
|
99
|
+
📦 Shopping:
|
|
100
|
+
• search_products - Find products by name
|
|
101
|
+
• add_to_cart - Add products to cart
|
|
102
|
+
• get_cart_content - View current cart
|
|
103
|
+
• remove_from_cart - Remove items
|
|
104
|
+
• get_shopping_list - View shopping lists
|
|
105
|
+
|
|
106
|
+
🤖 Smart Features:
|
|
107
|
+
• get_meal_suggestions - Meal-based suggestions (NEW!)
|
|
108
|
+
• get_frequent_items - Most purchased items
|
|
109
|
+
• get_shopping_scenarios - This help (NEW!)
|
|
110
|
+
|
|
111
|
+
📊 Orders:
|
|
112
|
+
• get_order_history - Past orders
|
|
113
|
+
• get_order_detail - Order details
|
|
114
|
+
• get_upcoming_orders - Scheduled orders
|
|
115
|
+
|
|
116
|
+
🚚 Delivery:
|
|
117
|
+
• get_delivery_info - Current delivery info
|
|
118
|
+
• get_delivery_slots - Available time slots
|
|
119
|
+
|
|
120
|
+
👤 Account:
|
|
121
|
+
• get_account_data - Full account info
|
|
122
|
+
• get_premium_info - Premium subscription
|
|
123
|
+
• get_announcements - Current announcements
|
|
124
|
+
• get_reusable_bags_info - Bag tracking
|
|
125
|
+
|
|
126
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
127
|
+
|
|
128
|
+
🚀 TRY IT NOW:
|
|
129
|
+
Start with: "Show me breakfast suggestions based on what I usually order"
|
|
130
|
+
|
|
131
|
+
💬 Need help? Just ask: "What can I do with Rohlik MCP?"`;
|
|
132
|
+
return {
|
|
133
|
+
content: [
|
|
134
|
+
{
|
|
135
|
+
type: "text",
|
|
136
|
+
text: output
|
|
137
|
+
}
|
|
138
|
+
]
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=shopping-scenarios.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shopping-scenarios.js","sourceRoot":"","sources":["../../src/tools/shopping-scenarios.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,2BAA2B;IACzC,OAAO;QACL,IAAI,EAAE,wBAAwB;QAC9B,UAAU,EAAE;YACV,KAAK,EAAE,wBAAwB;YAC/B,WAAW,EAAE,mGAAmG;YAChH,WAAW,EAAE,EAAE;SAChB;QACD,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAuFC,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yDAkCiC,CAAC;YAEpD,OAAO;gBACL,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EAAE,MAAM;qBACb;iBACF;aACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -124,6 +124,28 @@ export interface RohlikAPIResponse<T = any> {
|
|
|
124
124
|
content: string;
|
|
125
125
|
}>;
|
|
126
126
|
}
|
|
127
|
+
export interface OrderProduct {
|
|
128
|
+
id?: string;
|
|
129
|
+
productId?: string;
|
|
130
|
+
productName?: string;
|
|
131
|
+
name?: string;
|
|
132
|
+
quantity?: number;
|
|
133
|
+
price?: number;
|
|
134
|
+
totalPrice?: number;
|
|
135
|
+
brand?: string;
|
|
136
|
+
}
|
|
137
|
+
export interface OrderDetail {
|
|
138
|
+
id?: string;
|
|
139
|
+
orderNumber?: string;
|
|
140
|
+
status?: string;
|
|
141
|
+
createdAt?: string;
|
|
142
|
+
deliveredAt?: string;
|
|
143
|
+
deliveryDate?: string;
|
|
144
|
+
totalPrice?: number;
|
|
145
|
+
price?: number;
|
|
146
|
+
products?: OrderProduct[];
|
|
147
|
+
items?: OrderProduct[];
|
|
148
|
+
}
|
|
127
149
|
export interface AccountData {
|
|
128
150
|
login?: any;
|
|
129
151
|
delivery?: any;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,aAAa;;;;;;;;;EAGxB,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;EAM7B,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;EAQzB,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK5B,CAAC;AAEH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AACtD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB,CAAC,CAAC,GAAG,GAAG;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,QAAQ,CAAC,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA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E,GAAG,CAAC;IACf,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,eAAe,CAAC,EAAE,GAAG,CAAC;IACtB,kBAAkB,CAAC,EAAE,GAAG,CAAC;IACzB,sBAAsB,CAAC,EAAE,GAAG,CAAC;IAC7B,gBAAgB,CAAC,EAAE,GAAG,CAAC;IACvB,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tomaspavlin/rohlik-mcp",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "MCP server for controlling Rohlik.cz grocery shopping website",
|
|
6
6
|
"keywords": [
|
|
@@ -35,7 +35,11 @@
|
|
|
35
35
|
"start": "node dist/index.js",
|
|
36
36
|
"inspect": "npm run build && npx @modelcontextprotocol/inspector -e ROHLIK_USERNAME=your-email@example.com -e ROHLIK_PASSWORD=your-password node dist/index.js",
|
|
37
37
|
"watch": "tsc --watch",
|
|
38
|
-
"prepublishOnly": "npm run build"
|
|
38
|
+
"prepublishOnly": "npm run build",
|
|
39
|
+
"test": "vitest run",
|
|
40
|
+
"test:watch": "vitest",
|
|
41
|
+
"test:coverage": "vitest run --coverage",
|
|
42
|
+
"validate-api": "tsc && node dist/tests/validate-api.js"
|
|
39
43
|
},
|
|
40
44
|
"dependencies": {
|
|
41
45
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
@@ -44,6 +48,7 @@
|
|
|
44
48
|
},
|
|
45
49
|
"devDependencies": {
|
|
46
50
|
"@types/node": "^20.10.0",
|
|
47
|
-
"typescript": "^5.3.0"
|
|
51
|
+
"typescript": "^5.3.0",
|
|
52
|
+
"vitest": "^3.2.4"
|
|
48
53
|
}
|
|
49
54
|
}
|