mallmaverick-store-scraper 0.1.1 → 0.1.2
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/package.json +1 -1
- package/src/mcp-server.js +22 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mallmaverick-store-scraper",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "MCP server + CLI for scraping shopping mall store directories. Hours-first layered pipeline + image classification.",
|
|
5
5
|
"main": "src/main.js",
|
|
6
6
|
"type": "commonjs",
|
package/src/mcp-server.js
CHANGED
|
@@ -59,7 +59,12 @@ const TOOLS = [
|
|
|
59
59
|
'Scrape a shopping-mall store directory and return per-store records ' +
|
|
60
60
|
'(name, hours, phone, logo, brand image, categories, etc.). Use this ' +
|
|
61
61
|
'when the user wants to capture a directory like ' +
|
|
62
|
-
'https://grasslands.ca/store-directory
|
|
62
|
+
'https://grasslands.ca/store-directory/.\n\n' +
|
|
63
|
+
'AFTER RUNNING THIS TOOL: paste the full CSV content (from the ' +
|
|
64
|
+
'"--- CSV ---" block of the response) into your reply inside a fenced ' +
|
|
65
|
+
'code block so the user can copy it directly into their CMS. ' +
|
|
66
|
+
'Also state the saved file path and a one-line summary of how many ' +
|
|
67
|
+
'stores were extracted. Do NOT summarize away the CSV — show it in full.',
|
|
63
68
|
inputSchema: {
|
|
64
69
|
type: 'object',
|
|
65
70
|
properties: {
|
|
@@ -124,8 +129,10 @@ const TOOLS = [
|
|
|
124
129
|
},
|
|
125
130
|
];
|
|
126
131
|
|
|
132
|
+
const PACKAGE_VERSION = '0.1.2';
|
|
133
|
+
|
|
127
134
|
const server = new Server(
|
|
128
|
-
{ name: 'mall-scraper-mcp', version:
|
|
135
|
+
{ name: 'mall-scraper-mcp', version: PACKAGE_VERSION },
|
|
129
136
|
{ capabilities: { tools: {} } }
|
|
130
137
|
);
|
|
131
138
|
|
|
@@ -221,13 +228,23 @@ async function handleScrapeDirectory({ directory_url, max_stores = 10, concurren
|
|
|
221
228
|
written_files: writtenPaths,
|
|
222
229
|
write_error: writeError,
|
|
223
230
|
auth_mode: creds.mode,
|
|
231
|
+
mcp_version: PACKAGE_VERSION,
|
|
224
232
|
};
|
|
225
233
|
|
|
234
|
+
// Order matters — Claude is more likely to surface the first content
|
|
235
|
+
// blocks. Lead with the CSV so it can't be summarized away.
|
|
226
236
|
return {
|
|
227
237
|
content: [
|
|
228
|
-
{
|
|
229
|
-
|
|
230
|
-
|
|
238
|
+
{
|
|
239
|
+
type: 'text',
|
|
240
|
+
text:
|
|
241
|
+
`mall-scraper-mcp v${PACKAGE_VERSION}\n` +
|
|
242
|
+
'CSV ready — paste the block below into your CMS. ' +
|
|
243
|
+
`Also saved to: ${writtenPaths ? writtenPaths.csv : '(disk write failed; CSV is inline only)'}.\n\n` +
|
|
244
|
+
'```csv\n' + csvText + '\n```',
|
|
245
|
+
},
|
|
246
|
+
{ type: 'text', text: '\n--- Run summary ---\n' + JSON.stringify(summary, null, 2) },
|
|
247
|
+
{ type: 'text', text: '\n--- Stores (JSON for debugging) ---\n' + JSON.stringify(stores, null, 2) },
|
|
231
248
|
],
|
|
232
249
|
};
|
|
233
250
|
} finally {
|