byclaw-mcp 0.4.4 → 0.4.6
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/dist/index.js +44 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -132,6 +132,21 @@ server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
|
|
|
132
132
|
description: 'Get platform statistics: products compared, reviews written, recommendations sent.',
|
|
133
133
|
inputSchema: { type: 'object', properties: {} },
|
|
134
134
|
},
|
|
135
|
+
// ── QA / Testing ──
|
|
136
|
+
{
|
|
137
|
+
name: 'test_web_search',
|
|
138
|
+
description: 'Test the web agent search endpoint (same as dashboard search). Use for QA to verify web search behavior vs MCP shop behavior.',
|
|
139
|
+
inputSchema: {
|
|
140
|
+
type: 'object',
|
|
141
|
+
properties: {
|
|
142
|
+
query: { type: 'string', description: 'Search query' },
|
|
143
|
+
max_price: { type: 'number', description: 'Maximum price in EUR (optional)' },
|
|
144
|
+
brand: { type: 'string', description: 'Brand filter (optional)' },
|
|
145
|
+
language: { type: 'string', description: 'Language: de, en (optional)' },
|
|
146
|
+
},
|
|
147
|
+
required: ['query'],
|
|
148
|
+
},
|
|
149
|
+
},
|
|
135
150
|
],
|
|
136
151
|
}));
|
|
137
152
|
// ═══════════════════════════════════════
|
|
@@ -197,6 +212,7 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
|
197
212
|
message_en: 'No products found for your search. Try fewer filters or different terms.',
|
|
198
213
|
compared: 0,
|
|
199
214
|
affiliate_notice: d.disclosure || 'Affiliate disclosure: The links on this page are affiliate links. byclaw.io receives a commission from the retailer when you make a purchase. No additional cost to you.',
|
|
215
|
+
...(d.note ? { note: d.note } : {}),
|
|
200
216
|
}, null, 2) });
|
|
201
217
|
}
|
|
202
218
|
else {
|
|
@@ -292,6 +308,34 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
|
292
308
|
const result = await apiCall('/api/stats');
|
|
293
309
|
return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
|
|
294
310
|
}
|
|
311
|
+
case 'test_web_search': {
|
|
312
|
+
const result = await apiCall('/api/agents/shop', {
|
|
313
|
+
method: 'POST',
|
|
314
|
+
body: JSON.stringify({
|
|
315
|
+
query: args?.query,
|
|
316
|
+
max_price: args?.max_price,
|
|
317
|
+
brand: args?.brand,
|
|
318
|
+
language: args?.language,
|
|
319
|
+
source: 'web',
|
|
320
|
+
}),
|
|
321
|
+
});
|
|
322
|
+
if (!result?.ok) {
|
|
323
|
+
return { content: [{ type: 'text', text: JSON.stringify({ type: 'web_search_error', error: result?.error || 'Unknown error', raw: result }, null, 2) }] };
|
|
324
|
+
}
|
|
325
|
+
const d = result.data;
|
|
326
|
+
return { content: [{ type: 'text', text: JSON.stringify({
|
|
327
|
+
type: d.status || 'web_search_result',
|
|
328
|
+
endpoint: '/api/agents/shop',
|
|
329
|
+
picked: d.picked ? { title: d.picked.title, price: d.picked.price, brand: d.picked.brand, affiliate_url: d.picked.affiliate_url } : null,
|
|
330
|
+
alternatives: (d.alternatives || []).map((a) => ({ title: a.title, price: a.price, brand: a.brand })),
|
|
331
|
+
compared: d.compared || 0,
|
|
332
|
+
review: d.review || null,
|
|
333
|
+
reasoning: d.reasoning || null,
|
|
334
|
+
gift_picks: d.gift_picks ? d.gift_picks.map((g) => ({ title: g.title, price: g.price, brand: g.brand })) : undefined,
|
|
335
|
+
disclosure: d.disclosure || null,
|
|
336
|
+
note: d.note || null,
|
|
337
|
+
}, null, 2) }] };
|
|
338
|
+
}
|
|
295
339
|
default:
|
|
296
340
|
return { content: [{ type: 'text', text: `Unknown tool: ${name}` }], isError: true };
|
|
297
341
|
}
|
package/package.json
CHANGED