feat: add workflowNodeType field to MCP tool responses for proper n8n workflow creation

- Added workflowNodeType field to all node-returning MCP tools
- AI agents now receive both internal format (nodes-base.webhook) and workflow format (n8n-nodes-base.webhook)
- Created getWorkflowNodeType() utility to construct proper n8n format from package name
- Solves issue where AI agents would search nodes and use wrong format in workflows
- No database changes required - uses existing package_name field
- Updated: search_nodes, get_node_info, get_node_essentials, get_node_as_tool_info, validate_node_operation
- Updated CHANGELOG.md with comprehensive documentation of the changes

This completes the fix for issue #71, ensuring AI agents can seamlessly create workflows
with the correct node type format without manual intervention.
This commit is contained in:
czlonkowski
2025-07-18 13:37:05 +02:00
parent f8fa782d7f
commit 92d1b7b273
4 changed files with 42 additions and 1 deletions

View File

@@ -23,6 +23,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **Node type utilities** in `src/utils/node-utils.ts`
- `normalizeNodeType()` - Converts full package names to database format
- `getNodeTypeAlternatives()` - Provides fallback options for edge cases
- `getWorkflowNodeType()` - Constructs proper n8n workflow format from database values
- **workflowNodeType field** in all MCP tool responses that return node information
- AI agents now receive both `nodeType` (internal format) and `workflowNodeType` (n8n format)
- Example: `nodeType: "nodes-base.webhook"`, `workflowNodeType: "n8n-nodes-base.webhook"`
- Prevents confusion where AI agents would search nodes and use wrong format in workflows
- Added to: `search_nodes`, `get_node_info`, `get_node_essentials`, `get_node_as_tool_info`, `validate_node_operation`
## [2.7.17] - 2025-07-17