byclaw-mcp 0.4.5 → 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.
Files changed (2) hide show
  1. package/dist/index.js +43 -0
  2. 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
  // ═══════════════════════════════════════
@@ -293,6 +308,34 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
293
308
  const result = await apiCall('/api/stats');
294
309
  return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] };
295
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
+ }
296
339
  default:
297
340
  return { content: [{ type: 'text', text: `Unknown tool: ${name}` }], isError: true };
298
341
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "byclaw-mcp",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "MCP Server for byclaw.io — Your AI shopping advisor. Connects Claude Desktop and other MCP clients to the byclaw.io product catalog.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {