n8n-nodes-smart-browser-automation 1.1.10 → 1.1.11
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.
|
@@ -318,13 +318,21 @@ class SmartBrowserAutomation {
|
|
|
318
318
|
console.warn(`Failed to auto-connect browser via tool: ${error.message}`);
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
|
+
// Create a compact tool guide for the AI to fix hallucinations
|
|
322
|
+
// We prioritise showing the most important tools first
|
|
323
|
+
const coreTools = ['browser_navigate', 'browser_click', 'browser_type', 'browser_press_key', 'browser_scroll_to', 'browser_get_text', 'browser_take_screenshot', 'browser_evaluate'];
|
|
324
|
+
const toolGuide = tools
|
|
325
|
+
.filter(t => coreTools.includes(t.name))
|
|
326
|
+
.map(t => `- ${t.name}: ${(t.description || '').substring(0, 100)}`)
|
|
327
|
+
.join('\n');
|
|
328
|
+
const otherToolsCount = tools.length - coreTools.length;
|
|
321
329
|
returnData.push({
|
|
322
330
|
json: {
|
|
323
331
|
success: true,
|
|
324
332
|
message: `MCP session initialized at ${credentials.mcpEndpoint}`,
|
|
325
333
|
browserConnection: connectionStatus,
|
|
326
334
|
browserResponse: connectionResult,
|
|
327
|
-
|
|
335
|
+
toolGuide: `Available Tools (Top ${coreTools.length} of ${tools.length}):\n${toolGuide}\n...and ${otherToolsCount} more. Use these exact names!`,
|
|
328
336
|
},
|
|
329
337
|
pairedItem: i,
|
|
330
338
|
});
|