fix: AI connection type propagation and get_node improvements (v2.28.1) (#461)

* fix: AI connection type propagation and get_node improvements (v2.28.1)

Bug fixes:
- Issue #458: addConnection now preserves AI connection types (ai_tool, ai_memory, ai_languageModel) instead of defaulting to 'main'
- Fixed false positive "AI Agent has no tools connected" validation warning

Enhancements:
- Added expectedFormat field to resourceLocator properties in get_node output
- Added versionNotice field to make typeVersion more prominent

Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* test: add missing test coverage for PR #461 improvements

- Added test for AI Agent validation positive case (tools properly connected)
- Added 3 tests for expectedFormat on resourceLocator properties

Conceived by Romuald Członkowski - https://www.aiadvisors.pl/en

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Romuald Członkowski
2025-12-01 18:54:15 +01:00
committed by GitHub
parent 33690c5650
commit 3188d209b7
9 changed files with 408 additions and 9 deletions

View File

@@ -2203,14 +2203,19 @@ Full documentation is being prepared. For now, use get_node_essentials for confi
// Get operations (already parsed by repository)
const operations = node.operations || [];
// Get the latest version - this is important for AI to use correct typeVersion
const latestVersion = node.version ?? '1';
const result = {
nodeType: node.nodeType,
workflowNodeType: getWorkflowNodeType(node.package ?? 'n8n-nodes-base', node.nodeType),
displayName: node.displayName,
description: node.description,
category: node.category,
version: node.version ?? '1',
version: latestVersion,
isVersioned: node.isVersioned ?? false,
// Prominent warning to use the correct typeVersion
versionNotice: `⚠️ Use typeVersion: ${latestVersion} when creating this node`,
requiredProperties: essentials.required,
commonProperties: essentials.common,
operations: operations.map((op: any) => ({